Im trying to achieve this:
sum(bookmark(num)),
bookmark(bookmark(bum)),
bookmark(bookmark(bookmark(num))).
sum(bookmark(num), bookmark(bookmark(num)), A).
to return А = bookmark(bookmark(bookmark(num))) Im not close yet, since i fail at the bookmark function as stated below.
bookmark(e1, e2) :-
e1 \= 0,
e2 \= 0.
/*#e1 = element-one, e2 = element-two*/
sum(e1, e2, result) :-
bookmark(e1, e2),
e1 is (1+1),
e2 is (1+1),
result = (e1 + e2).
Im checking if the bookmark function returns true, then the simple addition will follow. Problem is: if the input for the bookmark function is any two numbers, it returns false. Example with bookmark(1, 2) - false. Example with bookmark(0, 0) - false. Any help why this doesn't work will be greatly appreciated.
is
is arithmetic evaluation.=
is syntactic equality – false