Advertisement
sheyshya1

multiple arity and use of conjuc

Dec 5th, 2021 (edited)
1,321
-1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.86 KB | None | 0 1
  1. DOMAINS
  2. person = symbol
  3. PREDICATES
  4. father(person) % This person is a father
  5. father(person, person) % One person is the father of the other person
  6. CLAUSES
  7. father(Man):-
  8. father(Man,_).
  9. father(adam,seth).
  10. father(abraham,isaac).
  11. Goal
  12. %father(adam,_).
  13. %father(seth,_).
  14. %father(Man,_).
  15. father(Who,X).
  16.  
  17.  
  18.  
  19. use of conjuction and disjunction
  20.  
  21. PREDICATES
  22. car(symbol,long,integer,symbol,long)
  23. truck(symbol,long,integer,symbol,long)
  24. nondeterm vehicle(symbol,long,integer,symbol,long)
  25. CLAUSES
  26. car(chrysler,130000,3,red,12000).
  27. car(ford,90000,4,gray,25000).
  28. car(datsun,8000,1,red,30000).
  29. truck(ford,80000,6,blue,8000).
  30. truck(datsun,50000,5,orange,20000).
  31. truck(toyota,25000,2,black,25000).
  32. vehicle(Make,Odometer,Age,Color,Price):-
  33. car(Make,Odometer,Age,Color,Price);
  34. truck(Make,Odometer,Age,Color,Price).
  35.  
  36. GOAL
  37. car(Make, Odometer, Years_on_road, Body, 25000).
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement