Wolfgang Lux wrote:
> Sven Panne wrote:
> > [...]
> > foo eval flex
> > foo 1 = {}
> > foo 9 = {}
>
> But the semantics clearly indicate the sources of non-determinism. In
> your example the non-determinism stems from the overlapping rules in
> the definition of foo. [...]
Huh? foo's rules are *not* overlapping (unless 1 unifies with 9 :-).
> In my example, nothing is non-deterministic in the definition of
> g x = x =:= 1
> itself. The whole program becomes non-deterministic however, due to the
> (IMHO totally unrelated) *change of semantics* in the function h.
My point was only: It's not sufficient to look at the rules of a single
function alone to conclude if it has a single solution or not. You
can't do something similar in Prolog, neither. In Mercury the programmer
has to state such a property explicitly.
--
Sven Panne Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen Oettingenstr. 67
mailto:sven.panne_at_informatik.uni-muenchen.de D-80538 Muenchen
http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne
Received on Fr Okt 23 1998 - 16:44:00 CEST