prolog check if a list is in ascending order -


i have list , want check if ordered. can point out error?

thanks

taxinomemene([]). taxinomemene([element1,element2|tail]):-         stoixio1>stoixio12,         taxinomemene([stoixio2|tail]). 

what if have singleton list , stoixio1 , stoixio12? condition should in terms of element1 , element2

is_sorted([]). is_sorted([_]). is_sorted([x,y|t]) :-    x=<y,    is_sorted([y|t]). 

Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -