!7 sS theRiddle = [[ What did Magnus Carlsen eat for breakfast? ]]; sS theFacts = [[ Magnus Carlsen lives in Norway. In Norway, they eat fish. (Q: What did X eat for breakfast?) and (X lives in Y.) and (In Y, they eat Z.) => (A: Probably Z!) ]]; sS concepts = [[ ["zlydvmmyckgcyrak", "Magnus Carlsen"], ["verqumbshvchuquw", "Norway"], ["wvqzrhdaqnygqgll", "Fish"], ["bzvabitchqhqkldm", "In X, they eat Y."], ["pizxszvxocdluica", "What did X eat for Y?"], ["fhsukilpoasgkvcs", "X lives in Y."], ["oceicdfeiyftxuwi", "Probably X!"], ["eijdjqhyzheusetj", "(X) and (Y) and (Z) => (AA)"], //["mcoswmplpqlieruo", "(X)"], //["mwpbetwhkuuuupws", "X and Y and Z => AA"], ["vouwrrhtmajsgaby", "Q: X"], ["nywfcwkkcknzhmdy", "A: X"], ]]; svoid createWeb(Web web, Lisp riddle) {} svoid calc(Web web) { for (LispStatement ls : lispStatementsByHead("eijdjqhyzheusetj")) { Lisp rule = ls.term; L conditions = dropLast(rule.args); Lisp out = last(rule.args); for (Lisp cond : conditions) { for (Lisp fact : facts) { Map matches = lispMatch(cond, fact, vars); if (matches != null) print("Match: " + in + " = " + lbl); } } /*bla = lispReplaceVars(rule.get(1), matches); web.node(bla);*/ } } sS getAnswer(Web web) { ret ""; } p { setConsoleInput(trim(firstLine(theRiddle))); pConsoleThoughtMachine(); } !include #1007815 // Console Thought Machine