!7 p-exp { PTElement input = ai_parseToCulledTree("What is this thing you have"); PTElement pat = ai_parseToCulledTree("What is X"); matchTrees(input, pat); } svoid matchTrees(PTElement pat, PTElement input) { print("Matching: " + pat + " / " + input); if (pat == null || input == null) ret; if (pat instanceof ChooseCategory && input instanceof ChooseCategory) { HaveCategory l = cast first(pat.children); HaveCategory r = cast first(input.children); if (l != null && r != null && eq(l.category, r.category)) { print("Using category: " + l.category); matchTrees(l, r); } ret; } print("Non-matching classes: " + className(pat) + " vs " + className(input)); }