The real roots of Ax^2+Bx+C=0 are returned in the list named ROOTS. If there
are two roots, they are arranged in ascending order.
Successful queries:
quadratic(2.0,5.0,2.0,L). % L=[-2.0,-0.5]
quadratic(1.0,0.0,0.0,L). % L=[0.0]
quadratic(1.0,3.0,-4.0,L). % L=[-4.0,1.0]
Failed queries:
quadratic(2.0,5.0,2.0,[]).
quadratic(A, B, C, ROOTS) :- fail.
The input is 6 instaniated integer values. Query succeeds
if the volume of the first cube is > the volume of the second.
Successful queries:
isLargerCube(2,2,2,1,3,2).
isLargerCube(2,2,20,5,3,2).
Failed queries:
isLargerCube(1,3,2,2,2,2).
isLargerCube(2,2,2,2,2,2).
isLargerCube(W1, L1, H1, W2, L2, H2) :- fail.
The input is an instantiated flat list of atoms. This rule
will succeed if the all the elements of the list contain the
same value.
Successful queries:
allSame([]).
allSame([1]).
allSame([1,1,1,1]).
Failed queries:
allSame([1,2]).
allSame(LST) :- fail.
The input is an instantiated flat list of atoms. This rule
will succeed if the all the elements of the list are unique.
Successful queries:
allDifferent([]).
allDifferent([1]).
allDifferent([1,3,2]).
Failed queries:
allDifferent([1,1]).
allDifferent(LST) :- fail.
The input is two instantiated flat list of atoms, with equal length.
This rule should instantiate the third parameter the zipped version
of the first two lists.
Sample queries:
zip([1,2,3], [a, b, c], L). –> L = [[1,a], [2,b], [3,c]]
zip([], [], L). –> L = []
zip(L1, L2, ZIP) :- fail.
The input is 1) an instantiated integer 2) an instantiated flat list of
numbers, and 3) an uninstaniated value.
Sample queries:
removeKth(0, [a, b, c, d], L). –> L = [b, c, d]
removeKth(1, [a, b, c, d], L). –> L = [a, c, d]
removeKth(2, [a, b, c, d], L). –> L = [a, b, d]
removeKth(3, [a, b, c, d], L). –> L = [a, b, c]
removeKth(-10, [a, b, c, d], L). –> fail.
removeKth(4, [a, b, c, d], L). –> fail.
removeKth(K, L, O) :- fail.