!752 sS data = [=[ [[house] is a noun_clause] [if [[X] is a noun_clause] then [[my X] is a noun_clause]] [[my house] is a noun_clause] ]=]; p { // make Prolog interpreter new Prolog p; p.upperCaseVariables = true; //p.showStuff = true; p.addTheory(dropLastLine(rtrim(data)), programID()); Lisp pivot = nlParse(lastLine(rtrim(data))); // derive third rule from first two L l = p.rewrite(100); print("Found " + nl(l, "statement") + ":"); //printIndent(snlAllToText(l)); printIndent(nlUnparseLines(l)); print(); print("Pivot statement: " + nlUnparse(pivot)); int idx = l.indexOf(pivot); print("Pivot statement found? " + (idx >= 0 ? "Yes, at index " + (idx+1) + "/" + l(l) + "." : "No.")); }