UX Recorder: Screen capturing software for iOS. Learn more.

Glossary » constraint


a declarative specification of relationships between variables. These relationships are automatically maintained by the system. Among other applications, constraints are used in graphics systems to specify layout, e.g. by specifying that two objects should always be connected with a line or aligned along the same axis.

A “one-way constraint maintenance system” allows the specification of relationships between variables, such that a variable B can be triggered to update whenever a variable A updates, but a relationship from B to A cannot exist. That is, cycles are not allowed. A one-way constraint maintenance system is not significantly different from an active value system, except perhaps syntactically.

A “two-way constraint maintenance system” allows cycles and prevents them from infinitely cycling by either stopping after one pass through the cycle, waiting for the system to settle to a stable state (ending propagation when a value does not change more than a given threshold), or through slightly more sophisticated techniques.

A “constraint solver” does not propagate changes, but instead solves for the next state of the entire system by solving systems of equations. Constraint solvers are limited to mathematical systems that are well enough understood to be easily solved, i.e. linear equations.