Skip to content

Instantly share code, notes, and snippets.

@koo5 koo5/bob
Created Oct 20, 2015

Embed
What would you like to do?
bob
<"--level 100 --nocolor --silence addrules --silence readcurly --silence quad::ctor "
level:100
<""
<""
silence:addrules
<""
silence:addrules readcurly
<""
silence:addrules quad::ctor readcurly
<"kb
"
mode = kb
<"Bob :a Person .
"
<"Bob :self Bob .
"
<"{ ?x :a Person. ?x :self ?x } => { ?x :is ?x } .
"
<"fin.
"
constructing old prover
(compile_kb) # of rules: 4
(compile_kb) adding rule for pred [29] http://www.w3.org/2000/10/swap/log#implies'
(compile_kb) adding rule for pred [30] :is'
(compile_kb) adding rule for pred [26] :self'
(compile_kb) adding rule for pred [23] :a'
(compile_kb) Compling pred: :a
(compile_kb) (compile_pred) # of rules: 1
(compile_kb) (compile_pred) (compile_rule) (make_locals) head::a(Bob,Person)
(compile_kb) (compile_pred) (compile_rule) (make_locals) 2terms.
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_node) termid:0x60300000d9c0 p:Bob(22)
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_node) termid:0x60300000d780 p:Person(24)
(compile_kb) (compile_pred) (compile_rule) (make_locals) locals:
Person : : 1 --> Person
Bob : : 0 --> Bob
(compile_kb) (compile_pred) (compile_rule) (make_locals) consts:
(compile_kb) (compile_pred) first, nodeid: 23(:a)
(compile_kb) Compling pred: :self
(compile_kb) (compile_pred) # of rules: 1
(compile_kb) (compile_pred) (compile_rule) (make_locals) head::self(Bob,Bob)
(compile_kb) (compile_pred) (compile_rule) (make_locals) 2terms.
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_node) termid:0x60300000d9c0 p:Bob(22)
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_node) termid:0x60300000d9c0 p:Bob(22)
(compile_kb) (compile_pred) (compile_rule) (make_locals) locals:
Bob : : 0 --> Bob
(compile_kb) (compile_pred) (compile_rule) (make_locals) consts:
(compile_kb) (compile_pred) first, nodeid: 26(:self)
(compile_kb) Compling pred: http://www.w3.org/2000/10/swap/log#implies
(compile_kb) (compile_pred) # of rules: 1
(compile_kb) (compile_pred) (compile_rule) (make_locals) head:http://www.w3.org/2000/10/swap/log#implies(_:b2,_:b3)
(compile_kb) (compile_pred) (compile_rule) (make_locals) 2terms.
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_node) termid:0x60300000cf10 p:_:b2(32)
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_node) termid:0x60300000ce50 p:_:b3(33)
(compile_kb) (compile_pred) (compile_rule) (make_locals) locals:
_:b3 : : 1 --> _:b3
_:b2 : : 0 --> _:b2
(compile_kb) (compile_pred) (compile_rule) (make_locals) consts:
(compile_kb) (compile_pred) first, nodeid: 29(http://www.w3.org/2000/10/swap/log#implies)
(compile_kb) Compling pred: :is
(compile_kb) (compile_pred) # of rules: 1
(compile_kb) (compile_pred) (compile_rule) (make_locals) head::is(?x,?x)
(compile_kb) (compile_pred) (compile_rule) (make_locals) 6terms.
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_var) termid:0x60300000d540 p:?x(-27)
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_var) termid:0x60300000d540 p:?x(-27)
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_var) termid:0x60300000d540 p:?x(-27)
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_node) termid:0x60300000d780 p:Person(24)
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_var) termid:0x60300000d540 p:?x(-27)
(compile_kb) (compile_pred) (compile_rule) (make_locals) (add_var) termid:0x60300000d540 p:?x(-27)
(compile_kb) (compile_pred) (compile_rule) (make_locals) locals:
?x : : 0 --> var()
(compile_kb) (compile_pred) (compile_rule) (make_locals) consts:
Person : : 0 --> Person
(compile_kb) (compile_pred) (compile_rule) (compile_body) perm HEAD_S HEAD_S
(compile_kb) (compile_pred) (compile_rule) (compile_body) (perm_HEAD_S_HEAD_S) making a join
(compile_kb) (compile_pred) (compile_rule) (compile_body) perm HEAD_S CONST
(compile_kb) (compile_pred) (compile_rule) (compile_body) (perm_HEAD_S_CONST) making a join
(compile_kb) (compile_pred) first, nodeid: 30(:is)
mode = commands
<"
"
<"query
"
mode = query
<"?WHO :is ?WHO .
"
<"?WHO :is ?WHOELSE .
"
<"fin.
"
compile query.
(query) (quad2term) called with: ?WHO :is ?WHO .
(query) (quad2term) quad: ?WHO :is ?WHO . term: :is(?WHO,?WHO)
(query) (quad2term) called with: ?WHO :is ?WHOELSE .
(query) (quad2term) quad: ?WHO :is ?WHOELSE . term: :is(?WHO,?WHOELSE)
(query) (make_locals) head:{}
(query) (make_locals) 4terms.
(query) (make_locals) (add_var) termid:0x6030000088c0 p:?WHO(-34)
(query) (make_locals) (add_var) termid:0x6030000088c0 p:?WHO(-34)
(query) (make_locals) (add_var) termid:0x6030000088c0 p:?WHO(-34)
(query) (make_locals) (add_var) termid:0x6030000087a0 p:?WHOELSE(-35)
(query) (make_locals) locals:
?WHOELSE : : 1 --> var()
?WHO : : 0 --> var()
(query) (make_locals) consts:
(query) (compile_body) perm LOCAL LOCAL
(query) (compile_body) (perm_LOCAL_LOCAL) making a join
(query) (compile_body) perm LOCAL LOCAL
(query) (compile_body) (perm_LOCAL_LOCAL) making a join
run.
(query) (join coro) round: 1
(query) (join coro) (rule coro) round=1
(query) (join coro) (rule coro) (unify) a: 0x6030000093a0, 0x6030000093a0
(query) (join coro) (rule coro) (unify) !Bound
(query) (join coro) (rule coro) (unify) value=0x60200000dfd0/var()
(query) (join coro) (rule coro) (unify) argv != this
(query) (join coro) (rule coro) (unify lambda 2) im in ur var unify lambda, entry = , argv=0x60200000dfd0/var()
(query) (join coro) (rule coro) (unify lambda 2) binding 0x6030000093a0/var() to 0x60200000dfd0/var()
(query) (join coro) (rule coro) After suc() --
(query) (join coro) (rule coro) (unify) a: 0x6030000093a0, 0x60200000dfd0
(query) (join coro) (rule coro) (unify) !Bound
(query) (join coro) (rule coro) (unify) value=0x60200000dfd0/var()
(query) (join coro) (rule coro) (unify) argv == this
(query) (join coro) (rule coro) (unbound_succeed lambda) 0x60200000dfd0 0x60200000dfd0entry:
(query) (join coro) (rule coro) After ouc() --
(query) (join coro) (rule coro) (find_ep) 0 ep items:
(query) (join coro) (rule coro) (join coro) round: 1
(query) (join coro) (rule coro) (join coro) (rule coro) round=1
(query) (join coro) (rule coro) (join coro) (rule coro) (unify) a: 0x6030000093a0, 0x60200000dfd0
(query) (join coro) (rule coro) (join coro) (rule coro) (unify) !Bound
(query) (join coro) (rule coro) (join coro) (rule coro) (unify) value=0x60300000cc40/Bob
(query) (join coro) (rule coro) (join coro) (rule coro) (unify) argv != this
(query) (join coro) (rule coro) (join coro) (rule coro) (unify lambda 2) im in ur var unify lambda, entry = , argv=0x60300000cc40/Bob
(query) (join coro) (rule coro) (join coro) (rule coro) (unify lambda 2) binding 0x60200000dfd0/var() to 0x60300000cc40/Bob
(query) (join coro) (rule coro) (join coro) (rule coro) After suc() --
(query) (join coro) (rule coro) (join coro) (rule coro) (unify) a: 0x60200000dd50, 0x60200000dd50
(query) (join coro) (rule coro) (join coro) (rule coro) (unify) Both args are nodes.
(query) (join coro) (rule coro) (join coro) (rule coro) After ouc() --
(query) (join coro) (rule coro) (join coro) (rule coro) After c0() --
(query) (join coro) (rule coro) (join coro) MATCH A.
(query) (join coro) (rule coro) (join coro) (join coro) round: 1
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) round=1
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) (unify) a: 0x6030000093a0, 0x60300000cc40
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) (unify) Both args are nodes.
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) After suc() --
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) (unify) a: 0x6030000093a0, 0x60300000cc40
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) (unify) Both args are nodes.
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) After ouc() --
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) After c0() --
(query) (join coro) (rule coro) (join coro) (join coro) MATCH A.
(query) (join coro) (rule coro) (join coro) (join coro) MATCH.
(query) (join coro) (rule coro) (join coro) MATCH.
(query) (join coro) (rule coro) After c0() --
(query) (join coro) MATCH A.
(query) (join coro) (join coro) round: 1
(query) (join coro) (join coro) (rule coro) round=1
(query) (join coro) (join coro) (rule coro) (unify) a: 0x6030000093a0, 0x60300000cc40
(query) (join coro) (join coro) (rule coro) (unify) !Bound
(query) (join coro) (join coro) (rule coro) (unify) value=0x60300000cc40/Bob
(query) (join coro) (join coro) (rule coro) (unify) argv != this
(query) (join coro) (join coro) (rule coro) (unify lambda 2) im in ur var unify lambda, entry = , argv=0x60300000cc40/Bob
(query) (join coro) (join coro) (rule coro) (unify lambda 2) binding 0x60200000eb50/var() to 0x60300000cc40/Bob
(query) (join coro) (join coro) (rule coro) After suc() --
(query) (join coro) (join coro) (rule coro) (unify) a: 0x6030000093b0, 0x6030000093b0
(query) (join coro) (join coro) (rule coro) (unify) !Bound
(query) (join coro) (join coro) (rule coro) (unify) value=0x60300000cc40/Bob
(query) (join coro) (join coro) (rule coro) (unify) argv != this
(query) (join coro) (join coro) (rule coro) (unify lambda 2) im in ur var unify lambda, entry = , argv=0x60300000cc40/Bob
(query) (join coro) (join coro) (rule coro) (unify lambda 2) binding 0x6030000093b0/var() to 0x60300000cc40/Bob
(query) (join coro) (join coro) (rule coro) After ouc() --
(query) (join coro) (join coro) (rule coro) (find_ep) 1 ep items:
(query) (join coro) (join coro) (rule coro) (find_ep) ---------------------
(query) (join coro) (join coro) (rule coro) (find_ep) Bob VS Bob
Bob VS Bob
(query) (join coro) (join coro) (rule coro) (find_ep) s:2
o:2
(query) (join coro) (join coro) (rule coro) (find_ep) os:2
oo:2
(query) (join coro) (join coro) (rule coro) (find_ep) (would_unify) Bob =?= Bob
(query) (join coro) (join coro) (rule coro) (find_ep) ..(query) (join coro) (join coro) (rule coro) (find_ep) (would_unify) Bob =?= Bob
(query) (join coro) (join coro) (rule coro) (find_ep) EP.
(query) (join coro) (join coro) (rule coro) DONE.
(query) (join coro) (join coro) DONE.
(query) (join coro) (rule coro) round=2
(query) (join coro) (rule coro) RE-ENTRY
(query) (join coro) (rule coro) (join coro) round: 2
(query) (join coro) (rule coro) (join coro) RE-ENTRY
(query) (join coro) (rule coro) (join coro) (join coro) round: 2
(query) (join coro) (rule coro) (join coro) (join coro) RE-ENTRY
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) round=2
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) RE-ENTRY
(query) (join coro) (rule coro) (join coro) (join coro) (rule coro) DONE.
(query) (join coro) (rule coro) (join coro) (join coro) DONE.
(query) (join coro) (rule coro) (join coro) (rule coro) round=2
(query) (join coro) (rule coro) (join coro) (rule coro) RE-ENTRY
(query) (join coro) (rule coro) (join coro) (rule coro) (unify lambda 2) im in ur var unify lambda, entry = !, argv=0x60300000cc40/Bob
(query) (join coro) (rule coro) (join coro) (rule coro) (unify lambda 2) unbinding 0x60200000dfd0/var(Bob)
(query) (join coro) (rule coro) (join coro) (rule coro) DONE.
(query) (join coro) (rule coro) (join coro) DONE.
(query) (join coro) (rule coro) (unbound_succeed lambda) 0x60200000dfd0 0x60200000dfd0entry:!
(query) (join coro) (rule coro) (unify lambda 2) im in ur var unify lambda, entry = !, argv=0x60200000dfd0/var()
(query) (join coro) (rule coro) (unify lambda 2) unbinding 0x6030000093a0/var(var())
(query) (join coro) (rule coro) DONE.
(query) (join coro) DONE.
That's all, folks, 0 results.
8 unifys, 4 steps.
mode = commands
<"
"
<"shouldbe
"
mode = shouldbe
<"Bob :is Bob .
"
<"Bob :is Bob .
"
<"fin.
"
test:FAIL
mode = commands
<"
"
<"thatsall
"
test:PASS
<"
"
deleting old prover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.