When I try {Browse {SearchAll {Digit}} I still get no output -- although again, the compiler accepts the input. It isn't as if 'choice' is not defined in the language.
Can someone explain in relatively simple terms what the system does when one runs {Browse {Digit}} and {Browse {SearchAll {Digit}}. What operational steps does it take?
I'm trying to teach this stuff. To do that I'd like to be able to refer my class to a document that describes how the current system works. (Actually, I need such a document myself!)
The examples from the tutorial that I tried do work, but the tutorial explanations are quite sketchy. The explanations in CTM Chapter 9 are more complete, but the examples don't work. So I'm stuck. I am not good enough with Mozart-Oz to be able to explain how to translate from 'choice' to 'or'. For example, if I simply substitute 'or' into the Digit definition, I get the syntax error: "_expression_ at statement position." Besides 'choice' does not produce a compiler error. So it must mean something, but I don't understand what it does mean in the current actual system?
Can someone give me a version of Digits that will run? I'd like to start with something as simple as that and build understanding on top of it. My plan was to do what CTM calls relational programming (Chapter 9) before getting to the FD stuff in Chapter 12. Is that possible? Can we talk about (and run) relational programs on their own? I would appreciate a few simple examples (that run) along with an intuitive step-by-step operational description of what the system is doing when it runs them.
Chapter 9 doesn't talk about Spaces. Can we do relational programming without first talking about Spaces? If not, is there a good explanation of spaces somewhere? Section 12 of the tutorial has a beginning, but it doesn't talk about either
Space.new or NewSpace, and what it does say isn't enough for me to understand how to use Spaces in programs.
My impression of Spaces from reading Chapter 12 is that Spaces are manipulated by the underlying system as it executes programs that include 'or' and other search constructs. It wasn't my impression that one is expected to manipulate them explicitly with operations like
Space.new. So I'm confused and would appreciate some help.
Thanks.
-- Russ
On 10/2/05, Raphael Collet <[EMAIL PROTECTED]
> wrote:
Russ Abbott wrote:
> I'm now working on Chapter 9 of CTM. It seems to be inconsistent with
> the material in Section 12 of the Tutorial
> (http://www.mozart-oz.org/documentation/tutorial/node12.html#chapter.lp
> < http://www.mozart-oz.org/documentation/tutorial/node12.html#chapter.lp >).
They're not inconsistent, but both the approaches and the goals are
different. CTM is about concepts and techniques in general, while the
tutorial is specific to Mozart. CTM is not a documentation of Mozart!
> Among other things the tutorial discusses or, dis, etc, (but not choice)
> whereas CTM discusses only choice.
The constructs "or", "dis", etc. are abstractions. The real primitive
operation is "choice". For the book it was chosen to focus on the
primitive operation instead of discussing Mozart-specific abstractions.
> local
> fun {Digit}
> choice 0 [] 1 [] 2 [] 3 [] 4 [] 5 [] 6 [] 7 [] 8 [] 9 end
> end
> in
> {Browse {Search {Digit}}}
> end
>
> CTM uses Solve and SolveAll, but I got compiler error messages when I
> tried either of those. In the above, I used Search instead. No
> compiler errors, but no output. So I suppose choice is defined, but I
> don't understand why I got no output. I also got no output when I just
> tried just {Browse {Digit}}. (I don't understand why not.)
Neither Solve nor SolveAll are defined in Mozart, but IIRC their code is
given in the book (must be chapter 12). You should simply use Space.new
instead of NewSpace, etc. Check out module Space for space operations.
Search is a module that implements search engines. Use SearchOne or
SearchAll.
Note that {Browse {Digit}} cannot work, since search is not a global
thing in Mozart (contrary to Prolog). You have to explicitly use a
search engine like SearchOne or SearchAll.
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
