[Oz] Try statement
Luis Omar Quesada Ramirez
luis_omar_quesada at yahoo.com
Thu Mar 1 00:23:33 CET 2001
> Actually, case *can* be considered to be part of the
> kernel
> language. For the book, we are considering the
> following
> simple form of case for the kernel language:
>
> case X of f(l1:Y1 ... lm:Ym) then S1 else S2 end
>
> If the constraint store "knows" that X is of the
> form
> f(l1:_ ... lm:_), then this reduces to:
>
> local Y1 ... Ym in
> X=f(l1:Y1 ... lm:Ym)
> S1
> end
>
> (modulo some minor technical details).
>
> The case with multiple branches can be written in
> terms
> of the above 'single-branch' case. This shows well
> that
> case is an inherently sequential statement (it does
> not
> test all its branches 'in parallel'). Testing
> branches
> 'in parallel' is another matter -- it can be done by
> adding WaitOr to the kernel language and using it
> with the
> sequential case statement.
What about defining "Being of the form" (BOTF) as a
propagator. If so:
case E of Pattern then S1 else S2 end
________________________________________
cond {BOTF E Pattern} then S1 else S2 end
Anyway, I think "cond" and "or" must be part of the
kernel. They used to be in the past and I do not know
why they are not now. As far as I know, deep guards
cannot be defined in terms of flat guards so using the
rule above would not be actually extending the kernel.
Cheers,
Luis
_________________________________________________________
Do You Yahoo!?
Obtenga su dirección de correo-e gratis @yahoo.com
en http://correo.espanol.yahoo.com
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
More information about the mozart-users
mailing list