Computing Minimal EL -uniﬁers is Hard

Uniﬁcation has been investigated both in modal logics and in description logics, albeit with diﬀerent motivations. In description logics, uniﬁcation can be used to detect redundancies in ontologies. In this context, it is not suﬃcient to decide uniﬁability, one must also compute appropriate uniﬁers and present them to the user. For the description logic EL , which is used to deﬁne several large biomedical ontologies, deciding uniﬁability is an NP-complete problem. It is known that every solvable EL -uniﬁcation problem has a minimal uniﬁer , and that every minimal uniﬁer is a local uniﬁer . Existing uniﬁcation algorithms for EL compute all minimal uniﬁers, but additionally (all or some) non-minimal local uniﬁers. Computing only the minimal uniﬁers would be better since there are considerably less minimal uniﬁers than local ones, and their size is usually also quite small. In this paper we investigate the question whether the known algorithms for EL - uniﬁcation can be modiﬁed such that they compute exactly the minimal uniﬁers without changing the complexity and the basic nature of the algorithms. Basically, the answer we give to this question is negative.


Introduction
It is well-known that there is a close connection between modal logics (MLs) and description logics (DLs).In fact, many DLs are syntactic variants of classical MLs.Unification has been introduced in both areas [5], with the same formal meaning, but with different applications in mind.In ML, unification [15,16,21] was mainly investigated in the context of the admissibility problem for inference rules [20,17,12].Unification is simpler than the admissibility problem in the sense that it can easily be reduced to it, but in some cases (e.g., if the unification problem is effectively finitary, i.e., finite complete sets of unifiers can be computed) there is also a reduction in the other direction (see, e.g., [18]).An important open problem in the area is the question whether unification in the basic modal logic K, which corresponds to the DL ALC, is decidable.It is only know that relatively minor extensions of K have an undecidable unification problem [22].
EL.In [7], we were able to show that unification in EL is of considerably lower complexity than unification in FL 0 : the decision problem for EL is NPcomplete.The main steps in the proof of this statement given in [7] were the following.First, the inverse subsumption order on concept descriptions was used to define an order on substitutions: σ θ iff σ(X) θ(X) holds for all variables X, and it was shown that this order is well-founded.As an immediate consequence of the well-foundedness of , every solvable unification problem has a minimal unifier.Second, it was shown that every minimal unifier is a local substitution, where local substitutions are built from a polynomial number of so-called atoms determined by the unification problem.Finally, a brute-force "guess and then test" NP-algorithm was described, which guesses a local substitution and then checks (in polynomial time) whether it is a unifier.
An obvious disadvantage of this brute-force algorithm is that it blindly guesses a local substitution and only afterwards checks whether the guessed substitution is a unifier.Thus, in general many substitutions will be generated that only in the subsequent check turn out not to be unifiers.In contrast, the SAT reduction presented in [8] is such that only unifiers are generated.To be more precise, it was shown in [8] how a given unification problem Γ can be translated in polynomial time into a propositional formula φ Γ such that the satisfying valuations of φ Γ correspond to the local unifiers of Γ.The translation into SAT allows us to employ existing highly optimized state-of-the-art SAT solvers for implementing the unification algorithm.While this yields a quite efficient decision procedure for unifiability, the fact that all local unifiers, rather than only minimal ones, are generated turned out to be problematic if one wants to show the unifiers to the user.In fact, even very small unification problems can have hundreds of local unifiers, many of which do not make sense in the application.The set of all minimal unifiers is a subset of the set of all local unifiers, whose cardinality is usually much smaller. 3Another advantage of minimal unifiers is that they are usually of smaller size (where the size of a substitution is the sum of the sizes of the concept terms substituted for the variables), and are thus easier to read and comprehend.
In [9] we describe a goal-oriented unification algorithm for EL, in which nondeterministic decisions are only made if they are triggered by "unsolved parts" of the unification problem.By construction, this algorithm can only compute local unifiers, and it is shown in [9] that all minimal ones are among the ones computed by it.Though in our initial tests the number of unifiers computed by the goal-oriented algorithm turned out to be usually much smaller than of the ones computed by the SAT reduction, the goal-oriented algorithm is not guaranteed to compute only minimal unifiers.

