Download Jar. Libraryless. Click here for Pure Java version (18483L/132K).
1 | !7 |
2 | |
3 | p { |
4 | AI_SubSpace subSpace = new(1000); |
5 | ai_setSubSpace(subSpace); |
6 | //S q = "is 10 bigger than 9?"; |
7 | S q = "is 10 bigger than 11?"; |
8 | ai_postTriple(q, "should be", "answered"); |
9 | |
10 | for (int i = 0; i < 10; i++) { |
11 | int n = l(subSpace.webs); |
12 | pcall-short { |
13 | for (S term : concatLists(keys(subSpace.index), keys(subSpace.websByID))) |
14 | ai_speculate(term); |
15 | } |
16 | |
17 | L<Web> newWebs = cloneSubList(subSpace.webs, n); |
18 | ai_spec_possiblyToActually(newWebs); |
19 | |
20 | newWebs = subList(subSpace.webs, n); |
21 | print("SubSpace size: " + l(subSpace.websByID)); |
22 | for (Web web : newWebs) |
23 | print("> " + webToStringShort(web)); |
24 | |
25 | S a = ai_text("$X", "answers", q); |
26 | if (a != null) { |
27 | print("Answer found! >> " + a); |
28 | print("SubSpace size: " + l(subSpace.webs) + ", steps: " + (i+1)); |
29 | break; |
30 | } |
31 | |
32 | if (subSpace.limitReached()) break; |
33 | } |
34 | |
35 | ai_saveSubSpace(subSpace, print(programFile("subspace.gz"))); |
36 | |
37 | setRegularGCCountdown(1); // one last GC, then stop |
38 | } |
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: | 570 / 1311 |
Version history: | 14 change(s) |
Referenced in: | [show references] |