hello I have two easy examples, but I'm greenhorn in prolog.
nodouble (x, list1, list2) - predicate delete duplicate values in List 1 and save them to List2
max (list, x) - predicate find max value from List and save it to X.
I find max from list as:
maxList([]).
maxList([E],E)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.