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

19
LINES

< > BotCompany Repo | #1002829 // Test class Prolog 3 (rule parsing)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (4092L/27K/88K).

1  
!752
2  
3  
static S code = [=[
4  
  
5  
  [
6  
    if [X < is < a < guy]
7  
    then [X < has < a < gun]
8  
  ]
9  
  
10  
  [ mark < is < a < guy ]
11  
  
12  
]=];
13  
14  
p {
15  
  new Prolog p;
16  
  //p.showStuff = true;
17  
  p.addClauses(snlToTree(code));
18  
  printStructure(p.solve(snlToTree("mark < has < a < X"))); // prints X = gun!
19  
}

Author comment

Began life as a copy of #1002828

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002829
Snippet name: Test class Prolog 3 (rule parsing)
Eternal ID of this version: #1002829/1
Text MD5: 188a6988f06aac15bc2b3e28919e371d
Transpilation MD5: cdb981c98f98a7411b8d7b3e7b1b91dc
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-29 03:32:09
Source code size: 305 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 565 / 604
Referenced in: [show references]