Harmon Nine wrote:
The proc, as it is involved in FD constraints, creates a "space." A
space can only modify variables that are created locally within it
(here, created within the proc). Any variables created outside the
space (i.e. outside the proc), but the space still has access to (via
closure), are read-only.
Well, the story is slightly more complicated... A thread inside a space
can bind a variable created outside that space, but the binding is not
visible outside the space. In other words, the space is allowed to
"speculate" on the variable's value. The speculation is like a local
assumption made by the space only.
While a space speculates on a variable, it cannot become "stable". That
is, it cannot reach a final state. This is because the final state
depends on that variable. Consider the following example:
declare X Y
S={NewSpace proc {$ Root} X=42 {Show X} end}
Executing this will show "42" on the output (the Show is only for
debugging purposes here). But the space has not succeeded yet. If you
bind X to 42 outside, the space is clearly consistent, and the space
reaches a successful termination. However, binding X to 37 make the
space's execution inconsistent, and the space has failed.
If you want to know more about computation spaces, the reference is
Christian's book "Programming Constraint Services"
http://web.it.kth.se/~schulte/paper.html?id=Schulte:LNAI:2002
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users