SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. la_dreapta(X,Y) :- X =:= Y + 1.
  2.  
  3. la_stanga(X,Y) :- X =:= Y - 1.
  4.  
  5. langa(X, Y) :- la_dreapta(X,Y).
  6. langa(X, Y) :- la_stanga(X,Y).
  7.  
  8. %casa(Numar,Nationalitate,Culoare,AnimalCompanie,Bautura,Tigari)
  9.  
  10. solutie(Strada,PosesorPeste) :- Strada = [
  11. casa(1,_,_,_,_,_),
  12. casa(2,_,_,_,_,_),
  13. casa(3,_,_,_,_,_),
  14. casa(4,_,_,_,_,_),
  15. casa(5,_,_,_,_,_)],
  16.  
  17. member(casa(_,englez,rosie,_,_,_), Strada),
  18.  
  19. member(casa(S,_,albastru,_,_,_), Strada),
  20. member(casa(P,norvegian,_,_,_,_), Strada),
  21. langa(S, P),
  22.  
  23. member(casa(A,_,verde,_,_,_), Strada),
  24. member(casa(B,_,alb,_,_,_), Strada),
  25. la_stanga(A, B),
  26.  
  27.  
  28. member(casa(_,_,verde,_,cafea,_), Strada),
  29.  
  30. member(casa(3,_,_,_,lapte,_), Strada),
  31.  
  32. member(casa(_,_,galben,_,_,'Dunhill'), Strada),
  33.  
  34. member(casa(1,norvegian,_,_,_,_), Strada),
  35.  
  36. member(casa(_,suedez,_,caine,_,_), Strada),
  37.  
  38. member(casa(_,_,_,pasare,_,'Pall Mall'), Strada),
  39.  
  40. member(casa(Z,_,_,pisica,_,_), Strada),
  41. member(casa(T,_,_,_,_,'Malboro'), Strada),
  42. langa(Z, T),
  43.  
  44. member(casa(_,_,_,_,bere,'Winfield'), Strada),
  45.  
  46. member(casa(U,_,_,cal,_,_), Strada),
  47. member(casa(V,_,_,_,_,'Dunhill'), Strada),
  48. langa(U, V),
  49.  
  50. member(casa(_,german,_,_,_,'Rothmans'), Strada),
  51.  
  52. member(casa(X,_,_,_,_,'Malboro'), Strada),
  53. member(casa(Y,_,_,_,apa,_), Strada),
  54. langa(Y, X),
  55.  
  56.  
  57. member(casa(_,PosesorPeste,_,peste,_,_), Strada).
  58.  
  59. % ?- solutie(Strada,PosesorPeste).
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top