Advertisement
logicmoo

"Decidablity" Logic

Sep 23rd, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 2.47 KB | None | 0 0
  1. /*
  2.  
  3.  
  4. No false positives:
  5. Do not assume something is true unless we can both find concrete evidence to prove it and additionally fail to find cases that subsets of the  evidence proves to be false.
  6.  
  7. No false negatives:
  8.    Do not assume something is false until we find concrete evidence that proves it false.  And we additionally fail to find cases that subsets of this evidence proves to be true.
  9.  
  10.  
  11.  
  12. */
  13.  
  14. ==> clif(male(P)  => ~female(P)).
  15. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  16. % kif =
  17. %       all(P, (male(P)=> ~female(P))).
  18. %
  19. % pkif =
  20. %       all(P, (male(P)=>not(female(P)))).
  21. %
  22. % cnf =
  23. %       not(male(P))v not(female(P)).
  24. %
  25. % horn =
  26. %       [ (not(female(P)):-male(P)), (not(male(P)):-female(P))].
  27. %
  28. %
  29. % succeed(user:boxlog_to_pfc((not(female(P)):-male(P)), (male(P), {is_unit(P)}==>neg(female(P))))).
  30. %
  31. % succeed(user:boxlog_to_pfc((not(male(P)):-female(P)), (female(P), {is_unit(P)}==>neg(male(P))))).
  32. %
  33. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  34.  
  35.  
  36.  
  37. % Notice we do not have the evidence to prove anyone male to female!
  38. % Only the ability to "disprove" right now
  39.  
  40.  
  41. % Humans are male or female
  42. ==> clif(human(P) => (female(P) v male(P))).
  43.  
  44. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  45. % kif =
  46. %       all(P, (human(P)=>female(P)v male(P))).
  47. %
  48. % pkif =
  49. %       all(P, (human(P)=>female(P)v male(P))).
  50. %
  51. % cnf =
  52. %       not(human(P))v (female(P)v male(P)).
  53. %
  54. % horn =
  55. %
  56. %       [ (female(P):-human(P), not(male(P))),
  57. %         (male(P):-human(P), not(female(P))),
  58. %         (not(human(P)):-not(female(P)), not(male(P)))
  59. %       ].
  60. %
  61. %
  62. % succeed(user:boxlog_to_pfc((female(P):-human(P), not(male(P))), (human(P), neg(male(P)), {is_unit(P)}==>female(P)))).
  63. %
  64. % succeed(user:boxlog_to_pfc((male(P):-human(P), not(female(P))), (human(P), neg(female(P)), {is_unit(P)}==>male(P)))).
  65. %
  66. % succeed(user:boxlog_to_pfc((not(human(P)):-not(female(P)), not(male(P))), (neg(female(P)), neg(male(P)), {is_unit(P)}==>neg(human(P))))).
  67. %
  68. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  69.  
  70.  
  71. % joe is male
  72. ==> male(joe).
  73.  
  74. :- show_call(example_proven_true( male(joe ))).
  75.  
  76. % Logical Negation (not by failure)
  77. :- pfc_trace.
  78. :- pfc_watch.
  79.  
  80. % pat is not female
  81. ==> meg(female(pat)).
  82.  
  83. % We check that we cannot prove Pat is male.
  84. % Thus a query to ?- male(pat ).
  85. :- show_call(example_known_is_failure( male(pat ))).
  86.  
  87. % Assert pat is human
  88. ==> human(pat).
  89.  
  90. % Thus we can deduce he is male now
  91. :- show_call(example_known_is_success( male(pat ))).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement