domains
list=integer*
predicates
order(list)
clauses
order([X]).
order([X,Y|Tail]):-
X<=Y,
order([Y|Tail]).
OUT PUT
=======
Goal: order([1,2,3,4])
Yes
--------------------------
Goal: order([1,2,5,3])
No
--------------------------
Goal: order([1,5,6,6,9])
Yes
--------------------------
Goal: order([9,4,5])
No