See the Getting Started with Prolog page to get up to speed with our Prolog systems.
likes(junior, jay).
likes(junior, alex).
likes(lou, junior).
likes(lou, alex).
(a) Write a universal fact that says, "Everyone likes junior." (b) Write a rule important(X) that says, "X is important if junior likes X."
(c) Write a rule very_important(X) that says, "X is very important if X is important and lou likes X."
| ?- sumlist([1,2,3,4],10).
yes
| ?- sumlist([1,2,3,4],12).
no
| ?- sumlist([1,2,3,4],X).
X = 10
| ?- delete([1,2,3,4],3,[1,2,4]).
yes
| ?- delete([1,2,3,4],3,X).
X = [1,2,4]
| ?- delete([1,2,3,4],X,[1,2,4]).
X = 3