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

72
LINES

< > BotCompany Repo | #3000227 // Answer for stefanreich (>> log)

New Tinybrain snippet

1  
2  
clause(Lisp): "[]"(if, "[]"($x, and, not, "()"($y)), then, "[]"($x, xor, $y), if, "[]"(not, "()"($x), and, $y), then, "[]"($x, xor, $y)) => [l("if *", l("[]", "$x", "and", "not", l("()", "$y"))), l("then *", l("[]", "$x", "xor", "$y")), l("if *", l("[]", "not", l("()", "$x"), "and", "$y")), l("then *", l("[]", "$x", "xor", "$y"))]
3  
clause(Lisp): "[]"("[]"(not, "()"(true)), should, be, false) => null
4  
clause(Lisp): "[]"(mrshutco, is, a, human) => [l("mrshutco *", "is"), l("a *", "human")]
5  
clause(Lisp): "[]"("[]"(not, "()"(false)), should, be, true) => null
6  
clause(Lisp): "[]"(if, $x, and, "!", and, false, then, "[]"(not, "()"($x))) => [l("if *", "$x"), l("and *", "!"), l("and *", "false"), l("then *", l("[]", "not", l("()", "$x")))]
7  
clause(Lisp): "[]"(not, "()"($x)) => [l("not *", l("()", "$x"))]
8  
clause(Lisp): "[]"(if, $a, and, $b, then, "[]"($a, and, $b)) => [l("if *", "$a"), l("and *", "$b"), l("then *", l("[]", "$a", "and", "$b"))]
9  
clause(Lisp): "[]"(if, "[]"($c, "=", tocons, "()"($list)), and, "[]"($e, "=", iter, $c), then, "[]"($e, is, in, list, $list)) => [l("if *", l("[]", "$c", "=", "tocons", l("()", "$list"))), l("and *", l("[]", "$e", "=", "iter", "$c")), l("then *", l("[]", "$e", "is", "in", "list", "$list"))]
10  
clause(Lisp): "[]"(lasagna, is, tasty) => null
11  
clause(Lisp): "[]"(if, "[]"($c, "=", tocons, "()"($list)), and, "[]"($e, "=", iter, $c), then, "[]"($e, in, $c)) => [l("if *", l("[]", "$c", "=", "tocons", l("()", "$list"))), l("and *", l("[]", "$e", "=", "iter", "$c")), l("then *", l("[]", "$e", "in", "$c"))]
12  
clause(Lisp): "[]"(if, $a, then, "[]"($a, or, $b)) => [l("if *", "$a"), l("then *", l("[]", "$a", "or", "$b"))]
13  
clause(Lisp): "[]"(if, $b, then, "[]"($a, or, $b)) => [l("if *", "$b"), l("then *", l("[]", "$a", "or", "$b"))]
14  
clause(Lisp): "[]"($head, "=", iter, "[]"(cons, $head, $tail)) => null
15  
clause(Lisp): "[]"(if, "[]"($x, "=", iter, $tail), then, "[]"($x, "=", iter, "[]"(cons, $head, $tail))) => [l("if *", l("[]", "$x", "=", "iter", "$tail")), l("then *", l("[]", "$x", "=", "iter", l("[]", "cons", "$head", "$tail")))]
16  
clause(Lisp): "[]"(if, $x, then, "[]"(verify, "[]"($x, should, be, true))) => [l("if *", "$x"), l("then *", l("[]", "verify", l("[]", "$x", "should", "be", "true")))]
17  
clause(Lisp): "[]"(if, "[]"($a, "=", intmul, "()"("[]"($b, ",", $c))), then, "[]"($a, "=", smartmul, "()"("[]"($b, ",", $c)))) => [l("if *", l("[]", "$a", "=", "intmul", l("()", l("[]", "$b", ",", "$c")))), l("then *", l("[]", "$a", "=", "smartmul", l("()", l("[]", "$b", ",", "$c"))))]
18  
clause(Lisp): "[]"(if, "[]"($b, "=", intdiv, "()"("[]"($a, ",", $c))), then, "[]"($a, "=", smartmul, "()"("[]"($b, ",", $c)))) => [l("if *", l("[]", "$b", "=", "intdiv", l("()", l("[]", "$a", ",", "$c")))), l("then *", l("[]", "$a", "=", "smartmul", l("()", l("[]", "$b", ",", "$c"))))]
19  
clause(Lisp): "[]"(if, "[]"($c, "=", intdiv, "()"("[]"($a, ",", $b))), then, "[]"($a, "=", smartmul, "()"("[]"($b, ",", $c)))) => [l("if *", l("[]", "$c", "=", "intdiv", l("()", l("[]", "$a", ",", "$b")))), l("then *", l("[]", "$a", "=", "smartmul", l("()", l("[]", "$b", ",", "$c"))))]
20  
clause(Lisp): "[]"(if, "[]"(not, "()"($x)), then, "[]"(verify, "[]"($x, should, be, false))) => [l("if *", l("[]", "not", l("()", "$x"))), l("then *", l("[]", "verify", l("[]", "$x", "should", "be", "false")))]
21  
clause(Lisp): "[]"(if, $x, then, "()"($x)) => [l("if *", "$x"), l("then *", l("()", "$x"))]
22  
clause(Lisp): "[]"("\"and\"", is, a, fill, word) => null
23  
clause(Lisp): "[]"("\",\"", is, a, fill, word) => null
24  
clause(Lisp): "[]"(feet, is, the, plural, of, foot) => [l("feet *", "is"), l("the *", "plural"), l("of *", "foot")]
25  
clause(Lisp): "[]"(bits, is, the, plural, of, bit) => [l("bits *", "is"), l("the *", "plural"), l("of *", "bit")]
26  
Starting on goal: Prolog$Goal(car=l("[]", "not", l("()", l("[]", "true", "or", "true"))))
27  
Goal arity 2: "[]"(not, "()"("[]"(true, or, true)))
28  
  Goal: "[]"(not, "()"("[]"(true, or, true))). Trying clause: "[]"(not, "()"(_1)) :- _1; "!"; false
