Fred Spiessens wrote:

> cond S0 then S1 else S2 end
>
> The current space blocks until the space in which S1 is tried is
> either entailed or disentailed.
> I would like to merge the space of S1 into its parent as soon as it
> becomes stable.

Fred, it's really hard to understand what you want here. Try to state it better
in terms of S0, S1 and S2.

Two points you might be overlooking here:

- the very notion of stability: whenever a space is stable, you necessarily know
if it is entailed or failed. Consider the following example:

    declare
    A = {FD.decl}
    S = {Space.new proc {$ X} A = 1 {Space.waitStable} {Browse ok} end}

Here S will never get stable before enough constraints are given in the parent
space to determine whether "A = 1" fails. Notice that ok will only appear in
the browser after you make "A = 1" in the toplevel.

- "cond P0 then P1 else P2" creates one single space (say S0) encapsulating P0.
When S0 reaches stability, two things might happen: if it is succeeded, S0 is
merged and then P1 is applied _in the parent space_; otherwise, P2 is applied.

_Maybe_ what you are looking for is something (dangerous) like this:

    proc {MyCond P0 P1 P2}
       S0 = {Space.new P0}
    in
       {Space.waitStable}
       if {Space.askVerbose S0} == failed then P2
       else {P1 {Space.merge P0}} end
    end

Under these conditions (after a Space.waitStable _on the parent space_), the
result of Space.askVerbose becomes determined after S0 has done all inference
it possibly can for the moment, even if it may not decide yet whether it is
stable. Notice that P1 and P0 are unary procedures. P0 returns any local
variables of interest to be used (optionally) by P1.

Cheers,

Jorge.

>
> I could use:
>
> choice S0 {Space.waitStable} S1
> [] S2
>
> but the problem with that is: if S0 does not cause failure, I'm left
> with a useless copy of the space during the execution of S1, and I
> want to avoid this memory overhead.
>
> thanks for any ideas,
>
> Fred
>
>
>
_________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>




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

Reply via email to