Advertisement
punidota

Untitled

Sep 22nd, 2015
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.49 KB | None | 0 0
  1. domains
  2. a = integer
  3. predicates
  4. xor(a,a,a)
  5. nor(a,a,a)
  6. equ(a,a,a)
  7. razn(a,a,a)
  8. nondeterm function(a,a,a,a,a)
  9. clauses
  10. equ(0,0,1).
  11. equ(0,1,0).
  12. equ(1,0,0).
  13. equ(1,1,1).
  14. razn(1,1,0).
  15. razn(0,1,0).
  16. razn(1,0,1).
  17. razn(0,0,0).
  18. nor(0,0,1).
  19. nor(1,0,0).
  20. nor(0,1,0).
  21. nor(1,1,0).
  22. xor(0,0,0).
  23. xor(0,1,1).
  24. xor(1,0,1).
  25. xor(1,1,1).
  26. function(A,B,C,D,Output):- razn(A,D,S1), equ(A,D,S2), xor(S1,S2,SS1), razn(B,C,S3), equ(B,C,S4), nor(S3,S4,SS2), razn(SS1,SS2,Output).
  27. Goal
  28. function(A,B,C,D,Output).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement