15.5.2 Operational Semantics

An or-statement behaves as a propagator which concurrently investigates all its alternatives. Each clause is continually monitored.

or GUARD then BODY end   ==>  Guard Body

An or-statement reduces all its guards in parallel such that the constraints of the guard remain properly separated from those in the global constraint store. We say that every guard is executed in its own computation space.

As soon as the guard of a clause becomes inconsistent with the global constraint store, the clause is removed. An or-propagator block its thread. It goes away when one a single clause remains. If an or-statement goes away then the body of the remaining clause is executed.

We can observe the semantics of or-statements by feeding the following pieces of code:

<Test the or-Statement>=
declare  
Gen Cas Num
<Or Statement> 
{Browse 'An or-propagator blocks its thread'}
{Browse 'Inconsistent clauses are removed'}
{Browse 'An or-propagator with a single clause goes away'}
{Browse ['gender:' Gen 'case:' Cas 'number:' Num]}
/*
Cas=nom Gen=fem
*/

When having feeded theses lines, nothing should happen since the or-propagator blocks its thread. But when feeding the additional constraint Cas=nom Gen=fem then the thread following the or-statement becomes active. Note in particular that the variable Num is determined to the value pl.


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