Next: Adding definite relations Up: The constraint language: Previous: Solutions of constraints

Subsections

• Notation.

## Determining satisfiability

A constraint is satisfiable iff it has a solution. Not all constraints are satisfiable. For example, the constraint c1 c2 is unsatisfiable, because for all assignments the denotation of c1 will be the feature graph (c1,) and the denotation of c2 will be (c2,) which is not the same graph. Clearly a constraint may also define such a clash indirectly, as in the constraint:

The problem whether a constraint is satisfiable is decidable. Algorithms deciding satisfiability for more powerful feature logics (extending the current logic with disjunction and negation) are for example presented in [39], [89]. The present algorithm is an adaptation to of the algorithm presented in [89]. The algorithm consists of a number of simplification rules. Rules are applied until no rules can be applied anymore. In that case the constraint is said to be in normal form or normal. For normal constraints it is trivial to check whether the constraint is satisfiable (clash-free). A constraint is solved iff it is normal and clash-free.

The simplification algorithm is presented here in two steps. Firstly, I show how to remove all complex paths (paths containing more than one label), by the introduction of some new variables. The resulting constraint, which is called basic, is shown to be satisfiable iff the original constraint was. The next step then rewrites constraints without complex path expressions into normal form.

A basic constraint is a constraint in which each equation has one of the following forms:

An arbitrarily constraint can be mapped into a basic constraint by the introduction of new variables. is satisfiable iff is. We will say that two assignments agree on a set of variables iff they assign the same elements in the domain to these variables.

Definition 6 (V-equivalence)   Two constraints , are V-equivalent, for V a set of variables, iff:
1.
If , then there exist such that and agree on V.
2.
If , then there exist such that and agree on V.

If constraints and are V-equivalent then is satisfiable iff is satisfiable (this follows immediately from the definition).

In the following, C is a constraint, [X| s]C is the constraint obtained from C by replacing each occurrence of variable X with s.

#### Proposition (Computation of V-equivalent basic constraint).

For every constraint one can compute a V-equivalent basic constraint.

#### Proof.

The following algorithm computes for a given constraint a basic constraint . We will show that thus obtained is V-equivalent with .

Apply any of the rules, until the rules are not applicable:

1.

2.

3.

It is easy to verify that if none of the rules is applicable, the resulting constraint is indeed a basic constraint. Also observe that the algorithm terminates because each of the steps replaces an atomic constraint with two new atomic constraints, one of which already is basic, and the other has a shorter path than the previous constraint.

Each step of the algorithm preserves satisfiability, hence a sequence of steps preserves satisfiability as well. Step 1 of the algorithm changes a constraint into . It is straightforward to show that is V-equivalent with (and hence is satisfiable iff is). Assume that , then let be the assignment which is exactly like , except that the newly introduced Xi is mapped to the feature graph (s)l1...ln-1. Clearly, . The other way around is similar. The same reasoning applies for the steps 2 and 3.

Example 7   Consider the following constraint

This constraint is simplified, according to the rules above, in the following three steps, using respectively rule 1, 2 and 3:

Given a basic constraint, the following simplification rules rewrite this constraint into its equivalent normal form.

Definition 8 (Normal form)   Applying any of the following simplification rules to a basic constraint until no rule is applicable, results in a normal form constraint:

1.

2.

3.

4.

To show that a normal form of a constraint C computed by this algorithm is equivalent to C observe that each of the simplification rules preserves equivalence. In the first rule the variable X is isolated'; in the rest of the constraint the variable is replaced by the constant or variable it is equated with. Clearly in this case and are equivalent, because, by definition (X) = (s), hence C = C[X| s]. As for the third rule, note that the solutions of {Xl s,Xl t} are those assignments such that the descriptors Xl, s, t have the same denotation. The same is the case for the solutions of {Xl s, s t}. Hence the third rule preserves equivalence. The second rule and the fourth rule clearly preserve equivalence.

Furthermore, the simplification algorithm always terminates, because clearly there cannot be an infinite sequence of simplification rules starting from any basic constraint . To see this, note that there is only a finite number of variables in a given constraint. The first rule isolates' such a variable, hence this rule can be applied at most once for each variable; furthermore none of the other rules introduce new variables. The second rule can only be applied a finite number of cases because the number of constants is also finite, and not increased by any of the other rules. The third rule can only be applied a finite number of times because it reduces the length of the paths in a constraint; none of the other rules increase this length. The final rule can only be applied a finite number of times because it reduces the number of equations in a constraint, and none of the other rules increases this number.

The simplification algorithm is very similar to the unification' algorithms based on the simplification rules for a system of term equations as presented for example in [5]. Note though that this system does not contain an occur check' as I did not exclude cyclic structures.

A normal constraint is clash-free if it does not contain any of the following constraints:

• cl d (constant/compound clash)
• c1 c2 (constant clash)
A normal and clash-free constraint is called solved. A solved constraint consists exclusively of atomic constraints of the form:
• Xl s
• X s
Furthermore, if an equation is of the second type then the variable X occurs only once (the variable is said to be isolated). For this reason it is very easy to see that solved constraints are satisfiable, because they can be interpreted as a recipe to define an appropriate assignment. Such an assignment is called the principal solution. For a solved constraint, (x) = defFG[x,] is a principal solution of . The function FG is defined as follows:

where is the transitive and reflexive closure of which is a binary relation on the variables occurring in :

Example 9   Consider the following constraint , which was the result of example 7 of the computation of basic constraints:

This constraint can then be rewritten into normal form, for example in the following steps, using the rules 3, 1, 3 and 1 of definition 8. The application of the rules 2 and 4 are performed implicitly in the example (for simplicity).

The principal solution of this constraint is defined as follows:

The first two assignments (X0) and (X1) can be illustrated as:

### Notation.

Once constraints get more complicated they tend to be difficult to read. For that reason I will often use a special representation, called matrix notation, to represent the interpretation of a (satisfiable) constraint on some variable.

The matrix representation of a constraint on a variable is best introduced using an example. For the result of example 9, the matrix representation for the constraints on variable X0 looks as follows:

The names of variables only matter in case they are referred to more than once. In the foregoing example, I therefore omit the variables and instead write:

As another example of this notation, consider the following constraint:

The matrix representation of the constraints on X0 looks as follows:

Usually an empty feature structure will not be shown explicitly, but instead only the corresponding variable will be shown, i.e. instead of

I write

Furthermore, I use a special notation for parts of such matrices that are used to encode lists and difference lists. If no confusion arises I use the HPSG [69] convention of writing a list within angled brackets, where the comma separates elements of the list, and the vertical bar may be used to separate the head from the tail of the list. In path equations the elements of such lists are referred to with attributes f and r (for first and rest), the empty list is represented with the constant . In case of difference lists I moreover write the out' part of the difference list right after the in'-part, separated by -'. The attributes in and out are used in path equations to refer to these parts. Moreover, in case of a difference list where the tail of the in' part is reentrant with the out' part, I simply write the in' list within  ''. As an example I write letters from mexico get lost'' for letters, from, mexico, get, lost|X1 - X1.

As a further abbreviation I sometimes use the functor-argument notation for semantic structures, as introduced in section 1.2.3. Using these abbreviations, the foregoing constraint is written as:

Next: Adding definite relations Up: The constraint language: Previous: Solutions of constraints
Noord G.J.M. van
1998-09-30