Name
Syntax Semantics concept name Following the assumption that it is desirable to compute only minimal unifiers rather than all (or some additional non-minimal) local ones, this paper asks the question whether the NP decision procedures for unification in EL presented in [8] and [9] can be appropriately modified such that the successful runs of the procedure produce exactly the minimal unifiers of the given ELunification problem.We show in Section 4 that the answer to this question is negative if we use a slightly more general definition of the order , where the subsumption test σ(X) θ(X) can be restricted to a subset of all variables.This restriction is justified by the fact that the user may be interested only in the substitution-images of some of the variables.In fact, the algorithms in [8] and [9] first flatten the input problem, which introduces auxiliary variables.These auxiliary variables are internal to the unification procedure and are not shown to the user.
All three EL-unification algorithms mentioned above (the brute-force algorithm, the goal-oriented algorithm, and the one based on a reduction to SAT) actually do not directly compute local unifiers, but so-called acyclic assignments, which can be seen as compact representations of local unifiers.In Section 3 we ask what properties of the acyclic assignment make the induced unifiers small.To this purpose, we introduce a natural order on acyclic assignments and compare it with the order on the induced unifiers.

Unification in EL
Starting with a finite set N C of concept names and a finite set N R of role names, EL-concept descriptions are built using the concept constructors top-concept ( ), conjunction (C D), and existential restriction (∃r.C for every r ∈ N R ).
An interpretation I = (∆ I , • I ) consists of a nonempty domain ∆ I and an interpretation function • I that assigns binary relations on ∆ I to role names and subsets of ∆ I to concept descriptions, as shown in the semantics column of Table 1.
The concept description C is subsumed by the concept description D (written C D) iff C I ⊆ D I holds for all interpretations I.We say that C is equivalent to D (written C ≡ D) iff C D and D C, i.e., iff C I = D I holds for all interpretations I.
We will also need the notion of an acyclic TBox T , which is a finite set of concept definitions of the form A ≡ C, where A is a concept name and C a concept description, that is unambiguous and acyclic (see [4] for details).The interpretation I is a model of T iff it satisfies all concept definitions in T , i.When defining unification in EL, we assume that the set of concept names is partitioned into a set N v of concept variables (which may be replaced by substitutions) and a set N c of concept constants (which must not be replaced by substitutions).A substitution σ is a mapping from N v into the set of all EL-concept descriptions.This mapping is extended to concept descriptions in the usual way, i.e., by replacing all occurrences of variables in the description by their σ-images.Unification tries to make concept descriptions equivalent by applying a substitution.
In this case, Γ is called solvable or unifiable.
We will sometimes use the subsumption C ? D as abbreviation for the equivalence C D ≡ ?C. Obviously, the substitution σ solves this subsumption iff σ(C) σ(D).

Flattening
As mentioned before, the algorithms in [8] and [9] first flatten the unification problem.An atom is called flat if it is a concept name or an existential restriction of the form ∃r.A for a concept name A. The unification problem Γ is called flat if it contains only flat subsumptions of the form where n ≥ 0 and C 1 , . . ., C n , D are flat atoms. 4et Γ be a unification problem.By introducing auxiliary variables, Γ can be transformed in polynomial time into a flat unification problem Γ such that the unifiability status remains unchanged, i.e., Γ has a unifier iff Γ has a unifier.More precisely, it can be shown that, restricted to the variables of Γ, every unifier of Γ is also a unifier of Γ. Conversely, every unifier of Γ can be extended to a unifier of Γ by defining appropriate images for the auxiliary variables.Thus, we may assume without loss of generality that our input ELunification problems are flat.

