Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Started at Sat Aug 12 08:35:33 2017
- 32.854 seconds cpu time for 168,603,654 inferences
- 727,948 atoms, 15,635 functors, 16,146 predicates, 290 modules, 7,337,370 VM-codes
- %
- Limit Allocated In use
- Local stack: 268,435,456 520,192 7,000 Bytes
- Global stack: 268,435,456 201,322,480 121,586,632 Bytes
- Trail stack: 268,435,456 50,329,592 784 Bytes
- %
- 3 garbage collections gained 162,880,288 bytes in 0.017 seconds.
- 17 atom garbage collections gained 113,706 atoms in 0.288 seconds.
- 1,809 clause garbage collections gained 124,592 clauses in 0.159 seconds.
- Stack shifts: 4 local, 17 global, 14 trail in 0.005 seconds
- */
- % ==================================================================================================
- :- test_boxlog(all([[Human, tHuman]],
- exists([[Heart, tHeart]], hasOrgan(Human, Heart)))).
- % /home/prologmud_server/lib/swipl/pack/logicmoo_base/t/examples/fol/sanity_exists_01.pl:14
- :- test_boxlog(all([[Human_VAR, tHuman]],
- exists([[Heart_VAR, tHeart]], hasOrgan(Human_VAR, Heart_VAR)))).
- kif :-
- all([[Human, tHuman]], exists([[Heart, tHeart]], hasOrgan(Human, Heart))).
- qualify_nesc :-
- all([[Human, tHuman]],
- exists([[Heart, tHeart]], nesc(hasOrgan(Human, Heart)))).
- debugm(t123, sc_success(t123, t123:nnf(KB, all([Human, tHuman], exists([[Heart, tHeart]], nesc(b_d(KB, nesc, poss), hasOrgan(Human, Heart)))), v(&(v(&(nesc(b_d(KB, nesc, poss), nesc(b_d(KB, nesc, poss), hasOrgan(Human, Heart))), nesc(b_d(KB, nesc, poss), isa(Heart, tHeart))), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), &(nesc(b_d(KB, nesc, poss), hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))), isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)))), ~isa(Human, tHuman))))).
- nnf :-
- v(&(v(&(nesc(nesc(hasOrgan(Human, Heart))), nesc(isa(Heart, tHeart))), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), &(nesc(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))), isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)))), ~isa(Human, tHuman)).
- unq :-
- v(&(v(&(nesc(hasOrgan(Human, Heart)), nesc(isa(Heart, tHeart))), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), &(nesc(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))), isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)))), ~isa(Human, tHuman)).
- th_nnf_in :-
- ( ( tru(hasOrgan(Human, Heart)),
- tru(isa(Heart, tHeart))
- ; tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ),
- ( neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ; tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))),
- tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart))
- )
- ; neg(isa(Human, tHuman))
- ).
- th_nnf_out :-
- ~ (((n(tru(hasOrgan(Human, Heart)));n(tru(isa(Heart, tHeart)))), n(tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))));n(neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), (n(tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))));n(tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart))))), n(neg(isa(Human, tHuman)))).
- unused(proven_tru(isa(Heart, tHeart))) :-
- unused((\+needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), proven_tru(isa(Human, tHuman)))).
- unused(proven_tru(hasOrgan(Human, Heart))) :-
- unused((\+needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), proven_tru(isa(Human, tHuman)))).
- unused(proven_neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))) :-
- proven_not_neg(isa(Human, tHuman)),
- once(( \+ isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)
- ; \+ hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))
- )).
- proven_tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_tru(isa(Human, tHuman)).
- proven_tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_tru(isa(Human, tHuman)).
- proven_tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- proven_tru(isa(Human, tHuman)),
- once(( \+ isa(Heart, tHeart)
- ; \+ hasOrgan(Human, Heart)
- )).
- proven_neg(isa(Human, tHuman)) :-
- ( once(( proven_neg(isa(Heart, tHeart))
- ; proven_neg(hasOrgan(Human, Heart))
- ))
- ; needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- ( proven_neg(hasOrgan(Human,
- skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ; proven_neg(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart))
- )
- ).
- % ==================================================================================================
- :- test_boxlog(=>(isa(Human, tHuman), all(Human, exists([[Heart, tHeart]], hasOrgan(Human, Heart))))).
- % /home/prologmud_server/lib/swipl/pack/logicmoo_base/t/examples/fol/sanity_exists_01.pl:17
- :- test_boxlog(=>(isa(Human_VAR, tHuman), all(Human_VAR, exists([[Heart_VAR, tHeart]], hasOrgan(Human_VAR, Heart_VAR))))).
- kif :-
- =>(tHuman(Human), all(Human, exists([[Heart, tHeart]], hasOrgan(Human, Heart)))).
- qualify_nesc :-
- nesc(=>(tHuman(Human), all(Human, exists([[Heart, tHeart]], hasOrgan(Human, Heart))))).
- debugm(t123, sc_success(t123, t123:nnf(KB, nesc(b_d(KB, nesc, poss), =>(tHuman(Human), all(Human, exists([[Heart, tHeart]], hasOrgan(Human, Heart))))), &(&(nesc(b_d(KB, nesc, poss), v(~tHuman(Human), v(nesc(b_d(KB, nesc, poss), hasOrgan(Human, Heart)), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))))), nesc(b_d(KB, nesc, poss), v(~tHuman(Human), v(nesc(b_d(KB, nesc, poss), isa(Heart, tHeart)), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))))), &(nesc(b_d(KB, nesc, poss), v(~tHuman(Human), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))))), nesc(b_d(KB, nesc, poss), v(~tHuman(Human), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart))))))))).
- nnf :-
- &(&(nesc(v(~tHuman(Human), v(nesc(hasOrgan(Human, Heart)), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))))), nesc(v(~tHuman(Human), v(nesc(isa(Heart, tHeart)), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))))), &(nesc(v(~tHuman(Human), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))))), nesc(v(~tHuman(Human), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)))))).
- th_nnf_in :-
- ( ( neg(tHuman(Human))
- ; tru(hasOrgan(Human, Heart))
- ; tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ),
- ( neg(tHuman(Human))
- ; tru(isa(Heart, tHeart))
- ; tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- )
- ),
- ( neg(tHuman(Human))
- ; neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ; tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ),
- ( neg(tHuman(Human))
- ; neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ; tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart))
- ).
- th_nnf_out :-
- ~ ((n(neg(tHuman(Human))), n(tru(hasOrgan(Human, Heart))), n(tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))));n(neg(tHuman(Human))), n(tru(isa(Heart, tHeart))), n(tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))));n(neg(tHuman(Human))), n(neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), n(tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))));n(neg(tHuman(Human))), n(neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), n(tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)))).
- unused(proven_tru(isa(Heart, tHeart))) :-
- unused((\+needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), proven_tru(tHuman(Human)))).
- unused(proven_tru(hasOrgan(Human, Heart))) :-
- unused((\+needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), proven_tru(tHuman(Human)))).
- unused(proven_neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))) :-
- \+ isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart),
- proven_not_neg(tHuman(Human)).
- unused(proven_neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))) :-
- \+ hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_not_neg(tHuman(Human)).
- proven_tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_tru(tHuman(Human)).
- proven_tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_tru(tHuman(Human)).
- proven_tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- \+ isa(Heart, tHeart),
- proven_tru(tHuman(Human)).
- proven_tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- \+ hasOrgan(Human, Heart),
- proven_tru(tHuman(Human)).
- proven_neg(tHuman(Human)) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- \+ isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart).
- proven_neg(tHuman(Human)) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- \+ hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)).
- proven_neg(tHuman(Human)) :-
- proven_neg(isa(Heart, tHeart)).
- proven_neg(tHuman(Human)) :-
- proven_neg(hasOrgan(Human, Heart)).
- % ==================================================================================================
- :- test_boxlog(=>(isa(Human, tHuman), all(Human, =>(isa(Heart, tHeart), exists(Heart, hasOrgan(Human, Heart)))))).
- % /home/prologmud_server/lib/swipl/pack/logicmoo_base/t/examples/fol/sanity_exists_01.pl:20
- :- test_boxlog(=>(isa(Human_VAR, tHuman), all(Human_VAR, =>(isa(Heart_VAR, tHeart), exists(Heart_VAR, hasOrgan(Human_VAR, Heart_VAR)))))).
- kif :-
- =>(tHuman(Human), all(Human, =>(tHeart(Heart), exists(Heart, hasOrgan(Human, Heart))))).
- qualify_nesc :-
- nesc(=>(tHuman(Human), all(Human, =>(tHeart(Heart), exists(Heart, hasOrgan(Human, Heart)))))).
- debugm(t123, sc_success(t123, t123:nnf(KB, nesc(b_d(KB, nesc, poss), =>(tHuman(Human), all(Human, =>(tHeart(Heart), exists(Heart, hasOrgan(Human, Heart)))))), &(nesc(b_d(KB, nesc, poss), v(~tHuman(Human), v(~tHeart(Heart), v(nesc(b_d(KB, nesc, poss), hasOrgan(Human, Heart)), needs(skArg2ofHasorgan_1FnSk(Human)))))), nesc(b_d(KB, nesc, poss), v(~tHuman(Human), v(~tHeart(Heart), v(~needs(skArg2ofHasorgan_1FnSk(Human)), hasOrgan(Human, skArg2ofHasorgan_1FnSk(Human)))))))))).
- nnf :-
- &(nesc(v(~tHuman(Human), v(~tHeart(Heart), v(nesc(hasOrgan(Human, Heart)), needs(skArg2ofHasorgan_1FnSk(Human)))))), nesc(v(~tHuman(Human), v(~tHeart(Heart), v(~needs(skArg2ofHasorgan_1FnSk(Human)), hasOrgan(Human, skArg2ofHasorgan_1FnSk(Human))))))).
- th_nnf_in :-
- ( neg(tHuman(Human))
- ; neg(tHeart(Heart))
- ; tru(hasOrgan(Human, Heart))
- ; tru(needs(skArg2ofHasorgan_1FnSk(Human)))
- ),
- ( neg(tHuman(Human))
- ; neg(tHeart(Heart))
- ; neg(needs(skArg2ofHasorgan_1FnSk(Human)))
- ; tru(hasOrgan(Human, skArg2ofHasorgan_1FnSk(Human)))
- ).
- th_nnf_out :-
- ~ (n(neg(tHuman(Human))), n(neg(tHeart(Heart))), n(tru(hasOrgan(Human, Heart))), n(tru(needs(skArg2ofHasorgan_1FnSk(Human))));n(neg(tHuman(Human))), n(neg(tHeart(Heart))), n(neg(needs(skArg2ofHasorgan_1FnSk(Human)))), n(tru(hasOrgan(Human, skArg2ofHasorgan_1FnSk(Human))))).
- unused(proven_tru(hasOrgan(Human, Heart))) :-
- unused((\+needs(skArg2ofHasorgan_1FnSk(Human)), proven_tru(tHeart(Heart)), proven_tru(tHuman(Human)))).
- unused(proven_neg(needs(skArg2ofHasorgan_1FnSk(Human)))) :-
- \+ hasOrgan(Human, skArg2ofHasorgan_1FnSk(Human)),
- proven_not_neg(tHeart(Heart)),
- proven_not_neg(tHuman(Human)).
- proven_tru(hasOrgan(Human, skArg2ofHasorgan_1FnSk(Human))) :-
- needs(skArg2ofHasorgan_1FnSk(Human)),
- proven_tru(tHeart(Heart)),
- proven_tru(tHuman(Human)).
- proven_tru(needs(skArg2ofHasorgan_1FnSk(Human))) :-
- \+ hasOrgan(Human, Heart),
- proven_tru(tHeart(Heart)),
- proven_tru(tHuman(Human)).
- proven_neg(tHuman(Human)) :-
- proven_not_neg(tHeart(Heart)),
- needs(skArg2ofHasorgan_1FnSk(Human)),
- \+ hasOrgan(Human, skArg2ofHasorgan_1FnSk(Human)).
- proven_neg(tHuman(Human)) :-
- proven_not_neg(tHeart(Heart)),
- proven_neg(hasOrgan(Human, Heart)).
- proven_neg(tHeart(Heart)) :-
- proven_neg(hasOrgan(Human, Heart)),
- proven_not_neg(tHuman(Human)).
- proven_neg(tHeart(Heart)) :-
- needs(skArg2ofHasorgan_1FnSk(Human)),
- proven_neg(hasOrgan(Human, skArg2ofHasorgan_1FnSk(Human))),
- proven_not_neg(tHuman(Human)).
- % ==================================================================================================
- % /home/prologmud_server/lib/swipl/pack/logicmoo_base/t/examples/fol/sanity_exists_01.pl:23
- :- test_boxlog(all(Human_VAR,
- exists(Heart_VAR,
- =>(isa(Human_VAR, tHuman), &(isa(Heart_VAR, tHeart), hasOrgan(Human_VAR, Heart_VAR)))))).
- kif :-
- all(Human,
- exists(Heart,
- =>(tHuman(Human), &(tHeart(Heart), hasOrgan(Human, Heart))))).
- qualify_nesc :-
- all(Human,
- exists(Heart,
- nesc(=>(tHuman(Human), &(tHeart(Heart), hasOrgan(Human, Heart)))))).
- debugm(t123, sc_success(t123, t123:nnf(KB, all(Human, exists(Heart, nesc(b_d(KB, nesc, poss), =>(tHuman(Human), &(tHeart(Heart), hasOrgan(Human, Heart)))))), &(v(&(nesc(b_d(KB, nesc, poss), nesc(b_d(KB, nesc, poss), v(~tHuman(Human), tHeart(Heart)))), nesc(b_d(KB, nesc, poss), nesc(b_d(KB, nesc, poss), v(~tHuman(Human), hasOrgan(Human, Heart))))), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), &(nesc(b_d(KB, nesc, poss), v(~tHuman(Human), tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), nesc(b_d(KB, nesc, poss), v(~tHuman(Human), hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)))))))))).
- nnf :-
- &(v(&(nesc(nesc(v(~tHuman(Human), tHeart(Heart)))), nesc(nesc(v(~tHuman(Human), hasOrgan(Human, Heart))))), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), &(nesc(v(~tHuman(Human), tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), nesc(v(~tHuman(Human), hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))))))).
- unq :-
- &(v(&(nesc(v(~tHuman(Human), tHeart(Heart))), nesc(v(~tHuman(Human), hasOrgan(Human, Heart)))), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), &(nesc(v(~tHuman(Human), tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), nesc(v(~tHuman(Human), hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))))))).
- th_nnf_in :-
- ( ( neg(tHuman(Human))
- ; tru(isa(Heart, tHeart))
- ),
- ( neg(tHuman(Human))
- ; tru(hasOrgan(Human, Heart))
- )
- ; tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ),
- ( neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ; ( neg(tHuman(Human))
- ; tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart))
- ),
- ( neg(tHuman(Human))
- ; tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- )
- ).
- th_nnf_out :-
- ~ ((n(neg(tHuman(Human))), n(tru(isa(Heart, tHeart)));n(neg(tHuman(Human))), n(tru(hasOrgan(Human, Heart)))), n(tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))));n(neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), (n(neg(tHuman(Human))), n(tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)));n(neg(tHuman(Human))), n(tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)))))).
- unused(proven_tru(isa(Heart, tHeart))) :-
- proven_tru(tHuman(Human)),
- unused(\+needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))).
- unused(proven_tru(hasOrgan(Human, Heart))) :-
- proven_tru(tHuman(Human)),
- unused(\+needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))).
- unused(proven_neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))) :-
- proven_not_neg(tHuman(Human)),
- ( \+ isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)
- ; \+ hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))
- ).
- proven_tru(isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart)) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_tru(tHuman(Human)).
- proven_tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_tru(tHuman(Human)).
- proven_tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- proven_tru(tHuman(Human)),
- ( \+ isa(Heart, tHeart)
- ; \+ hasOrgan(Human, Heart)
- ).
- proven_neg(tHuman(Human)) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- \+ isa(skIsHeartInArg2ofHasorgan_1FnSk(Human), tHeart).
- proven_neg(tHuman(Human)) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- \+ hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)).
- proven_neg(tHuman(Human)) :-
- proven_neg(isa(Heart, tHeart)).
- proven_neg(tHuman(Human)) :-
- proven_neg(hasOrgan(Human, Heart)).
- % ==================================================================================================
- :- test_boxlog(all(Human,
- =>(isa(Human, tHuman), exists(Heart, =>(isa(Heart, tHeart), hasOrgan(Human, Heart)))))).
- % /home/prologmud_server/lib/swipl/pack/logicmoo_base/t/examples/fol/sanity_exists_01.pl:28
- :- test_boxlog(all(Human_VAR,
- =>(isa(Human_VAR, tHuman), exists(Heart_VAR, =>(isa(Heart_VAR, tHeart), hasOrgan(Human_VAR, Heart_VAR)))))).
- kif :-
- all(Human,
- =>(tHuman(Human), exists(Heart, =>(tHeart(Heart), hasOrgan(Human, Heart))))).
- qualify_nesc :-
- all(Human,
- nesc(=>(tHuman(Human), exists(Heart, =>(tHeart(Heart), hasOrgan(Human, Heart)))))).
- debugm(t123, sc_success(t123, t123:nnf(KB, all(Human, nesc(b_d(KB, nesc, poss), =>(tHuman(Human), exists(Heart, =>(tHeart(Heart), hasOrgan(Human, Heart)))))), &(nesc(b_d(KB, nesc, poss), v(~tHuman(Human), v(nesc(b_d(KB, nesc, poss), v(~tHeart(Heart), hasOrgan(Human, Heart))), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))))), nesc(b_d(KB, nesc, poss), v(~tHuman(Human), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), v(~tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human)), hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)))))))))).
- nnf :-
- &(nesc(v(~tHuman(Human), v(nesc(v(~tHeart(Heart), hasOrgan(Human, Heart))), needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))))), nesc(v(~tHuman(Human), v(~needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), v(~tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human)), hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))))))).
- th_nnf_in :-
- ( neg(tHuman(Human))
- ; ( neg(tHeart(Heart))
- ; tru(hasOrgan(Human, Heart))
- )
- ; tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ),
- ( neg(tHuman(Human))
- ; neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ; neg(tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ; tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)))
- ).
- th_nnf_out :-
- ~ (n(neg(tHuman(Human))), (n(neg(tHeart(Heart))), n(tru(hasOrgan(Human, Heart)))), n(tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))));n(neg(tHuman(Human))), n(neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), n(neg(tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human)))), n(tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))))).
- unused(proven_tru(hasOrgan(Human, Heart))) :-
- proven_tru(tHeart(Heart)),
- unused((\+needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)), proven_tru(tHuman(Human)))).
- unused(proven_neg(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)))) :-
- proven_not_neg(tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human))),
- \+ hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_not_neg(tHuman(Human)).
- proven_tru(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- proven_tru(tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human))),
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_tru(tHuman(Human)).
- proven_tru(needs(skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- proven_tru(tHeart(Heart)),
- \+ hasOrgan(Human, Heart),
- proven_tru(tHuman(Human)).
- proven_neg(tHuman(Human)) :-
- proven_not_neg(tHeart(Heart)),
- proven_neg(hasOrgan(Human, Heart)).
- proven_neg(tHuman(Human)) :-
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_not_neg(tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human))),
- proven_neg(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))).
- proven_neg(tHeart(skIsHeartInArg2ofHasorgan_1FnSk(Human))) :-
- proven_neg(hasOrgan(Human, skIsHeartInArg2ofHasorgan_1FnSk(Human))),
- needs(skIsHeartInArg2ofHasorgan_1FnSk(Human)),
- proven_not_neg(tHuman(Human)).
- proven_neg(tHeart(Heart)) :-
- proven_neg(hasOrgan(Human, Heart)),
- proven_not_neg(tHuman(Human)).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement