I am new to Prolog and am trying to write a procedure for a strictly decreasing sequence for an assignment.
Now define a predicate isOrdered, such that 'isOrdered(Lst)' succeeds if the items in the list, Lst, are in strictly decreasing sequence. You may assume Lst contains only numbers. e.g. ?- isOrdered([11, 5, 3, 0]). true.
This is what I have so far:
isOrdered([]).
isOrdered([A|B]) :- isOrdered([B]), A > B.
It's giving me an error that says out of local stack. Can't seem to wrap my head around this.