Download Jar. Libraryless. Click here for Pure Java version (8662L/63K).
1 | !7 |
2 | |
3 | p-exp { |
4 | L<IfThen> rules = map nlLogic_parseRule(splitAtEmptyLines(mL_raw("Fact-to-fact rules"))); |
5 | final new NLLogicChecker_v3 c; |
6 | c.matcher = new NLStringMatcher_dollarVars_underscores; |
7 | c.facts = mL("Random facts"); |
8 | |
9 | final new NLLogicChecker_v2.Matching m; |
10 | final new LinkedHashSet<S> outFacts; |
11 | for (final IfThen rule : rules) |
12 | c.iterate(rule.in, m, r { |
13 | print("Got matches: " + sfu(m.matches)); |
14 | Exp out = c.apply(rule.out, m); |
15 | if (out cast Func) |
16 | if (eq(out.name, "fact")) |
17 | outFacts.add(nlLogic_text(out.arg)); |
18 | }); |
19 | |
20 | pnl(outFacts); |
21 | appendToMechList("Derived facts", outFacts); |
22 | } |
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1017727 |
Snippet name: | Derive Facts [OK!] |
Eternal ID of this version: | #1017727/11 |
Text MD5: | c029557c4cbfc73be4c00494432f4900 |
Transpilation MD5: | c2a2837d9f87029b42777e01f87a5a8f |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-08-04 22:47:38 |
Source code size: | 665 bytes / 22 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 416 / 1035 |
Version history: | 10 change(s) |
Referenced in: | [show references] |