Create a binary predicate called 'square' which will square each
number in a list. This pred. will be shallow.
e.g. ?-square([a,[[3]],b,4,c(5),8],X).
X=[a,[[3]],b,16,c(5),64]
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.