29  
 Clause unifies to: "[]"(not, "()"("[]"(true, or, true))) :- "[]"(true, or, true); "!"; false
30  
gdash: "[]"(true, or, true); "!"; false
31  
Goal arity 3: "[]"(true, or, true)
32  
New goal: "[]"(true, or, true); "!"; false
33  
   Goal: "[]"(true, or, true); "!"; false. Trying clause: "[]"(_2, xor, _3) :- "[]"(_2, and, not, "()"(_3)); "[]"(_2, xor, _3); "[]"(not, "()"(_2), and, _3)
34  
 No match for clause.
35  
   Goal: "[]"(true, or, true); "!"; false. Trying clause: "[]"(_4, and, _5) :- _4; _5
36  
 No match for clause.
37  
   Goal: "[]"(true, or, true); "!"; false. Trying clause: "[]"(lasagna, is, tasty)
38  
 No match for clause.
39  
   Goal: "[]"(true, or, true); "!"; false. Trying clause: "[]"(_6, in, _7) :- "[]"(_7, "=", tocons, "()"(_8)); "[]"(_6, "=", iter, _7)
40  
 No match for clause.
41  
   Goal: "[]"(true, or, true); "!"; false. Trying clause: "[]"(_9, or, _10) :- _9
42  
  Clause unifies to: "[]"(true, or, true) :- true
43  
 gdash: true; "!"; false
44  
Goal arity 0: true
45  
 New goal: true; "!"; false
46  
    Goal: true; "!"; false. Trying clause: true
47  
   Clause unifies to: true
48  
  gdash: "!"; false
49  
Goal arity 0: "!"
50  
  New goal: "!"; false
51  
cut -1. Prolog$Goal(car=l("!"), cdr=Prolog$Goal(car=l("false")))
52  
Goal arity 0: false
53  
      Goal: false. Trying clause: true
54  
    No match for clause.
55  
      Goal: false. Trying clause: nativeTest2 :- native
56  
    No match for clause.
57  
      Goal: false. Trying clause: nativeFail :- native
58  
    No match for clause.
