Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

16
LINES

< > BotCompany Repo | #1028841 // ai_ruleOfThree_solver_2 (if-then)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (6624L/43K).

sS ai_ruleOfThree_solver_2(S db, S input) {
  ret too_transformInput(input, too -> {
    too.addAll(lambdaMap(s -> Input(s), tlft(db)));

    too.addTransformer(func(Input<S> i) {
      BasicLogicRule<S> r = ai_parseIfThen(i!);
      if (r != null)
        too.addTransformer(func(Input<S> i2) {
          if (match(r.lhs, i2!))
            ret new TransformedInput(r.rhs);
          null;
        });
      null;
    });
  });
}

Author comment

Began life as a copy of #1028827

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: #1028841
Snippet name: ai_ruleOfThree_solver_2 (if-then)
Eternal ID of this version: #1028841/6
Text MD5: 61d93cf9d56ae477e90bd27bc88a2010
Transpilation MD5: 7fbb24e17814fe567dcf028165ae8f98
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-11 20:36:58
Source code size: 444 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 222 / 321
Version history: 5 change(s)
Referenced in: [show references]