How to generate a list of quadruples in prolog?

17 views
Skip to first unread message

Omotayo Odupitan

unread,
Mar 2, 2016, 4:44:03 AM3/2/16
to SWI-Prolog

1 < X < Y and X + Y <= 100. S = X + Y P = X * Y .

The goal s1(Q,100) will bind Q with a list of quadruples [X, Y, S, P], where S = X + Y and P = XY

I want to have an answer such as Q = [[3,4,7,12],[2,6,8,12], ....]

Please assist, new to prolog.

Reply all
Reply to author
Forward
0 new messages