Thanks for that clarification Raph,
Yes, your explanation is worded very clearly, although I understood
exactly what Filip meant.
Actually, I've just managed to find a good explanation of spaces in
"Logic Programming in the context of multiparadigm programming: the Oz
experience", ch 7.4
(http://web.it.kth.se/~schulte/papers/VanRoyBrandEa_TPLP_2003.pdf)
Stuff like that should be included in the main Oz page documentation, if
you ask me...
(BTW, I once I understood my mistake, the whole apace/cloning approach
reminded me vaguely of how I'd attempt this if I had to use a
forward-chaining production system. Even in terms of this analogy, my
logical error became glaringly obvious.)
Cheers
Alex
Raphael Collet wrote:
The "choice" is precisely a nondeterministic operator, and nothing more
than that. The statement
choice S1 [] S2 end
states that the program may execute either S1, or S2. That's all. There
is basically no communication possible between alternatives.
The "choice" statement *does not* create a clone: clones are created by
the search engine only. Cloning is used by the search engine to explore
both possible executions of the program. Backtracking in Mozart is
implemented by taking a clone of a former state of the encapsulated
computation, and committing a not yet explored alternative.
A bit more about cloning: Remember that a computation space is a data
structure that contains a (possibly nondeterministic) computation.
Cloning a space means cloning the computation inside the space, and this
includes threads, variables, and every thing created inside the space!
So if a computation space uses a cell, that cell will be cloned with the
space. Each clone of the space has its *own* cell. This is why there
is no communication between clones. Actually the only possible
communication must be done via a parent space.
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users