(23rd-April-2020)
In many domains, not all possible assignments of values to variables are permissible. A hard constraint, or simply constraint, specifies legal combinations of assignments of values to the variables.
A scope or scheme is a set of variables. A tuple on scope S is an assignment of a value to each variable in S. A constraint c on a scope S is a set of tuples on S. A constraint is said to involve each of the variables in its scope.
If S' is a set of variables such that S⊆S', and t is a tuple on S', constraint c is said to satisfy t if t, restricted to S, is in c.
Constraints can be defined using the terminology of relational databases. The main difference between constraints and database relations is that a constraint specifies legal values, whereas a database relation specifies what happens to be true in some situation. Constraints are also often defined intensionally, in terms of predicates (Boolean functions), to recognize legal assignments rather than extensionally by representing each assignment explicitly in a table. Extensional definitions can be implemented either by representing the legal assignments or by representing the illegal assignments.
Comments