This section contains 229 words (approx. 1 page at 300 words per page) |
A constraint is a restriction (or limitation) on a computer solution that is acceptable in order to resolve a problem. Specifically, a constraint can be applied (sometimes individually or as a group) to: (1) a restriction on a state of a model, (2) a restriction on a set of possible values that a variable may take, or (3) a logical (or Boolean) expression that must be satisfied. In computer programming a constraint generally involves a Boolean expression (a symbolic expression that results in a condition that is either TRUE or FALSE, but not both) that may also involve variables within a particular model. For example, the expression p < q is a Boolean expression, which states that the variable p is less than the variable q; that is, the "constraint" is stated that the variable p must always be less than the variable q. More specifically, 2 < 5 (2 is less than 5) is a Boolean expression because the result is TRUE. On the other hand, 6 < 5 (6 is less than 5) is also a Boolean expression because the result, in this case, is FALSE. The process of assigning values within a model to all variables so that all applicable constraints are true is called "constraint satisfaction." For example, in order to gain constraint satisfaction (the result is always TRUE) the process involving the expression p < 5 would assign all values less than 5; that is p = {...,-3, -2, -1, 0, 1, 2, 4}.
This section contains 229 words (approx. 1 page at 300 words per page) |