Can I get a recursive Prolog predicate having two arguments, called reverse, which returns the inverse of a list:
Sample query and expected result:
?- reverse([a,b,c], L). L = [c,b,a].
A recursive Prolog predicate of two arguments called
palindromewhich returns true if the given list is palindrome.Sample query with expected result:
?- palindrome([a,b,c]). false. ?- palindrome([b,a,c,a,b]). true.