}
}
}
private void processSubstitutedSimilarTarget(DLFContext context, LFEdge outgoing) {
LFVertex target = outgoing.getTarget();
Map<LFVertex, Set<LFEdge>> subsBySource = graphDifference.substitutionsBySourceFor(outgoing);
DLFContext ctxt = context.copy();
// for each substituted edge, look for similar target
for(LFVertex subSource : subsBySource.keySet()) {
Set<LFEdge> similarTargetEdges = new FilteredLFEdgeSet(subsBySource.get(subSource),
new SimilarTargetEdgeFilter(ctxt.vertex, outgoing.getLabel()));
if(!similarTargetEdges.isEmpty()) {
if(similarTargetEdges.size() > 1) { // more than one similar target?
System.err.println("more than one similar target edge for " + ctxt.vertex
+ ": " + similarTargetEdges); // TODO figure out what to do about this
}
assimilateAttributes(ctxt, target, similarTargetEdges.iterator().next().getTarget());
LFVertex hp = ctxt.getGraph().highestLFAncestorOf(target);
if(hp == null || hp.equals(outgoing.getSource())) {
context.getVertices(SHARED).add(target);
ctxt.vertex = target;
ctxt.vertices = context.copyVertices(LOCAL_ANCESTOR, PREDICATES);
ctxt.parent.appendChild(createDisjunctiveElement(ctxt));