[Oz] equality of unbound variables
Cesare Tinelli
tinelli at cs.uiowa.edu
Thu Dec 23 10:02:38 CET 1999
Denys,
Denys Duchier wrote:
> Let's say F1 and F2 are two encapsulated terms and R is a function
> that takes two terms and returns a new one (this might be an
> inference). Here is how to obtain the new encapsulated conclusions
> that follow from F1 and F2 by R:
>
> declare L = {Search.allP proc {$ T3} {R {F1} {F2} T3} end 1 _}
>
> L is now a list of encapsulated terms. This is the technique that we
> used to implement e.g. a number of natural language parsers (in
> particular chart parsers).
>
> The constraint programming / search aspect of Oz were designed around
> the notion of encapsulation. The implementation supports this _very_
> efficiently; more efficiently (and correctly) than what you are likely
> to achieve by programming it yourself :-)
>
> To really use Oz effectively, it is best to buy into its paradigm.
> That's why I would like to encourage you to consider using
> "encapsulated terms" if at all appropriate for your application. You
> will find they make your life a lot easier :-)
>
thanks a lot for the clarification and example. I see now what you meant in
your previous message, and I agree that using encapsulated terms the way
you show makes a lot of things easier and, yes, safer. I can see on a
number of instances in which the technique would really help me in what I'm
doing, and I do plan to use it there.
My only concern is that, as I understand it, the approach you highlight
above still requires for a term to be known in advance (at compile time,
that is) to be encapsulated. I don't quite understand how to use the
encapsulation technique with terms that are only known at run time, for
instance because they are passed as input.
Well, if the term is passed as a string, it is fairly straightforward to
wrap it into a function definition (with the proper local variable
definitions), feed it to Compiler.virtualStringToValue say, and get its
encapsulated version. What I don't see is how to encapsulate an Oz record
at run time. But again, maybe I'm thinking in the wrong terms. Maybe there
is a way to design any Oz application from the outset so that "run-time
encapsulation" will never be needed.
I'll look forward to your feedback, or that of the other wizards of Oz out
there, on this point.
Best,
Cesare
-
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