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

38
LINES

< > BotCompany Repo | #1012064 // Speculate in SubSpace [OK!]

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

Download Jar. Libraryless. Click here for Pure Java version (18483L/132K).

!7

p {
  AI_SubSpace subSpace = new(1000);
  ai_setSubSpace(subSpace);
  //S q = "is 10 bigger than 9?";
  S q = "is 10 bigger than 11?";
  ai_postTriple(q, "should be", "answered");
  
  for (int i = 0; i < 10; i++) {
    int n = l(subSpace.webs);
    pcall-short {
      for (S term : concatLists(keys(subSpace.index), keys(subSpace.websByID)))
        ai_speculate(term);
    }
    
    L<Web> newWebs = cloneSubList(subSpace.webs, n);
    ai_spec_possiblyToActually(newWebs);
    
    newWebs = subList(subSpace.webs, n);
    print("SubSpace size: " + l(subSpace.websByID));
    for (Web web : newWebs)
      print("> " + webToStringShort(web));
      
    S a = ai_text("$X", "answers", q);
    if (a != null) {
      print("Answer found! >> " + a);
      print("SubSpace size: " + l(subSpace.webs) + ", steps: " + (i+1));
      break;
    }
      
    if (subSpace.limitReached()) break;
  }
  
  ai_saveSubSpace(subSpace, print(programFile("subspace.gz")));
  
  setRegularGCCountdown(1); // one last GC, then stop
}

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: #1012064
Snippet name: Speculate in SubSpace [OK!]
Eternal ID of this version: #1012064/15
Text MD5: be72353c6a48dca1cf82063da60fa749
Transpilation MD5: f00ca07432dca03156cc16d37dcb0436
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-17 10:37:02
Source code size: 1061 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 569 / 1306
Version history: 14 change(s)
Referenced in: [show references]