Re: prelude extension proposal

From: Bernd Brassel <>
Date: Tue, 11 Oct 2005 11:52:30 +0200

There is a subtle problem with your proposal, Sergio. With the definition

> allValuesOf e = findall (\x -> x=:=e)

There is a difference between

e1 = allValuesOf coin


e2 = findall (\x -> x=:=coin)

which depends on the implementation of encapsulated search as discussed
in [1]. The Münster Curry Compiler implements what was called in [1]
"weak encapsulation" which results in a non-deterministic branching for
the evaluation for e1 and a deterministic evaluation for e2:
e1 ~*~> 0 | 1
e2 ~*~> [0,1]
In PAKCS ("strong encapsulation") in contrast, allValuesOf will behave
like you expect, but resulting in different strangenesses for other

I think because of the implementation dependence, the definition should
not be in the prelude and we should rather think about introducing a
better approach to encapsulated search like the one proposed in [1].

[1] Huch, Hanus, Braßel - Encapsulating Non-Determinism in Functional
Logic Computations - WFLP 2004

curry mailing list
Received on Mi Okt 12 2005 - 09:57:10 CEST

This archive was generated by hypermail 2.3.0 : Mi Sep 30 2020 - 07:15:03 CEST