Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a binary predicate called 'square' which will square each

Status
Not open for further replies.

rukman

Programmer
Nov 4, 2011
7
US
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]


Need help.
 
Hey ductiletoaster how did u try ?

did u check whether the element is integer or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top