Thanks. That's beginning to make more sense.
I guess that part of my confusion in approaching Oz is not knowing in what order one has to learn things. In this case it seems that it is essential to learn about Computation Spaces and how to program with them
before learning about choice. As I mentioned earlier, I had seen a brief discussion of Computation Spaces in the Relational Programming part of the tutorial, but I assumed it was telling me how the system used them to implement choice.
Also the Tutorial didn't tell me the operations I should know about so that I could manipulate Computation Spaces myself. Other than 12.2, the tutorial doesn't have a section on Computation spaces at all, which it now seems to me are fundamental to understanding how to write Oz code that includes choice.
I just looked at the Global index. There is no entry for Computation Space. The entry for Space points to the Space API but not to any tutorial information about how to use Spaces.
CTM discusses Spaces in Chapter 12, which had intended to get to after Chapter 9. Even there, though, the discussion doesn't appear to be a tutorial about how to use computation spaces to write solvers--as Raph's comment suggests. It is more a discussion of how computation spaces are used by existing solvers to solve FD problems. It now seems to me that a good discussion of how to write solvers using Computation Spaces should be prerequisite to any discussion of how to use the Oz choice construct.
This may all be obvious to those of you who are familiar with Oz, but to a new comer, even one with a Prolog background, it's bee quite confusing to figure out the order in which I have to learn things.
Is there a nice tutorial about using Computation Spaces to write solvers that I can use as a reference?
-- Russ
On 10/4/05, Raphael Collet <[EMAIL PROTECTED]> wrote:
Russ Abbott wrote:
> * It also strikes me as strange that apparently (and correct me if
> I'm wrong) it is not possible to execute 'choice' directly. That
> is, one can't write {Digit} or {Browse {Digit}} and expect a
> result. But since 'choice' is part of the syntax of the language,
> as a programmer, my expectation is that it should do something,
> i.e., that the virtual machine that execute Oz programs would do
> something when it gets to a 'choice'.
Let me try to clarify things a bit. When a thread executes a choice
statement, the program is facing a non-deterministic choice. Something
*from the outside* must decide which alternative to choose. This is why
the designers of Oz decided to encapsulate non-determinism. For this
purpose they invented the computation space.
So your nondeterministic program is run inside a computation space.
This space does not permit side effects, and thus looks like a closed
world. From outside the space, you can detect when the space is facing
a nondeterministic choice. There you can "guide" the computation by
committing one of the alternives.
This makes a search engine easy to implement in Oz. Computation spaces
are provided as first-class entities. Search consists in creating a
computation space with the logic program inside it, and try all possible
executions. For this, you wait until the computation succeeds, fails,
or makes a choice. When facing a choice, you typically clone the space,
and commit one of the alternatives per clone, and recursively explore them.
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list [email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users
--
_____________________________________________
Professor, Computer Science
California State University, Los Angeles
o Check out my blog at http://russabbott.blogspot.com/
_________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
