!7 sS inputDiagrams = [[ CirclesAndLines(circles=[Circle(text="A [Anything]", x=d("0.32"), y=d("0.55")), Circle(text="B [Anything]", x=d("0.68"), y=d("0.55"))], lines=[Arrow(a=t5, b=t26, text="is"), Arrow(a=t26, b=t5, text="then: is?")], title="A B B A") CirclesAndLines(circles=[Circle(quickvis="Philosophy", text="Philosophy", x=d("0.27"), y=d("0.47")), Circle(quickvis="Asking questions", text="Asking questions", x=d("0.75"), y=d("0.47"))], lines=[Arrow(a=t5, b=t30, text="is")], title="Philosophy") ]]; p { L webs = websFromCALStructures_vis(inputDiagrams); Web instructionWeb = first(webs); Web patternWeb = cloneWeb(instructionWeb); web_dropRelationsStartingWith(patternWeb, "Then:"); Web inputWeb = last(webs); L patternNodes = web_nodes(patternWeb); L inputNodes = web_nodes(inputWeb); if (l(patternNodes) != l(inputNodes)) fail("Can't match, differing number of nodes: " + l(patternNodes) + "/" + l(inputNodes)); set web_matchNodeLists_debug; LL perms = allPermutations(inputNodes); print("Have " + n(perms, "permutation")); new Best> best; for (L perm : perms) best.put(perm, web_matchNodeLists(patternNodes, perm)); print("Best permutation: " + best! + " (score: " + best.score() + ")"); }