cmodule NewEngineSpike > DynPrintLog { transient new DeepZipTools tools; transient new L rules; transient SS functions = litmap_keysLikeValues(f ewic_notSame); start-thread { S ruleDef = [[hasWord($x) & ewic_notSame($x, "zimmer") => $x ist ein Zimmer]]; // rewritten to: for $x where hasWord($x): ewic_notSame($x, "zimmer") => $x ist ein Zimmer BasicLogicRule rule = ai_newEngine_parseRule(ruleDef, tools); ForWhere fw = cast ai_lhsToForWhere(rule, tools); print(fw); stepAll(new AI_ExecuteSimpleForWhere(tools, r -> rules.add(print(r)), f -> eq(f, "hasWord") ? ll("bla", "Wohnzimmer") : null, fw)); new LS facts; for (BasicLogicRule r : rules) if (isTrue(ai_evalFunctionCallLHS(r, mapToIF1(functions)))) facts.add(ai_fragmentsToStatement(r.rhs)); assertEqualsVerbose(ll("Wohnzimmer ist ein Zimmer"), facts); } }