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

44
LINES

< > BotCompany Repo | #1025726 // Wants To Connect Musing [OK]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (6892L/35K).

1  
!7
2  
3  
cmodule WTC > DynPrintLog {
4  
  transient S program = [[
5  
    theory (discord token) {
6  
      synonym token = (discord token)
7  
      synonym bot = (discord bot)
8  
      a token is something a bot needs in order to (connect to discord)
9  
    }
10  
    
11  
    a $a is something a $b needs in order to $c
12  
      & $d is a $b
13  
      & $d wants to $c
14  
      => $d needs a $a
15  
    
16  
    pattern (x wants to y)
17  
    
18  
    gazelle is a bot
19  
    gazelle wants to (connect to discord)
20  
    
21  
    expect (gazelle needs a token)
22  
  ]];
23  
  
24  
  start-thread {
25  
    PhilosophyBot1 bot = new(program);
26  
    bot.run();
27  
28  
    new Matches m;
29  
    assertEquals(ll(litmap("$x" := "gazelle needs a token")),
30  
      bot.matchFacts("expect $x"));
31  
    assertEquals("logic rules", 1, l(bot.logicRules));
32  
33  
    bot.openAllTheories();
34  
35  
    // assert that fact from theory was loaded
36  
    assertContainsIC(bot.facts, "a token is something a bot needs in order to (connect to discord)");
37  
    print("Theory opened OK.");
38  
    pnl("RULE", bot.logicRules);
39  
40  
    bot.think();
41  
    bot.checkExpectations();
42  
    print("OK!!");
43  
  }
44  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025726
Snippet name: Wants To Connect Musing [OK]
Eternal ID of this version: #1025726/30
Text MD5: 44d73296f1c3f2940e4739942e4fef0a
Transpilation MD5: e0bdc8ab87476a9cea7daaa05337bc64
Author: stefan
Category: javax / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-15 21:07:09
Source code size: 1106 bytes / 44 lines
Pitched / IR pitched: No / No
Views / Downloads: 157 / 626
Version history: 29 change(s)
Referenced in: [show references]