The Prio argument determines the priority with which the Goal will be scheduled when woken. It can be a positive number between 1 and 12, or zero, in which case the priority defaults to the priority setting of the predicate which is called in Goal.
CondList is a list of terms (or a single term) of the form Vars->Cond or trigger(Atom). It specifies the conditions that will lead to the goal being woken up. It is enough for one of the specified conditions to arise in order for the goal to be woken.
Vars->Cond is used to specify trigger conditions on variables. Vars is an arbitrary term, and the suspension will be attached to all the variables that occur in Vars.
The condition Cond is either the name of a predefined suspension list or the specification of a suspension list in one of the variable's attributes. The predefined suspension lists are: 'inst' (for instantiation), 'bound' (instantiation, including aliasing to another variable) and 'constrained' (any constraining attribute modification). The general specification has the form
Vars->moduleName:(suspListName of attrStruct)which can be abbreviated (if moduleName and attrStruct are identical) to
Vars->moduleName:suspListNameThe following are examples for valid conditions:
Vars->inst Vars->constrained Vars->fd:min Vars->fd:(min of fd)A specification of the form trigger(Atom) states that the goal should be woken by a symbolic trigger, ie. by a matching invocation of the built-in schedule_suspensions/1. The name of the trigger can be an arbitrary atom.
NOTE: it is possible to create a suspension that can never be woken, e.g. by specifying a Vars-term without variables.
[eclipse 1]: suspend(writeln(hello), 2, X->inst). X = X Delayed goals: writeln(hello) yes. [eclipse 2]: suspend(writeln(hello), 2, X->inst), writeln(one), X=1, % causes waking writeln(two). one hello two X = 1 yes. [eclipse 3]: suspend(writeln(X), 2, [X,Y]->bound), X=Y. X X = X Y = X yes. [eclipse 4]: suspend(writeln(world), 2, trigger(hello)), trigger(hello). world yes.