Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.46 KB | None | 0 0
  1. Domains
  2.     int=integer
  3.     str=string
  4.     list=int*
  5.  
  6. Predicates
  7.     nondeterm playOn(str, str)
  8.     nondeterm isQuartet(str, str, str, str)
  9.  
  10. Clauses
  11.     playOn("Monkey", "Violin").
  12.     playOn("Donkey", "Alto").
  13.     playOn("Goat", "Violoncello").
  14.     playOn("Bear", "Contrabass").
  15.  
  16.     isQuartet(X, Y, Z, W):-
  17.         playOn(X, "Alto"),
  18.         playOn(Y, "Violin"),
  19.         playOn(Z, "Violoncello"),
  20.         playOn(W, "Contrabass"),
  21.         X<>Y, Z<>W, X<>Z, Y<>W, X<>W, Y<>Z.
  22. Goal
  23.     isQuartet(X, Y, Z, W).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement