| OCR Text |
Show 7 that most constraints may fire in any number of ways or directions, whereas a dependency may only 'fire' in one direction. A dependency is a record of how a particular value was derived, and how it may be derived again. A constraint does not record how a value was derived. It only states a relation between several values, and how subsets of those values may be computed given other value subsets in order to satisfy the relation. lmplementationally, a constraint is composed of two parts: • A Satisfaction Predicate. If true, the constraint is satisfied. Otherwise, the constraint is unsatisfied. • Satisfaction Clauses. For each way a constraint may fire, there is a list of assignments which may be executed to satisfy the constraint. For example, a 'plus' constraint might be expressed as: primitiveConstraint plus( a, b, c ) predicate: a • b + c; clauses: result: a; arqs: b, c; a :• b + c; result: b; args: a, c; b :• a - c; result: c; args: a, b; c :c a - b; end; Each satisfaction clause may be read as: if the result is not a constant, and all of the arguments have known values, then the assignments may be made. Several constraints may be joined together to form a set of relations on a set of quantities. A set of constraints is called a constraint network or a constraint graph. An example constraint network is shown in figure 3. (1) a _ _.r-...... (2) b ---L-~ + .,.._ __ e (7) (4) d Figure 3: A Simple Constraint Network/Graph. |