!752 static S inputText = [[ a point contains an "x coordinate" a point contains an "y coordinate" p is a point A is a B a B contains a C -> A contains a C ]]; static new L statements; static new L rules; p { inputText = anToA(inputText); L log = toLinesTrim2(inputText); L emptyLines = concatLists(ll(-1), indexesOf(log, ""), ll(l(log))); for (int ii = 0; ii+1 < l(emptyLines); ii++) { int i = emptyLines.get(ii), j = emptyLines.get(ii+1); L l = subList(log, i+1, j); continue if empty(l); L arrows = indexesOfLinesStartingWith(l, "->"); if (empty(arrows)) statements.addAll(l); } rules = parseRules(inputText); print("Rules:"); pslIndent(rules); print("Statements:"); printIndented(nlPrettyPrint(statements)); L newStatements = inferStuff(); print("New statements:"); printIndented(nlPrettyPrint(newStatements)); } static L inferStuff() { genLog_set(new L(statements)); for (Rule rule : rules) { L matches = asList(gSatAnd(rule.in)); for (S out : rule.out) for (SS match : matches) gAdd(replaceVars_autoQuote(out, match)); } ret new L(subList(gLog(), l(statements))); }