[m-users.] Why has this the determinism category "nondet"?

Zoltan Somogyi zoltan.somogyi at runbox.com
Sat Feb 16 06:49:17 AEDT 2019



On Fri, 15 Feb 2019 20:42:23 +0100, Volker Wysk <post at volker-wysk.de> wrote:
> :- pred vorder(list(T)::in, list(T)::in, list(T)::out) is det.
> 
> vorder([X|A], [X|B], [X|C]) :-
>    vorder(A,B,C).
> 
> vorder([X|_], [Y|_], []) :-
>    X \= Y.

This post on stack overflow explains the source of your problem with these
two clauses.

https://stackoverflow.com/questions/7466833/mercury-determinism-and-pattern-matching

Zoltan.


More information about the users mailing list