tuples(?List1,?List2,?List3,?Pad,?Tuples)
succeeds if Tuples is a list of tuples composed from corresponding elements in List1, List2, and List3. A tuple is either pair(X1,X2), or triple(X1,X2,X3), and Pad is used for padding if the lists are too short to create pairs.
Ex: tuples([a,b],[1,2,3],[z],x, [triple(a,1,z),pair(b,2),pair(3,x)])
Any clue how should I approach this ?
I am not asking for an answer to the problem but only hint for direction
succeeds if Tuples is a list of tuples composed from corresponding elements in List1, List2, and List3. A tuple is either pair(X1,X2), or triple(X1,X2,X3), and Pad is used for padding if the lists are too short to create pairs.
Ex: tuples([a,b],[1,2,3],[z],x, [triple(a,1,z),pair(b,2),pair(3,x)])
Any clue how should I approach this ?
I am not asking for an answer to the problem but only hint for direction