!7 !include #1007960 // englishToConceptLanguage_xyz sS concepts = [[ ["jcnbmtmfzktxhzyf", "X + Y"], ["bwqhmnorjpyomdbv", "X * Y", "multiplication"], ["mcoswmplpqlieruo", "(X)"], ["olphazqzxxnvtjcx", "X evaluates through standard function Y."], ["wwaprwlmqzqeaikp", "A leaf satisfying standard function X evaluates through standard function Y."], ["hkihrqgdlkdayxzn", "X is just bracketing."], ]]; sS statements = [[ olphazqzxxnvtjcx jcnbmtmfzktxhzyf "plus" olphazqzxxnvtjcx bwqhmnorjpyomdbv "multiply" hkihrqgdlkdayxzn mcoswmplpqlieruo wwaprwlmqzqeaikp "isInteger" "bigint" ]]; p { useConcepts(concepts); useFacts_cl(statements); set englishToConceptLanguage_xyz_debug; printIndent(eval(parse(print("1")))); assertEqualsVerbose(bigint(5), eval(parse(print("(5)")))); assertEqualsVerbose(bigint(6), eval(parse(print("2 * (3)")))); assertEqualsVerbose(bigint(6), eval(parse(print("1 * (2 + 3)")))); assertEqualsVerbose(bigint(9), eval(parse(print("(1 + 2) * 3")))); assertEqualsVerbose(bigint(21), eval(parse(print("(1 + 2) * (3 + 4)")))); print("OK!!"); } static Lisp parse(S s) { ret englishToLispWith(s, ll("mcoswmplpqlieruo", "jcnbmtmfzktxhzyf", "bwqhmnorjpyomdbv")); } static O eval(Lisp l) { ret generalLispEval(l); }