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

12
LINES

< > BotCompany Repo | #1027875 // curryLHS_BasicLogicRule - convert And on lhs to nested logic rule on rhs

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

Libraryless. Click here for Pure Java version (2567L/16K).

static BasicLogicRule curryLHS_BasicLogicRule(BasicLogicRule rule) {
  if (rule == null) null;
  while licensed {
    O lhs = rule.lhs;
    if lhs is And(O a, O b) {
      BasicLogicRule r = rule;
      rule = new BasicLogicRule(a, curryLHS(new BasicLogicRule(b, rule.rhs)));
      rule.trail = r.trail;
    } else break;
  }
  ret rule;
}

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: #1027875
Snippet name: curryLHS_BasicLogicRule - convert And on lhs to nested logic rule on rhs
Eternal ID of this version: #1027875/2
Text MD5: 52a4c94c2b151a32d135500e70fcf35c
Transpilation MD5: b29a7fe62fb445440488c8d0f9856444
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-18 11:33:42
Source code size: 350 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 165 / 255
Version history: 1 change(s)
Referenced in: [show references]