• Keine Ergebnisse gefunden

5 PSpace-hardness of EL −> -unification

In this section, we reduce the intersection emptiness problem for deterministic finite automata (DFA) to a unification problem in EL−>. These DFA are a special case of nondeterministic finite automata, which in turn are special AFA.

An alternating finite automaton (AFA) A = (Q, Q,Σ, q0, δ, F) is an ε-AFA with a restricted transition function δ : Q ×Σ → P(Q) that does not allow ε-transitions. The semantics of these automata is the same as for ε-AFA, ex-cept that the relation `A is restricted to non-ε-transitions. The automaton is called nondeterministic finite automaton (NFA) if Q = ∅ and is then written as (Q,Σ, q0, δ, F). It is called deterministic finite automaton (DFA) if it is an NFA and for each q ∈ Q and α ∈ Σ, the set δ(q, α) has the cardinality 0 or 1. The transition function is then equivalently expressed as the partial function δ0 :Q×Σ→Qwhere δ0(q, α) =q0 iff δ(q, α) = {q0}. This definition implies that any DFA has at most one run on any given word.

First, we define a translation from a given DFA A = (Q,Σ, q0, δ, F) to a set of subsumptions ΓA. In the following, we only consider automata that accept a nonempty language. For such DFAs we can assume without loss of generality that there is no state q ∈ Q that cannot be reached from q0 or from which F cannot be reached. In fact, such states can be removed from Awithout changing the accepted language.

For every state q ∈ Q, we introduce a variable Xq. There is only one constant, A, and we define NR:= Σ. The set ΓA is defined as follows:

ΓA :={Lq v? Xq|q ∈Q\F} ∪ {AuLq v? Xq |q∈F}, where Lq := l

α∈Σ δ(q,α) is defined

∃α.Xδ(q,α).

Note that the left-hand sides of the subsumptions in ΓA are indeedEL−>-concept terms, i.e., the conjunctions on the left-hand sides are nonempty. In fact, every

state q∈Qis either a final state or a final state is reachable by a nonempty path from q. In the first case, A occurs in the conjunction, and in the second, there must be an α∈Σ such that δ(q, α) is defined, in which case ∃α.Xδ(q,α) occurs in the conjunction.

Lemma 19. Let q ∈ Q, w ∈ Σ and γ be a ground EL−>-unifier of ΓA with γ(Xq)v ∃w.A. Then w∈L(Aq), where Aq := (Q,Σ, q, δ, F) is obtained from A by making q the initial state.

Proof. We prove this by induction on the length ofw. If|w|= 0, thenγ(Xq)vA.

Thus, A must be a top-level conjunct of γ(Xq). Since γ is a unifier of ΓA, this can only be the case if q ∈F. Thus, w=ε is accepted by Aq.

Let now w=α0w0 with α0 ∈Σ,w0 ∈Σ. Since γ is a unifier of ΓA, l

α∈Σ δ(q,α) is defined

∃α.γ(Xδ(q,α))v ∃α0w0.A .

Thus, we must have γ(Xδ(q,α0)) v ∃w0.A by Lemma 1. By induction, we know that w0 is accepted by Aδ(q,α0). Thus, w=α0w0 is accepted by Aq.

Together with Lemma 3, this lemma implies that, for every ground EL−>-unifier γ of ΓA, the language {w ∈ Σ | ∃w.A ∈ Part(γ(Xq0))} is contained in L(A).

Conversely, we will show that for every word w accepted by A we can construct a unifier γw with ∃w.A∈Part(γw(Xq0)).

For the construction of γw, we consider every q∈Q and try to find a word uq of minimal length that is accepted by Aq. Such a word always exists since we have assumed that we can reach F from every state. Taking arbitrary such words is not sufficient, however. They need to be related in the following sense.

Lemma 20. There exists a mapping from the states q∈Q to words uq ∈L(Aq) such that that either q ∈ F and uq = ε or there is a symbol α ∈ Σ such that δ(q, α) is defined and uq =αuδ(q,α).

Proof. We construct the words uq using induction on the lengthn of a shortest word accepted by Aq.

If n= 0, then q must be a final state. In this case, we setuq :=ε.

Now, let q be a state such that a shortest word wq accepted by Aq has length n > 0. Then wq =αw0 for α ∈ Σ and w0 ∈ Σ and the transition δ(q, α) = q0 is defined. The length of a shortest word accepted by Aq0 must be smaller thann, since w0 is accepted by Aq0. By induction, uq0 ∈L(Aq0) has already been defined and we have αuq0 ∈L(Aq). Since αuq0 cannot be shorter thanwq =αw0, it must also be of length n. We now define uq:=αuq0.

We can now proceed with the definition of γw for a wordw∈Σ that is accepted byA. The unique successful run ofAonw=w1. . . wnyields a sequence of states q0, q1, . . . , qn with qn ∈ F and δ(qi, wi+1) =qi+1 for every i∈ {0, . . . , n−1}. We define the substitution γw as follows:

γw(Xq) :=∃uq.Au l

i∈Iq

∃wi+1. . . wn.A ,

where Iq :={i ∈ {0, . . . , n−1} | qi =q}. For every q ∈ Q, we include at least the conjunct ∃uq.A inγw(Xq) and thus, γw is in fact an EL−>-substitution.

Lemma 21. If w ∈ L(A), then γw is an EL−>-unifier of ΓA and γw(Xq0) v

∃w.A.

Proof. Let the unique successful run of A on w = w1. . . wn be given by the sequence q0q1. . . qn of states with qn ∈ F and δ(qi, wi+1) = qi+1 for every i ∈ {0, . . . , n−1}, and let γw be defined as above.

We have to show thatγw satisfies the subsumption constraint introduced for every state q ∈Q, i.e.,

Fqu l

α∈Σ δ(q,α) is defined

∃α.γw(Xδ(q,α))vγw(Xq) .

To do this, we consider every top-level atom ofγw(Xq) and show that it subsumes the left-hand side of the above subsumption.

• Consider the conjunct ∃uq.A. If uq = ε, then q ∈ F and Fq = A. In this case, the subsumption is satisfied. Otherwise, by construction there is a transition δ(q, α) = q0 with uq = αuq0. Since ∃u0q.A is a top-level conjunct of γw(Xq0), we have γ(Xq0)v ∃uq0.A and thus, ∃α.γw(Xq0)v ∃uq.A.

• Let i∈ Iq, i.e., qi =q, and consider the conjunct ∃wi+1. . . wn.A. Since we have δ(qi, wi+1) = qi+1 and ∃wi+2. . . wn.A is a conjunct of γw(Xqi+1),3 we know ∃wi+1w(Xqi+1)v ∃wi+1. . . wn.A.

This shows that γw is a ground EL−>-unifier of ΓA. Furthermore, since 0 ∈ Iq0, the particle ∃w1. . . wn.A = ∃w.A is a top-level conjunct of γw(Xq0), i.e., γw(Xq0)v ∃w.A.

The intersection emptiness problem considers finitely many DFAs A1, . . . ,Ak, and asks whether L(A1)∩. . .∩L(Ak)6=∅. Since this problem is trivially solvable in polynomial time in case L(Ai) = ∅ for some i,1≤ i≤k, we can assume that the languages L(Ai) are all nonempty. Thus, we can also assume without loss of

3Ifi=n1, then∃wi+2. . . wn.A=A.

generality that the automata Ai = (Qi,Σ, q0,i, δi, Fi) have pairwise disjoint sets of states Qi and are reduced in the sense introduced above, i.e., there is no state that cannot be reached from the initial state or from which no final state can be reached.

The flat EL−>-unification problem Γ is now defined as follows:

Γ := [

i∈{1,...,k}

ΓAi∪ {Xq0,i v?Y} ,

where Y is a new variable not contained in ΓAi for i= 1, . . . , k.

Lemma 22. Γ is unifiable in EL−> iff L(A1)∩. . .∩L(Ak)6=∅.

Proof. If Γ is unifiable in EL−>, then it has a ground EL−>-unifier γ and there must be a particle∃w.Awithw∈Σ andγ(Y)v ∃w.A. Sinceγ(Xq0,i)vγ(Y)v

∃w.A, Lemma 19 yieldsw∈L(Ai,q0,i) = L(Ai) for eachi∈ {1, . . . , k}. Thus, the intersection of the languages L(Ai) is nonempty.

Conversely, let w∈Σ be a word with w∈L(A1)∩. . .∩L(Ak). By Lemma 21, we have for each of the unification problems ΓAi an EL−>-unifier γw,i such that γw,i(Xq0,i) v ∃w.A. Since the automata have disjoint state sets, the unification problems ΓAi do not share variables. Thus, we can combine the unifiers γw,i into

an EL−>-substitution γ by defining γ(Y) := ∃w.A and γ(Xq) := γw,i(Xq) for

each i ∈ {1, . . . , k} and q ∈ Qi. Obviously, this is an EL−>-unifier of Γ since it satisfies the additional subsumptions Xq0,i v? Y.

Since the intersection emptiness problem for DFAs is PSpace-hard [14, 11], this lemma immediately yields our final theorem:

Theorem 23. The problem of deciding unifiability in EL−> is PSpace-hard.

6 Conclusion

Unification in EL was introduced in [4] as an inference service that can sup-port the detection of redundancies in large biomedical ontologies, which are fre-quently written in this DL. Motivated by the fact that the large medical ontology SNOMED CT actually does not use the top concept available in EL, we have in this paper investigated unification inEL−>, which is obtained fromELby remov-ing the top concept. More precisely, SNOMED CT is a so-called acyclic EL−> -TBox,4 rather than a collection of EL−>-concept terms. However, as shown in

4Note that the right-identity rules in SNOMED CT [18] are actually not expressed using complex role inclusion axioms, but through the SEP-triplet encoding [19]. Thus, complex role inclusion axioms are not relevant here.

[6], acyclic TBoxes can be easily handled by a unification algorithm for concept terms.

Surprisingly, it turned out that the complexity of unification inEL−> (PSpace) is considerably higher than of unification in EL (NP). From a theoretical point of view, this result is interesting since it provides us with a natural example where reducing the expressiveness of a given DL (in a rather minor way) results in a drastic increase of the complexity of the unifiability problem. Regarding the complexity of unification in more expressive DLs, not much is known. If we add negation toEL, then we obtain the well-known DLALC, which corresponds to the basic (multi-)modal logicK[17]. Decidability of unification inKis a long-standing open problem. Recently, undecidability of unification in some extensions of K (for example, by the universal modality) was shown in [20]. These undecidability results also imply undecidability of unification in some expressive DLs (e.g., in SHIQ [12]).

Apart from its theoretical interest, the result of this paper also has practical implications. Whereas practically rather efficient unification algorithm for EL can readily be obtained by a translation into SAT [5], it is not so clear how to turn the PSpace algorithm for EL−>-unification introduced in this paper into a practically useful algorithm. One possibility could be to use a SAT modulo theories (SMT) approach [15]. The idea is that the SAT solver is used to generate all possible subsumption mappings for Γ, and that the theory solver tests the system IΓ,τ induced by τ for the existence of a finite, admissible solution. How well this works will mainly depend on whether we can develop such a theory solver that satisfies well all the requirements imposed by the SMT approach.

Another topic for future research is how to actually compute EL−>-unifiers for a unifiable EL−>-unification problem. In principle, our decision procedure is constructive in the sense that, from appropriate successful runs of the ε-AFA A(X, A), one can construct a finite, admissible solution of IΓ,τ, and from this an

EL−>-unifier of Γ. However, this needs to be made more explicit, and we need

to investigate what kind of EL−>-unifiers can be computed this way.

Appendices

A Locality

InEL, we have the interesting property that for every solvable unification problem there exists a local unifier γ, where γ(X) is a conjunction of atoms of the form γ(D) for D ∈ NV(Γ). However, simply extending this notion to EL−>-unifiers does not give a similar result for EL−>.

Example 24. Consider the flatEL-unification problem Γ that contains the three equations

X ≡? Y uA, Y u ∃r.X ≡? ∃r.X, Zu ∃r.X ≡? ∃r.X.

Then the substitutions σ0 := {X 7→ A, Y 7→ >, Z 7→ >} and σ1 := {X 7→

A, Y 7→ >, Z 7→ ∃r.A} are the only local EL-unifiers of Γ. In fact, we have NV(Γ) ={A,∃r.X}, and thus the only possible image forX in a local unifierσ is A (since σ(∃r.X) = ∃r.σ(X) obviously cannot be a conjunct of σ(X)). Since the first equation implies that A=σ(X)vσ(Y), we know thatσ(Y) can only be >

or A. However, the second equation prevents the second possibility. Finally, the third equation ensures that σ(Z) is >or ∃r.A.

Note thatσ0 andσ1 both contain>, and thus are notEL−>-unifiers. This shows that Γ does not have an EL−>-unifier that is local in the sense defined above.

Nevertheless, Γ has EL−>-unifiers. For example, the substitution γ1 := {X 7→

Au ∃r.A, Y 7→ ∃r.A, Z 7→ ∃r.∃r.A}is such a unifier.

In this example, the top-level atoms of γ1(X), γ1(Y), γ1(Z) that are not of the form γ(D) for some D ∈ NV(Γ) are all particles of γ(D) for some D ∈ NV(Γ).

This motivates the following definition.

Definition 25. The EL−>-unifierγ of Γ is a local EL−>-unifier of Γ if, for every variable X, each top-level atom of γ(X) is

• of the form γ(D) for someD∈NV(Γ) or

• a particle of γ(D) for some D∈NV(Γ).

There are always only finitely many localEL-unifiers for a given unification prob-lem [4]. In EL−>, however, it is possible that there exist infinitely many local unifiers, as the next example demonstrates.

Example 26. Consider the unification problem Γ from Example 24 and the following EL−>-substitutions γn:

γn(X) :=Au ∃r.Au · · · u ∃rn.A γn(Y) :=∃r.Au · · · u ∃rn.A γn(Z) :=∃rn+1.A

It is easy to verify that each γn is an EL−>-unifier of Γ. Furthermore, every top-level atom of γn(X), γn(Y), and γn(Z) is either A or a particle of γn(∃r.X).

Note that both A and ∃r.X are non-variable atoms of Γ. Thus, Γ has infinitely many local EL−>-unifiers.

Additionally, these unifiers are even incomparable w.r.t. the subsumption order on unifiers, i.e., for no two n, m ∈ N with n 6= m it holds that γn(X) v γm(X) for all variables X. This is the case since the concept termsγn(Z) = ∃rn+1.Aare incomparable in this sense.

We will show that checking for local unifiers suffices to decide unifiability inEL−>

by demonstrating that the decision procedure described in Section 4 can be used to construct localEL−>-unifiers. To be able to use the reductions to the problems of solvability of sets of language inclusions and emptiness ofε-AFA, we first define appropriate notions of locality for these formalisms.

Definition 27. LetI be a finite set of inclusions of the form

X ⊆L0∪L1X1∪. . .∪LnXn, (1) as described in Section 4.2. A solution θ of I is called local if all words w ∈ θ(X)\ {ε} for X ∈ Var(I) occur on the right-hand side of some inclusion Y ⊆ L0∪L1X1∪. . .∪LnXn of I under θ, i.e., either w∈ L0 or w∈ (Li \ {ε})θ(Xi) for some i∈ {1, . . . , n}.

The final definition is concerned with locality in alternating automata.

Definition 28. LetAbe anε-AFA. A successful run ofAis calledlocal if there is at least one leaf labeled by (q, ε) for some stateqofA. Since the run is successful, q is then either a final state or a universal state without possible successors. We denote by Ll(A) the set of all words accepted by A via local, successful runs.

In a successful runR ofA that is not local, all leafs are labeled by configurations (q, w) with w6=ε. In this case,q has to be a universal state without successors.

However, since such states accept any word, it is easy to change R into a local run. We simply identify the shortest word w that occurs in the label of a leaf.

Since R is a run, w is the shortest word occuring in it and all other words in R must have the suffix w. Thus, we can simply remove the suffix w from all configurations inR and obtain a successful run that accepts a shorter word. This new run is local since it must contain at least one leaf labeled by (q, ε) for some state q.

This construction also shows that runs accepting minimal words, i.e., words for which no prefix is accepted byA, are always local. This is an important property of locality in ε-AFA which will prove to be useful.

The following lemma proves a connection between local runs and local solutions by analyzing one direction of Lemma 16 in more detail.

Lemma 29. Let I be a finite set of inclusions of the form (1) and let the ε-AFA AX for a variable X ∈Var(I)be constructed as in Definition 14. If w∈Ll(AX), then there is a finite, local solutionθof Isuch thatw∈θ(X)and everyw0 ∈θ(Y) for some Y ∈Var(I) is a suffix of w.

Proof. LetR be a local, successful run ofAX starting in ((X,0), w) and consider the solution θR that was constructed in the proof of Lemma 16:

θR(Y) :={u∈Σ | ∃v ∈V0 :l(v) = ((Y, . . .), u)}

for all variables Y ∈ Var(I). Since V0 is a subset of the finite set of nodes of R, θR is finite. By definition of the transition relation of AX, the run R, and thus also θR, contains only suffixes ofw. Furthermore,w∈θR(X) since the root node of R is labeled by ((X,0), w) and contained in V0. It remains to show thatθR is local.

Since R is local, there is a leaf of R that is labeled by (q, ε) for some state q of AX. We now consider the pathpleading from the root of R to this leaf. Its root is labeled by ((X,0), w), while its leaf is labeled by (q, ε). Thus, every suffix of w must occur along this path. To show locality, it thus suffices to show that every word occuring along p satisfies the conditions on locality. We will show this by backwards induction along p.

We begin the induction at the leaf of p, which is labeled by (q, ε). The word ε trivially fulfills the conditions for locality ofθR. Let nowv0 be a node ofplabeled by (q0, u0) for a stateq0 and a suffixu0 of wthat fulfills the conditions for locality of θR. If v0 is the root node, we are done. Otherwise, we show the same for the predecessor v of v0, which also lies on the path p. Let (q, u) be the label of v and consider the following cases:

• If u=u0, then u fulfills the condition for locality ofθR, since u0 does.

• Otherwise, u = αu0 for some α ∈ Σ and q must be of the form (i, λ) for some inequation i:Y ⊆L0∪L1X1∪. . . LnXn in I. Then the label (q0, u0) of v0 can only have one of the following forms:

– Ifq0 =f0, then α∈L0. SinceR is successful, we then haveu0 =εand u=α ∈L0.

– Otherwise, q0 = (Xi,0) for some i ∈ {1, . . . , n} and α ∈ Li. But then u0 ∈ θR(Xi) by definition of θR and thus, u = αu0 ∈ {α}θR(Xi) ⊆ (Li \ {ε})θR(Xi).

Thus, the wordufulfills the condition of locality since it is contained in the right-hand side of iunder θR.

In the following, let Γ be a flat EL−>-unification problem, τ a subsumption mapping for Γ, and γτ, ∆Γ,τ, IΓ,τ, and A(X, A) be defined as in Section 4.

Using the previous lemma, under some conditions we can construct a finite, local, admissible solution of IΓ,τ.

Lemma 30. If for every X ∈ Var(I) there is a constant A(X) such that the automatonA(X, A(X))accepts a wordwX, then there is a finite, local, admissible solution of IΓ,τ that contains only suffixes of the words wX.

Proof. By Lemma 29, we find for every X a finite, local solutionθX of IΓ,τ that contains only suffixes of wX and satisfies wX ∈ θX(XA(X)). By Lemma 10, the union θ of all θX is still a solution of IΓ,τ. It is finite since it is a finite union of finite solutions. It is also admissible since for every X the set θ(XA(X)) is non-empty. Finally, it is local since all contained words satisfy the conditions on locality by locality of the component solutions θX.

The following lemma proves a connection between finite, local, admissible solu-tions of IΓ,τ and local unifiers of Γ by analyzing one direction of Lemma 9 in more detail.

Lemma 31. Let θ be a finite, local, admissible solution of IΓ,τ. Then there is a local EL−>-unifier σ of Γ.

Proof. Consider the EL−>-unifierσ of ∆Γ,τ constructed in the proof of Lemma 9 which has the property that Sτ ≤ Sσ. It was defined by induction on the order

> on the variables as follows:

σ(X) := l

D∈Sτ(X)

σ(D)u l

A∈Nc

l

w∈θ(XA)

∃w.A

for every variable X, where σ(Y) has already been defined for each variable Y with X > Y. In the proof of Lemma 8, it was shown that σ is also a unifier of Γ.

To show that σ is local, we consider all top-level atoms of σ(X) for each X ∈ Var(Γ). For those top-level atoms of the form σ(D) for D ∈Sτ(X), this follows immediately from the fact thatSτ(X)⊆NV(Γ). Now consider a top-level particle

∃w.A of σ(X). If w = ε, then A is a non-variable atom of Γ since we assumed that all elements ofNC occur in Γ. Otherwise,w∈θ(XA)\{ε}and, by locality of θ, there is an inclusion inIΓ,τ that containswin the substitution of its right-hand side under θ.

This inclusion must be of the form IA(s), i.e., XA ⊆ fA(C1)∪. . .∪fA(Cn), for some subsumptions of the formC1u. . .uCnv? X in ∆Γ,τ. Locality ofθ yields an index i ∈ {1, . . . , n} with w∈ θ(fA(Ci)), whereCi is neither a variable nor a constant.5

Thus, Ci is of the form ∃r.C0, where C0 is either a variable or the constant A. Consequently, either w∈ {r} or w ∈ {r}θ(CA0 ). In the former case, ∃w.A =

∃r.A =Ciis a ground atom of Γ. In the latter case,w=rw0 for somew0 ∈θ(CA0 ).

This implies σ(C0) v ∃w0.A, which yields σ(Ci)v ∃w.A. By Lemma 3, ∃w.A is a particle of σ(Ci). Since Ci ∈NV(Γ), the particle ∃w.Afulfills the condition for locality of σ.

5Recall the definition offA(C) from Section 4.2.

Since we want to obtain a complexity result, we also have to consider the size of σ. In the following, size always means the number of symbols it takes to write something down and is denoted by | · |. For example, for a solution θ of IΓ,τ,

|θ| denotes the number of symbols it takes to write down all the sets θ(XA) for X ∈Var(Γ) and A∈NC.

Lemma 32. If θ is a finite, local, admissible solution of IΓ,τ, then the size of the local EL−>-unifier σ constructed in Lemma 31 is at most exponential in the size of Γ and polynomial in the size of θ.

Proof. For a variableX ∈Var(Γ), we consider all sequences X1 <· · ·< Xn=X where X1 is a minimal variable w.r.t. <. The length of such a sequence is the number of variables it contains, i.e.,n. Theheight ofX is defined as the maximal length of all such sequences. This means that the height of a minimal variable is 1 and the height is bounded by |Var(Γ)| since <is acyclic.

We prove the following claim by induction on the height n of the variables X ∈ Var(Γ): For every X ∈Var(Γ),

Let n = 1, i.e., X be a minimal variable w.r.t. <. Then all non-variable atoms in Sτ(X) are ground and the size of σ(X) is bounded by 5(|Sτ(X)|+ |θ|) ≤ 5(|Γ|+|θ|).

If n > 1, then we know that the height of all variables Y < X must be smaller than n. Since all the non-variable atoms D ∈ Sτ(X) contain only variables smaller than X, by induction we can bound the size of eachσ(D) forD ∈Sτ(X)

Since the height of any variable is bounded by the number of variables, and thus by |Γ|, this means that the overall size ofσ is bounded by

|Γ|5|Γ|

6The constant 5 accounts for additional symbols likeuorthat are added in the definition ofσ.

i.e., an expression that is exponential in |Γ|and polynomial in |θ|.

i.e., an expression that is exponential in |Γ|and polynomial in |θ|.