Thanks. I'll look at Chapter 11. I hadn't even looked at it yet.
The class will have to write (and presumably edit) some code, so hiding emacs is problematical. Besides, these are computer science students. The point is to write code at some level. The perspective I'm taking is that Oz is a programming language and that we are learning to program in it.
As new user, here are some observations from this recent discussion.
- It's now painfully clear to me that {Browse {SearchAll {Digit}}} makes no sense and that I should have written {Browse {SearchAll Digit}}.
- But it sure would have been nice had the system done something (error message, no solutions, semantic inconsistency warning, something) instead of doing absolutely nothing at all when I entered the first version above.
- 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'.
- But as I now understand things, that is not the case. (Or am I wrong again?) In either case I'm confused. If it does something, what does it do, and why don't I get any output? If it does nothing, i.e., it is semantically undefined, then why don't I get an error message when I attempt to execute it?
- But if it's undefined, is there any other example of a programming language part of whose syntax is semantically meaningless at the level of the language itself but that is defined just so that one can compose an argument to a library program? Doesn't that seem strange? Or am I still misunderstanding how things work?
Thanks.
-- Russ
On 10/3/05, Peter Van Roy <[EMAIL PROTECTED]> wrote:
Russ Abbott wrote:
>
> On 10/2/05, *Raphael Collet* < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Russ Abbott wrote:
>
> Another possibility is to program with "choice" in a direct style,
> i.e .,
> think of your program explicitly as a non-deterministic one. The
> exploration of all executions of the program is done by a search
> engine.
> To me this is less confusing than the "magic" behind prolog, but
> YMMV.
>
>
> That's exactly what I was originally hoping to do--program with choice
> directly. Is that possible without a visible call to a solver? I did
> want the solver to be in the background as in prolog (at least while
> doing Chapter 9).
>
> -- Russ
Dear Russ,
You can tell your students that Solve is a 'first-class Prolog top
level'. Prolog forces you
to always be inside a top level. In Oz you can have many top levels (=
calls to Solve)
in various stages of execution. Your students can have several examples
in various
stages of execution, all available in the same environment.
If you insist on hiding the solver you can use an idea from chapter 11
(the GUI chapter)
and have the students enter expressions in a text box, which are passed
to the compiler
(see, e.g., the Prototyper application in chapter 11 - the source code
for Prototyper is
available in the Prototyper itself by selecting the right example).
That way, you can hide
the emacs interface as well as the call to Solver!
Peter
--
_____________________________________________
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
