12.1 Encapsulating Failure

For returning the result of the unification process, independently of failure or not, you can use the Oz search facilities as follows:

{Browse {Search.base.all proc{$ X} {Constrain X _} end}}

This works fine for returning failure in terms of an empty list rather than a programming error. But there is still a problem with returning the result of unification when coreferences occur. How can you return the result in the following example?

declare proc{CoRef X} Y in X=f(Y Y) end 
{Browse {Search.base.all proc{$ X} {CoRef X} end}}

Here you have lost the coreference between the first and second subtree of X. This problem can be solved in Oz as described in the next section.


Denys Duchier, Claire Gardent and Joachim Niehren
Version 1.3.99 (20050412)