Thanks for the suggestions so far Filip!
The purpose of the choice statement is to express the non-deterministic decision in the search tree. But what you are trying to do is *enforce* one of the (two) branches. You can not use "choice" for that.
Yes, I can see that "choice" implements PURE non-determinism, and so is not really suitable. The question is what WOULD be suitable to enforce the second branch, dependant on the success/failure of the first. Yves Jaradine suggested I look into "cond". I must really go and study that Chapter 12 now!!! I should have done it ages ago. :)
The solution to your problem depends on the complexity of the Corresp procedure.
You can see it in my code. http://aegean.pwp.blueyonder.co.uk/store/tel.oz It's not complex, in fact its a bit of a dummy function. I already have all possibilities as a list from the lookup, "Corresp" simply uses MemeberND, to dish them out as choices, so that the prog keeps its simple declarative form.
If it is really non-deterministic (it uses choice or some kind of distribution step, like FD.distribute), you might need to construct a nested search to see if the {Corresp First Word} statement really succeeds, and act correspondingly in the main script.
Yes, I can see some kind of nesting will be required, I'm off to read THAT chapter. Back soon.
_________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
