Uses 911K of libraries. Click here for Pure Java version (11889L/66K).
1 | !7 |
2 | |
3 | cmodule IWantYouToBePrelude > DynPrintLog {
|
4 | transient Set<S> facts = tlft_ciSet([[ |
5 | Computery is usery's assistant |
6 | It is impossible that {Computery is usery's mother}
|
7 | ]]); |
8 | |
9 | transient MultiMap<S, WordTokRule> rulesForSpace = litmultimap( |
10 | MultiSpaceReasoning1.userSpace, ll(wordTokReplacerRule( |
11 | "I want you to be my assistant", "assistant", "I want that {you are my assistant}")),
|
12 | |
13 | MultiSpaceReasoning1.objectiveSpace, ll(new WordTokRule("Usery wants that X", "X") {
|
14 | // { debug = true; }
|
15 | run {
|
16 | S x_simplified = simpleSpaces_nTok(getVar("X"));
|
17 | if (contains(facts, x_simplified)) |
18 | emit("But " + x_simplified + " already");
|
19 | else if (contains(facts, "It is impossible that " + curly(x_simplified))) |
20 | emit("No way brother");
|
21 | else if (debug) print("Can't decide on: " + x_simplified);
|
22 | } |
23 | }) |
24 | ); |
25 | |
26 | start-thread-printDone {
|
27 | new MultiSpaceReasoning1 mr; |
28 | mr.addRules(rulesForSpace); |
29 | |
30 | for (S input : ll("I want you to be my mother", "I want you to be my assistant")) {
|
31 | print_nlBefore(input); |
32 | Collection<ES> outputs = mr.reason_inputToAnswer(ll(ext(input))); |
33 | pnlIndent("Bot space > ", outputs);
|
34 | } |
35 | } |
36 | } |
Began life as a copy of #1023210
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1023211 |
| Snippet name: | I want you to be... [prelude spike v4 shortened - triggers compiler bug in JDK 8?] |
| Eternal ID of this version: | #1023211/4 |
| Text MD5: | f4011c79317d296e0cac91b9aa11701e |
| Transpilation MD5: | 9d3972836959ff05717c1f2b1621b842 |
| 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-05-16 20:25:14 |
| Source code size: | 1273 bytes / 36 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 565 / 832 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |