shithub: pprolog

ref: 8fde6e4845eeafe6ffc4179218a3ac9e8049c0e6
dir: /example.pl/

View raw version
math(A,B,C,D) :- D is A + B + C * A.

parentest :-
	1 + 2 * 3 + 4.
parentest :-
	(0 * (1 + 2) * 3) * 3 + 4.

true.

likes(bob, ice).
likes(sam, text).
likes(sam, ice).

could_be_friends(Person1, Person2) :-
	likes(Person1, Thing1),
	likes(Person2, Thing2),
	Thing1 = Thing2.

list1(A) :- A = [1,2,3,4].
list2(A) :- A = [a,b|c].

curly(A) :- A = {one,two,three}.

=(A,A).

length([], zero).
length([Head|Tail], suc(Length)) :-
	length(Tail, Length).