% Messages ::= % unifyWith() % | getValue() % | isdet() \insert 'NewPortObjectDebug.oz' declare fun {MakeDFV} % our representation (states) are records of form % determined() | undetermined() {NewPortObjectDebug undetermined(_) fun {$ State Msg} case State#Msg of undetermined(Var)#unifyWith(Value) then Var=Value determined(Value) [] undetermined(Var)#isdet(?BV) then BV=false undetermined(Var) [] determined(_)#isdet(?BV) then BV=true State [] determined(Value)#getValue(?Var) then Var=Value determined(Value) [] undetermined(OldVar)#getValue(?Var) then OldVar=Var undetermined(OldVar) end end} end fun {DFVGet DFV} local Z in {Send DFV getValue(Z)} {Wait Z} Z end end