Local unifiers
Let Γ be a flat unification problem.The atoms of Γ are the atoms of all the concept descriptions occurring in Γ.We define At := {C | C is an atom of Γ} and Every assignment S of subsets S X of At nv to the variables X in N v induces the following relation > S on N v : > S is the transitive closure of We call the assignment S acyclic if > S is irreflexive (and thus a strict partial order).Any acyclic assignment S induces a unique substitution σ S , which can be defined by induction along > S : We call a substitution σ local if it is of this form, i.e., if there is an acyclic assignment S such that σ = σ S .If the unifier σ of Γ is a local substitution, then we call it a local unifier of Γ.The theorem shows that, in order to decide unifiability of Γ, it is sufficient to guess an acyclic assignment and then check whether the induced substitution is a unifier.The remaining problem is that the induced unifier may be of exponential size.However, in order to check whether a given acyclic assignment S induces a unifier of Γ, one does not need to construct the unifier σ S explicitly.In fact, S can be turned into an acyclic TBox and it is easy to see that the following holds for arbitrary concept descriptions E, F : σ S (E) σ S (F ) iff E T S F .Since subsumption in EL w.r.t.acyclic TBoxes can be decided in polynomial time [1], this obviously yields a way for checking, in polynomial time, whether σ S solves all equations of Γ.
The original proof of Theorem 2.2 in [7] was based on the notion of a minimal unifier, though subsequent simpler proofs [8,3] no longer need this notion.
For readers familiar with unification theory [11], it should be pointed out that the order we use to define minimality of local unifiers (see below) is not the instantiation pre-order on substitutions.In fact, it is an easy consequence of the definition of local substitutions that they are ground (i.e., the images of variables under these substitutions do not contain variables), and thus there is no further instantiation possible.

Minimal unifiers
Given a set of variables X ⊆ N v , we define σ X θ iff σ(X) θ(X) holds for all variables X ∈ X , σ X θ iff σ X θ and θ X σ.
We say that the unifier σ of Γ is X -minimal iff there is no unifier θ of Γ such that σ X θ.We say that two substitutions σ, θ are equivalent (σ ≡ θ) iff σ(X) ≡ θ(X) holds for all X ∈ N v .Note that we have σ ≡ θ iff σ Nv θ and θ Nv σ. (i) If Γ is solvable, then it also has an N v -minimal unifier.
(ii) Every N v -minimal unifier is equivalent to a local unifier.
The first part of the lemma is an immediate consequence of the fact [9] that Nv is well-founded, whereas the proof of the second part in [9] is rather long and intricate.Theorem 2.2 is an immediate consequence of Lemma 2.3.

