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

36
LINES

< > BotCompany Repo | #1027187 // test_philosophyBot1_trails

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

Libraryless. Click here for Pure Java version (9065L/58K).

1  
svoid test_philosophyBot1_trails() {
2  
  test_philosophyBot1_trailsForLogicRules();
3  
  test_philosophyBot1_trailsForFacts();
4  
}
5  
6  
svoid test_philosophyBot1_trailsForFacts() {
7  
  PhilosophyBot1 bot = new([[
8  
    a => b
9  
    
10  
    a & b => c
11  
    
12  
    a
13  
    
14  
    expect c
15  
  ]]);
16  
  bot.printStackTraces = true;
17  
  bot.enableTrails();
18  
  bot.runAndCheckExpectations();
19  
  for (WithTrail<S> fact : bot.deducedFactsWithTrails())
20  
    assertNotNull("trail for " + fact, fact.trail);
21  
}
22  
23  
svoid test_philosophyBot1_trailsForLogicRules() {
24  
  PhilosophyBot1 bot = new([[
25  
    a & b => c
26  
    
27  
    a
28  
  ]]);
29  
  bot.printStackTraces = true;
30  
  bot.enableTrails();
31  
  bot.think();
32  
  for (PhilosophyBot1.LogicRule rule : bot.logicRules()) {
33  
    print(rule + ", trail: " + rule.trail);
34  
    assertNotNull("trail" , rule.trail);
35  
  }
36  
}

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: #1027187
Snippet name: test_philosophyBot1_trails
Eternal ID of this version: #1027187/13
Text MD5: 8f9f739302e5a06fdaa2652295a7dc66
Transpilation MD5: 2d204b8e764a6aff8fd7d3c2ded7e67b
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-24 17:46:15
Source code size: 830 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 145 / 277
Version history: 12 change(s)
Referenced in: [show references]