Hi Alex!

Well, I read Ch.12 of the tutorial crefully, and Ch.9 of CTM again, and although I now know a lot more, I am still none the wiser! (I assume ch12 of the tutorial is a bit dated, and I could do with a clearer explanation of computing spaces.) Still - I'm getting there...

I don't remember exactly, but I think that it's OK. I think that 12.1 - 12.3 tells you everything you need (except maybe the Port.sendRecv stuff ;-)).

For instance, although I can accept your explanation that the assignment to the "FoundWord" Cell is bactracked in the second "choice" branch (instead of acting as a guard), I notice that my variable "CurrIsNum" which has _exactly_ the same scoping seems to work fine, no matter which "choice" branch it is bound in... Hm...

It works fine, because you do not use it as a 'cut'.

Hm, I see. If you only need that some solutions imply that some other should be discarded, think of using a "choice penalty" and SearchBest instead of SearchAll.
[...]
See what I mean?


This is not a bad idea practically, but I was really looking for something a little more... elegant (no offence meant :)
None taken :-) I know what you're after.
Also will your method cause solutions to be generated which are then discarded?? I would prefer it if it's already known beforehand that the solution is not acceptable, that the program doesn't generate it only to discard it a bit later. I admit I haven't studied the SearchBest functionaliy yet.

It is your script (+ the SearchAll search engine) that generates all the solutions - but you only want some of them. So I suggested how to get rid of those you don't want. Another option is to change the script so that it does not generate the solutions in the first place. Yet another option is to tweak/change the search engine.

You specify some constraints like you would in, say, Prolog. In Prolog, the outcome of the program is generated by Prolog builtin search engine, so one can say that 'the system found some solutions'. In (core) Oz, there is no builtin engine. It is up to you to choose a library search engine (e.g. SearchAll or SearchBest) or to create your own. To choose one, you should understand how it works (experiment, and maybe look into Search.oz). Of course, neither SearchAll nor Prolog's search engine is suitable for everything. SearchAll just does not have support for 'cuts' (as opposed to Prolog), and I think that for a good reason.

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

Reply via email to