Uses 911K of libraries. Click here for Pure Java version (4099L/21K).
cmodule NewEngineSpike > DynPrintLog { transient new DeepZipTools tools; transient new L<BasicLogicRule> 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); } }
Began life as a copy of #1027880
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027908 |
Snippet name: | New Engine Spike [executing for-where and function calls, OK] |
Eternal ID of this version: | #1027908/10 |
Text MD5: | 70f7a58bc833b0156df1db7738044a7d |
Transpilation MD5: | 160c5b2a7a6d6fa41ca097d377c40508 |
Author: | stefan |
Category: | javax / new gazelle |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-04-16 18:11:43 |
Source code size: | 954 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 231 / 761 |
Version history: | 9 change(s) |
Referenced in: | [show references] |