Advertisement
logicmoo

my use of not_in/2 in might be confusing unless you knew tha

Jan 18th, 2018
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 3.33 KB | None | 0 0
  1.  
  2. baseKB:  ?- kif_to_boxlog(all([Person,GrandFather], exactly(1,Parent,(parent(Person,Parent) ,   father(Parent,GrandFather)) =>  grand_father(Person,GrandFather))),O),maplist(fmt9,O).
  3. % kif :-
  4. %       all([Person, GrandFather],
  5. %           exactly(1,
  6. %                   Parent,
  7. %                   (parent(Person, Parent)&father(Parent, GrandFather)=>grand_father(Person, GrandFather)))).
  8.  
  9.  
  10.  
  11. % my use of not_in/2 in might be confusing unless you knew
  12. % that they mean "'not' already created 'in' this global deductive context"
  13.  
  14. proven_tru(father(Parent, GrandFather)) :-
  15.         not_in(Parent,
  16.                skF(1,
  17.                    skParentFalseArg2Parent_1_0FnSk(GrandFather, Person),
  18.                    Parent,
  19.  
  20.                    [ ((p(parent(Person, Parent))=false;p(father(Parent, GrandFather))=false);q(grand_father(Person, GrandFather))=true)
  21.                    ])).
  22.  
  23. proven_tru(parent(Person, Parent)) :-
  24.         not_in(Parent,
  25.                skF(1,
  26.                    skParentFalseArg2Parent_1_0FnSk(GrandFather, Person),
  27.                    Parent,
  28.  
  29.                    [ ((p(parent(Person, Parent))=false;p(father(Parent, GrandFather))=false);q(grand_father(Person, GrandFather))=true)
  30.                    ])).
  31.  
  32.  
  33. deduce_tru(grand_father(Person, GrandFather)) :-
  34.         nesc(parent(Person, Parent)),
  35.         skolem(Parent,
  36.                skF(1,
  37.                    skParentFalseArg2Parent_1_0FnSk(GrandFather, Person),
  38.                    Parent,
  39.  
  40.                    [ ((p(parent(Person, Parent))=false;p(father(Parent, GrandFather))=false);q(grand_father(Person, GrandFather))=true)
  41.                    ])),
  42.         nesc(father(Parent, GrandFather)).
  43.  
  44.  
  45. make_existential(Parent, skF(1, skParentFalseArg2Parent_1_0FnSk(GrandFather, Person), Parent,
  46.     [((p(parent(Person, Parent))=false;p(father(Parent, GrandFather))=false);
  47.           q(grand_father(Person, GrandFather))=true)])) :-
  48.         (   ensure_cond(Parent, parent(Person, Parent)),
  49.             never_cond(Parent, father(Parent, GrandFather))
  50.         ;   ensure_cond(Parent, grand_father(Person, GrandFather))
  51.         ).
  52.  
  53.  
  54. deduce_neg(father(Parent, GrandFather)) :-
  55.         nesc(parent(Person, Parent)),
  56.         skolem(Parent,
  57.                skF(1,
  58.                    skParentFalseArg2Parent_1_0FnSk(GrandFather, Person),
  59.                    Parent,
  60.  
  61.                    [ ((p(parent(Person, Parent))=false;p(father(Parent, GrandFather))=false);q(grand_father(Person, GrandFather))=true)
  62.                    ])),
  63.         falsify(grand_father(Person, GrandFather)).
  64.  
  65.  
  66. deduce_neg(grand_father(Person, GrandFather)) :-
  67.         not_in(Parent,
  68.                skF(1,
  69.                    skParentFalseArg2Parent_1_0FnSk(GrandFather, Person),
  70.                    Parent,
  71.  
  72.                    [ ((p(parent(Person, Parent))=false;p(father(Parent, GrandFather))=false);q(grand_father(Person, GrandFather))=true)
  73.                    ])).
  74.  
  75. deduce_neg(parent(Person, Parent)) :-
  76.         nesc(father(Parent, GrandFather)),
  77.         skolem(Parent,
  78.                skF(1,
  79.                    skParentFalseArg2Parent_1_0FnSk(GrandFather, Person),
  80.                    Parent,
  81.  
  82.                    [ ((p(parent(Person, Parent))=false;p(father(Parent, GrandFather))=false);q(grand_father(Person, GrandFather))=true)
  83.                    ])),
  84.         falsify(grand_father(Person, GrandFather)).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement