Prolog program to check whether a list is an ordered list or not.
domains x = integer l = integer* predicates ordered(l) clauses ordered([X]). ordered([Head|[Head1|Tail]]) :- Head <= Head1, ordered([Head1|Tail]). Output : Goal: ordered([1,2,3,4]) Yes Goal: ordered([3,2,4,5]) No