!7 sS input = "plants grow"; p { ai_alternativeSmartBot(); WordSequence pat = WordSequence( SomethingWhichIs("a noun"), SomethingWhichIs("a verb")); printStruct(pat); WordSequence real = WordSequence("plants", "grow"); printStruct(real); new IdentityHashMap map; if (matchWordSequence(pat, real, map)) printStruct(map); else print("no match"); } static bool matchWordSequence(WordSequence pat, WordSequence real, Map map) { int n = l(pat.l); if (n != l(real.l)) false; for i to n: if (!matchElement(pat.l.get(i), real.l.get(i), map)) false; true; } static bool matchElement(O pat, O real, Map map) { if (eq(pat, real)) true; if (pat << SomethingWhichIs && real instanceof S) { if (!ai_is(quote((S) real), pat/SomethingWhichIs.type)) false; print("Assigning " + pat + " => " + real); ret strictPut(map, pat, real); } false; }