59  
cut 0. Prolog$Goal(car=l("!"), cdr=Prolog$Goal(car=l("false")))
60  
back to cut point.
61  
cut: dropping Prolog$Entry(goal=Prolog$Goal(car=l("!"), cdr=Prolog$Goal(car=l("false"))), program=[Prolog$Clause(head=l("true")), Prolog$Clause(head=l("nativeTest2"), nat=NativeTest2), Prolog$Clause(head=l("nativeFail"), nat=NativeFail)], programIdx=1, trail=Prolog$Trail(tcar=Prolog$Var(id=10L, instance=l("true")), tcdr=Prolog$Trail(tcar=Prolog$Var(id=9L, instance=l("true")), tcdr=Prolog$Trail(tcar=Prolog$Var(id=1L, instance=l("[]", "true", "or", "true"))))), trailSet=true, cutPoint=false)
62  
cut: dropping 0 Prolog$Entry(goal=Prolog$Goal(car=Prolog$Var(id=9L, instance=l("true")), cdr=Prolog$Goal(car=l("!"), cdr=Prolog$Goal(car=l("false")))), program=[Prolog$Clause(head=l("true")), Prolog$Clause(head=l("nativeTest2"), nat=NativeTest2), Prolog$Clause(head=l("nativeFail"), nat=NativeFail)], programIdx=1, trail=Prolog$Trail(tcar=Prolog$Var(id=10L, instance=l("true")), tcdr=Prolog$Trail(tcar=r3, tcdr=Prolog$Trail(tcar=Prolog$Var(id=1L, instance=l("[]", "true", "or", "true"))))), trailSet=true, cutPoint=true)
63  
cut: dropping 1 Prolog$Entry(goal=Prolog$Goal(car=Prolog$Var(id=1L, instance=l("[]", "true", "or", "true")), cdr=Prolog$Goal(car=l("!"), cdr=Prolog$Goal(car=l("false")))), program=[Prolog$Clause(head=l("[]", Prolog$Var(id=0L, instance=r12), "xor", Prolog$Var(id=0L, instance=r13)), body=Prolog$Goal(car=l("[]", r12, "and", "not", l("()", r13)), cdr=Prolog$Goal(car=l("[]", r12, "xor", r13), cdr=Prolog$Goal(car=l("[]", "not", l("()", r12), "and", r13))))), Prolog$Clause(head=l("[]", Prolog$Var(id=0L, instance=r24), "and", Prolog$Var(id=0L, instance=r25)), body=Prolog$Goal(car=r24, cdr=Prolog$Goal(car=r25))), Prolog$Clause(head=l("[]", "lasagna", "is", "tasty")), Prolog$Clause(head=l("[]", Prolog$Var(id=0L, instance=r32), "in", Prolog$Var(id=0L, instance=r33)), body=Prolog$Goal(car=l("[]", r33, "=", "tocons", l("()", Prolog$Var(id=0L, instance=r37))), cdr=Prolog$Goal(car=l("[]", r32, "=", "iter", r33)))), Prolog$Clause(head=l("[]", Prolog$Var(id=0L, instance=r42), "or", Prolog$Var(id=0L, instance=r43)), body=Prolog$Goal(car=r42)), Prolog$Clause(head=l("[]", Prolog$Var(id=0L, instance=r47), "or", Prolog$Var(id=0L, instance=r48)), body=Prolog$Goal(car=r48))], programIdx=5, trail=Prolog$Trail(tcar=r3), trailSet=true, cutPoint=true)
64  
  Goal: "[]"(not, "()"("[]"(true, or, true))). Trying clause: "[]"(not, "()"(_11))
65  
 Clause unifies to: "[]"(not, "()"("[]"(true, or, true)))
66  
gdash: null
67  
SUCCESS!
68  
  Goal: "[]"(not, "()"("[]"(true, or, true))). Trying clause: "[]"(verify, "[]"(_12, should, be, true)) :- _12
69  
No match for clause.
70  
  Goal: "[]"(not, "()"("[]"(true, or, true))). Trying clause: "[]"(verify, "[]"(_13, should, be, false)) :- "[]"(not, "()"(_13))
71  
No match for clause.
72  
Done with goal!

download  show line numbers   

Snippet is not live.

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

No comments. add comment

Snippet ID: #3000227
Snippet name: Answer for stefanreich (>> log)
Eternal ID of this version: #3000227/1
Text MD5: d92c328a9e7734a59bea25b38ff61ba6
Author: someone
Category:
Type: New Tinybrain snippet
Gummipassword: eleutheria-for-user
Uploaded from IP: 69.10.46.185
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-03-06 02:22:16
Source code size: 8202 bytes / 72 lines
Pitched / IR pitched: No / No
Views / Downloads: 476 / 107
Referenced in: [show references]