static bool web_matchNodeLists_debug; static int web_matchNodeLists(L l1, L l2) { if (l(l1) != l(l2)) ret -1000; int score = 0; if (empty(l1)) ret score; HashMap map = twoListsToHashMap(l1, l2); Web web = first(l1).web, web2 = first(l2).web; // Score nodes for i over l1: { WebNode a = l1.get(i), b = l2.get(i); if (web_isAnythingVariable(a)) continue; //if (neq(web_labels(a), web_labels(b))) --score; if (!containsAllIC_lisp(web_labels(b), web_labels(a))) --score; } // Score relations for (WebRelation rel : web_relationObjects(web)) { WebNode aa = map.get(rel.a), bb = map.get(rel.b); if (aa == null || bb == null) continue; WebRelation rel2 = web2.getRelationOpt(aa, bb); if (web_matchNodeLists_debug) print("a=" + rel.a + ", b=" + rel.b + ", aa=" + aa + ", bb=" + bb + ", rel2 labels=" + (rel2 == null ? "-" : str(web_labels(rel2)) + ", labels=" + rel.labels); if (rel2 == null || !containsAllIC_lisp(web_labels(rel2), web_labels(rel))) --score; } ret score; }