Minimal unifiers versus minimal assignments
As mentioned before, we are interested in computing only the N v -minimal unifiers rather than all local unifiers of a given unification problem.All three EL-unification algorithms mentioned in the introduction (the brute-force algorithm, the goal-oriented algorithm, and the one based on a reduction to SAT) actually compute acyclic assignments rather than directly local unifiers.Thus, one can ask what properties of the assignment make unifiers small w.r.t.
Nv .To answer this question, we define an order similar to Nv on acyclic assignments.Let S, T be acyclic assignments of subsets S X , T X of At nv to the variables X in N v .We define As usual, we write S > T if S ≥ T and S = T .First, we show that smaller assignments indeed yield smaller unifiers.
Assume that σ S (Y ) σ T (Y ) holds for all Y such that X > S Y .Since > S ⊇ > T , this implies that σ S (Z) σ T (Z) holds for all Z such that X > T Z. Since the concept constructors of EL are monotonic w.r.t.subsumption and S X ⊇ T X , this implies As an easy consequence of this lemma we obtain that minimal unifiers are induced by minimal acyclic assignments.Theorem 3.2 Let Γ be a flat unification problem.Then the set {σ S | σ S is a unifier of Γ and there is no acyclic assignment T for Γ such that σ T is a unifier of Γ and S > T } contains all N v -minimal unifiers of Γ up to equivalence.
Proof.Let θ be an N v -minimal unifier of Γ.By Lemma 2.3, θ is (equivalent to) a local unifier, and thus there exists an acyclic assignment T such that θ ≡ σ T .Let S be minimal among all assignments that induce a substitution equivalent to θ, i.e., θ ≡ σ S and there is no acyclic assignment T for Γ such that σ T ≡ θ and S > T .We claim that this implies that there is no acyclic assignment T for Γ such that σ T is a unifier of Γ and S > T .Assume that such an assignment T exists.Then Lemma 3.1 implies that σ S Nv σ T .Minimality of S among all assignments that induce a unifier equivalent to θ implies that σ S ≡ σ T , and thus σ S Nv σ T .This contradicts the assumption that θ ≡ σ S is N v -minimal.2Thus, if one wants to generate all minimal unifiers, it is enough to generate only the minimal acyclic assignments yielding unifiers.If the converse of Lemma 3.1 were true, we could also show that these assignments yield only minimal unifiers.Unfortunately, the converse of Lemma 3.1 is not true, as demonstrated by the following example.Then σ S (Y ) = A = σ T (Y ), σ S (Z) = A = σ T (Z), and σ S (X) = ∃r.A = σ T (X), i.e., σ S = σ T and this substitution is a unifier of Γ.In particular, this implies σ S Nv σ T .However, S ≥ T obviously does not hold since S X ⊇ T X .
It is easy to see that S and T are minimal among the acyclic assignments generating unifiers of Γ.This shows that the same N v -minimal unifier can be generated by different minimal assignments.
We can also use a unifier σ of Γ to define an acyclic assignment S σ : As shown in [3], this assignment is indeed acyclic.
Surprisingly, the analog of Lemma 3.1 does not hold: going from unifiers to the induced acyclic assignments is neither monotone nor antitone.Example 3.4 We introduce an EL-unification problem that demonstrates that θ Nv σ implies neither S θ ≥ S σ nor S σ ≥ S θ , even if σ and θ are equivalent to local unifiers of the given unification problem Γ.For this purpose, consider the unification problem Γ := {A ?X, ∃r.X ?Y, Y ?∃r.X }.
The following substitutions are obviously unifiers of Γ: and they satisfy θ Nv σ.
The non-variable atoms of Γ are A, ∃r.X, and ∃r.X , and thus Finally, note that (up to equivalence) σ and θ are local since they are the substitutions respectively induced by S σ and S θ , i.e., σ ≡ σ S σ and θ ≡ σ S θ .This example actually strengthens Example 3.3 in the sense that it shows that the converse of Lemma 3.1 is not even true if we assume σ S Nv σ T rather than σ S Nv σ T .Just take S = S θ and T = S σ .Indeed, we have σ S θ Nv σ S σ , but S θ ≥ S σ .
A similar example can be used to show that the set {σ S | σ S is a unifier of Γ and there is no acyclic assignment T for Γ such that σ T is a unifier of Γ and S > T } may in general contain unifiers that are not N v -minimal.
The non-variable atoms of Γ are A, ∃r.X, and ∃r.A.The acyclic assignments We have σ T Nv σ S , and thus σ T is not N v -minimal.However, it is easy to see that there is no acyclic assignment U < T such that σ U is a unifier of Γ.
In fact, assume that U < T .If U Y = ∅, then σ U (Y ) = , and thus σ U does not solve the equivalence Y ≡ ?∃r.X independent of whether U X = {A} or U X = ∅.Consequently, we must have U Y = {∃r.A} = T Y , and thus σ U (Y ) = ∃r.A.However, then U < T implies U X = ∅, i.e., σ U (X) = .But then σ U again does not solve the equivalence Y ≡ ?∃r.X.
This example shows that, even if we only generate minimal acyclic assignments that induce unifiers, 5 this may yield additional local unifiers that are not N v -minimal.
We finish this section by investigating what happens if we compose the two transformations S → σ S and σ → S σ .Lemma 3.6 Let S be an assignment and σ a substitution.Then S σ S ≥ S and σ Nv σ S σ .If σ is a local substitution, then we even have σ ≡ σ S σ .
Proof.If D ∈ S X , then σ S (D) is a top-level conjunct of σ S (X), and thus σ S (X) σ S (D), which shows D ∈ S σ S X .We show the other inequality by induction along > S σ .If X is minimal, then no variables occur in S σ X , and thus σ(D) = D for all D ∈ S σ X .This yields X contains only variables that are smaller than X w.r.t.> S σ and the concept constructors of EL are monotone w.r.t.subsumption, the induction assumption yields Finally, since all D ∈ S σ X satisfy σ(X) σ(D), we have Since the subsumption relation is transitive, this completes the proof that σ Nv σ S σ .Finally, assume that σ is local, i.e., there is an acyclic assignment T such that σ = σ T .We must show σ S σ Nv σ.Because of the first statement of the lemma, we have S σ T ≥ T , and thus σ S σ = σ S σ T Nv σ T = σ by Lemma 3.1.24 The complexity of computing exactly the minimal unifiers exactly the minimal unifiers in this sense, i.e., where the successful runs yield a set of acyclic assignments that induces exactly the set of minimal unifiers.For the general case of X -minimality for an arbitrary subset X of N v , we give a negative answer to this question.
To this purpose, we consider the following decision problem, which we call the minimal unifier containment problem: , and a concept variable X ∈ X .
Question: Is there an X -minimal unifier σ of Γ such that σ(X) A?
2 is easy to see.Guess an acyclic assignment S of Γ and check (in polynomial time, using T S ) whether it induces a unifier σ S of Γ that satisfies σ S (X) A. If this check succeeds, then use an NP-oracle to check whether σ S is X -minimal.In fact, an NP procedure for testing whether σ S is not X -minimal guesses an acyclic assignment T , and then uses subsumption tests w.r.t.T S to check whether σ S X σ T .
To show Σ p 2 -hardness, we use a reduction from the minimal model deduction problem: Given: A propositional formula φ in conjunctive normal form and a propositional variable x.
Question: Is there a minimal model M of φ such that M |= x?
Here, minimality of propositional models is defined w.r.t. the following order on propositional valuations: V ≥ V iff for all propositional variables x, V |= x implies V |= x.Σ p 2 -completeness of the minimal model deduction problem is an immediate consequence of Lemma 3.1 in [14].
In order to reduce the minimal model deduction problem (as specified above) to the minimal unifier containment problem, we adapt the proof of NPhardness of EL-matching given in [6].Let φ = φ 1 ∧ • • • ∧ φ m be a propositional formula in conjunctive normal form and let {x 1 , . . ., x n } be the propositional variables of this problem.Assume without loss of generality that x = x 1 .
For the propositional variables, we introduce the concept variables {X 1 , . . ., X n , X 1 , . . ., X n }, which encode x i and ¬x i , respectively.In addition, we introduce concept variables {Y 1 , . . ., Y n }, which are used for minimization, i.e., Furthermore, we need concept constants A and B (encoding the truth values) and a role name r.The unification problem Γ φ,x constructed from the given minimal model deduction problem consists of the equations introduced below.First, we specify equations that ensure that A, B encode the truth values.For all i, 1 ≤ i ≤ n, we add the equation ∃r.X i ∃r.X i ≡ ?∃r.A ∃r.B.
Obviously, any solution of this equation replaces • either X i by a concept description equivalent to A and X i by a concept description equivalent to B (corresponding to x i = true), • or X i by a concept description equivalent to B and X i by a concept description equivalent to A (corresponding to x i = false).
In order to encode φ, we introduce an equation for every conjunct φ j of φ, where we view φ j as the set of its disjuncts: The above equation ensures that, among all the concept variables occurring on the left-hand side, at least one must be replaced by a concept description equivalent to A. This corresponds to the fact that, in the conjunct φ j , there must be at least one literal that evaluates to true.Note that we need the concept name B on the left-hand side to cover the case where all the variables occurring in it are substituted with A.
It is easy to see that (up to equivalence) the unifiers of the equations introduced until now (which do not contain the variables in X ) correspond exactly to the propositional models of φ.Given a propositional valuation V of φ, we define the corresponding substitution σ V as follows: According to our observations above, V is a model of φ iff σ V is a unifier of the equations introduced above.In addition, any unifier of these equations is equivalent to a unifier of the form σ M for a model M of φ.
It remains to express minimal models as X -minimal unifiers.For this purpose, we add the equations for all i, 1 ≤ i ≤ n.This completes the description of the unification problem Γ φ,x .The effect of equation ( 3) is the following: • If X i is substituted with a concept description equivalent to A (corresponding to x i being evaluated to true), then X i is substituted with a concept description equivalent to B, and thus Y i must be substituted by a concept description equivalent to A or A B. In an X -minimal unifier, it is thus substituted with a concept description equivalent to A.
• If X i is substituted with a concept description equivalent to B (corresponding to x i being evaluated to false), then X i is substituted with a concept description equivalent to A, and thus Y i can be substituted by a concept which implies M |= x 1 .
To sum up, we have described a polynomial-time reduction of the minimal model deduction problem to the minimal unifier containment problem.Since the former problem is known to be Σ p 2 -hard, this shows Σ p 2 -hardness of the latter problem. 2 As an immediate consequence of this theorem, we can show that there cannot be an NP-algorithm that generates exactly the minimal unifiers of the given EL-unification problem.
Corollary 4.2 Unless the polynomial hierarchy collapses, there cannot exist an NP-decision procedure for unifiability in EL that, given a flat EL-unification problem Γ and a subset X of the concept variables occurring in Γ, not only decides unifiability of Γ, but additionally computes exactly the X -minimal unifiers of Γ in the following sense: • each successful run of the nondeterministic procedure generates an acyclic assignment S such that the induced local unifier σ S is an X -minimal unifier of Γ, and • for every X -minimal unifier θ of Γ there is a successful run of the nondeterministic procedure that generates an acyclic assignment S such that σ S ≡ θ.
Proof.Assume that there exists an NP-decision procedure for unifiability in EL that computes exactly the X -minimal unifiers of Γ in the sense introduced above.Then we could decide the minimal unifier containment problem within NP.In fact, the NP-procedure for deciding this problem is obtained by using the one that computes exactly the X -minimal unifiers, but for every successful path of that procedure checks whether the generated acyclic assignment S satisfies X T S A. This test can be performed in polynomial time, and it yields the same result as testing whether σ S (X) A. Since the acyclic assignments generated by the original NP-procedure correspond exactly to the X -minimal unifiers, there is a successful path of the extended NP-procedure iff there is an Xminimal unifier θ satisfying θ(X) A. Thus, this extended procedure decides the minimal unifier containment problem within NP.Obviously, membership of a Σ p 2 -complete problem in NP would imply Σ p 2 = NP.It is well-known that this would imply that the whole polynomial hierarchy collapses.2

Conclusion
The results of this paper indicate that it is not easy to compute all and only the minimal unifiers of a given EL-unification problem.On the one hand, while it is sufficient to compute only minimal acyclic assignment to obtain all minimal unifiers, this restriction does not guarantee that only minimal unifiers are generated.On the other hand, NP-procedures cannot generate exactly the X -minimal unifiers for subsets X of the set of all variables.It is an open problem whether this last fact is also true if X is required to be the set of all variables.
e., A I = C I holds for all A ≡ C in T .The concept description C is subsumed by the concept description D w.r.t. the acyclic TBox T (written C T D) iff C I ⊆ D I holds for all models I of T .An EL-concept description is an atom if it is an existential restriction or a concept name.The atoms of an EL-concept description C are the subdescriptions of C that are atoms, and the top-level atoms of C are the atoms occurring in the top-level conjunction of C. Obviously, any EL-concept description is the conjunction of its top-level atoms, where the empty conjunction corresponds to the top-concept .

Theorem 2 . 2 (
[7]) Let Γ be a flat unification problem.If Γ has a unifier, then it also has a local unifier.

Table 1
Syntax and semantics of EL.