Hi
I found this question in a book but it didn't have a solution to it, any have any pointers on how to go about solving it?
Heres the problem
Define evaluate(Expr, Value) that given an arithmetic expression "Expr" in prefix form with binary operations "add" and...
thats pretty easy..
Something is the member of a list if it is the Head of the list or if it is in the tail of the list..
so
member(X, [X,Head]).
member(X, [Head,Tail]):- member(X, Tail).
Hope that helps..
Euan
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.