Advertisement
Guest User

Untitled

a guest
Feb 15th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 1.00 KB | None | 0 0
  1. BooleanEvaluation1
  2.  
  3. True
  4.  
  5. BooleanEvaluation2
  6.  
  7. is_true(V, X imp Y) :- is_true(V, -X or Y)).
  8. is_true(V, X equiv Y) :- is_true(V, X imp Y), is_true(V, Y imp X).
  9. the valuation succeeds  
  10.  
  11. ?- is_true(v0, -(a and b) equiv (-a or -b)).
  12. true.
  13.  
  14. BooleanEvaluation3
  15.  
  16. ?- valuation(V), is_true(V, -(a and b) equiv (-a or -b)).  
  17. V = [a, b, c] ;
  18. V = [a, b] ;
  19. V = [a, c] ;
  20. V = [a] ;
  21. V = [b, c] ;
  22. V = [b] ;
  23. V = [c] ;
  24. V = [] ;
  25. false.
  26.  
  27.  
  28. ?- valuation(V), is_true(V, a imp (a imp b)).
  29. V = [a, b, c] ;
  30. V = [a, b] ;
  31. V = [a, c] ;
  32. V = [a] ;
  33. V = [b, c] ;
  34. V = [b] ;
  35. V = [c] ;
  36. V = [] ;
  37. false.
  38.  
  39. ?- valuation(V), is_true(V, (a imp (b imp c)) imp ((a imp b) imp (a imp c))).
  40. V = [a, b, c] ;
  41. V = [a, b] ;
  42. V = [a, c] ;
  43. V = [a] ;
  44. V = [b, c] ;
  45. V = [b] ;
  46. V = [c] ;
  47. V = [] ;
  48. false.
  49.  
  50.  
  51. ?- valuation(V), is_true(V, (((a imp b) and (b imp c)) imp -(-c and a))).
  52. V = [a, b, c] ;
  53. V = [a, b] ;
  54. V = [a, c] ;
  55. V = [a] ;
  56. V = [b, c] ;
  57. V = [b] ;
  58. V = [c] ;
  59. V = [] ;
  60. false.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement