It may be that it's not needed, but for my own amusement, would you show me how to implement univ in Oz.  One use for it might be to write a predicate that determines if a term is ground.  Notice that
local X in
   {Browse {IsDet p(X)}}
end
yields true.  How would one write a predicate IsGround that would return true or false depending on whether it's argument contained any unbound variables?
 
-- Russ
_____________________________________________
Russ Abbott
Professor, Computer Science
California State University, Los Angeles
o Check out my blog at http://russabbott.blogspot.com/


 
On 9/26/05, Russ Abbott <[EMAIL PROTECTED] > wrote:
It may be that it's not needed, but for my own amusement, would you show me how to implement univ in Oz. 
 
Thanks.
 
-- Russ
_____________________________________________
Russ Abbott
Professor, Computer Science
California State University, Los Angeles
o Check out my blog at http://russabbott.blogspot.com/
 
On 9/26/05, Peter Van Roy <[EMAIL PROTECTED] > wrote:
Russ Abbott wrote:

> Prolog has a univ operator (=..) which constructs and deconstructs terms.
>
>     f(a, b, c) =.. [f, a, b, c]
>
> It works in either direction and unifies variables on either side as
> long as the "label" is an atom.  Is there anything like that in Oz?  I
> haven't seen it.  Neither* =..* nor *univ* is in the index of CTM.
>
> Thanks.

Oz does not have =.. as a basic operator, but it can easily be defined.
But =.. is almost never needed in practice.  Oz has a much richer
record data type that makes =.. superfluous.

There are also good reasons why Oz does not have 'var' or '!' or
assert or retract or setof or bagof.  These operations are used in
Prolog for particular programming techniques.  In Oz there are
better ways.  For example, dictionaries are almost always a better
primitive than assert or retract.  Search engines are better than
setof or bagof.  And so forth.

Oz is a descendant of AKL, which is a descendant of both
Prolog and Concurrent Prolog.  Oz has taken the best of these
languages and left out the hacks.  At least, that's my view!

Peter
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to