• No se han encontrado resultados

VI. MATERIALES Y MÉTODO

VI.6 Consideraciones éticas

In this section, we study the standard reasoning problems for Kn, which are: Satisfiability: Is ϕ satisfiable?

Unsatisfiability: Is ϕ unsatisfiable? Entailment: Does ϕ entail ψ?

The complexity of these tasks was investigated in [Lad77], where it was shown that all three tasks were Pspace-complete. Ladner’s Pspace-hardness result was proven by means of a reduction from the validity problem for quantified boolean formulae, which is the canonical Pspace-complete problem.

Theorem 2.5.1 ([Lad77]). Satisfiability in K is Pspace-hard.

Proof Sketch. We recall that a quantified boolean formula (QBF) is an expres- sion of the form Q1p1...Qmpmθ where each Qi is either ∃ or ∀, the pi are distinct propositional variables, and θ is a propositional formula over variables {p1, ..., pm}. Validity of a QBF β = Q1p1...Qmpmθ is defined recursively as follows: if Q1 = ∀ (resp. Q1 = ∃), β is valid if and only if both (resp. either) Q2p2...Qmpm(θp1←⊤)

and (resp. or) Q2p2...Qmpm(θp1←⊥) are valid (the base case, when β is proposi-

tional, is treated as in propositional logic)2. The problem of deciding whether a QBF is valid was shown Pspace-complete in [SM73].

Figure 2.2 presents an encoding of a QBF β = Q1p1...Qmpmθin a Kn-formula f(β) that is used in [BdV01] to demonstrate the Pspace-hardness of satisfiability in Kn. In addition to the propositional variables p1, ..., pm, the formula f (β) contains variables q0, ..., qm. Informally speaking, these variables are used to keep track of the number of quantifiers treated so far. We begin in q0 (part (i) of f (β)), and we pass from qi to qi+1 with each modal operator (parts (ii) and (iiia)). When the quantifier associated with the current state is universal, there must be two successor states, corresponding to the two ways of instantiating the variable pi (part (iiib)); the choices of variable values are preserved as we pass through the different levels of quantification (part (iv)). Finally, for f (β) to be hold, the propositional formula θmust be satisfied in all terminal states (part (v)). Thus, we find that the formula f(β) is satisfiable just in the case that β is a QBF-validity (refer to [BdV01] for the full proof). As the formula f (β) can be generated in polynomial time from β, and the QBF-validity problem is known to be Pspace-hard, it follows that satisfiability of formulae in Kn is Pspace-hard as well.

2. Here θp←⊤ (resp. θp←⊥) denotes the formula obtained from θ by replacing all occurrences of the propositional variable p by ⊤ (resp. ⊥).

40 2.5. Basic Reasoning Tasks

(i) q0

(ii)Vmi=0((qi→ ∧j6=i¬qj) ∧ 2(qi→ ∧j6=i¬qj) ∧ ... ∧ 2m(qi→ ∧j6=i¬qj))

(iiia)Vmi=0((qi→ 3qi+1) ∧ 2(qi→ 3qi+1) ∧ ... ∧ 2m(qi→ 3qi+1))

(iiib) V{i|Qi=∀}2i(q

i→ (3(qi+1∧ pi+1) ∧ 3(qi+1∧ ¬pi+1)))

(iv)Vm−1i=1 ( Vm−1 j=i 2 j((p i→ 2pi) ∧ (¬pi→ 2¬pi))) (v) 2m(q m→ θ)

Figure 2.2: The formula f (β) is the conjunction of the above formulae.

It follows from Theorem 2.5.1 that the dual problem of unsatisfiability is Pspace- hard as well. Moreover, as satisfiability tests correspond to a special type of entail- ment query, the Pspace-hardness result can also be transferred to the entailment task.

Corollary 2.5.2.

Entailment in K is Pspace-hard.

Ladner’s proof of membership of satisfiability in Pspace was constructive: he exhibited a tableaux-style polynomial-space algorithm for deciding satisfiability of Kn-formulae (cf. [HHSS06] for more discussion of different types of satisfiability algorithms for Kn). The basic idea behind Ladner’s algorithm (and tableaux-style algorithms in general) is to try to construct a model of the formula; if we succeed in constructing a model, we have proven the formula satisfiable, and if we fail to find a model (and can show that we tried all possibilities), the formula is unsatisfiable. As satisfiability-testing appears as a component in practically all of the algo- rithms in this thesis, we present in some detail an algorithm for deciding satisfi- ability of Kn formulae. The algorithm, which we call Sat, examines each of the formulae in Dnf (ϕ) one-by-one. As the disjunction of the formulae in Dnf (ϕ) is equivalent to ϕ, we know that ϕ has a model just in the case that at least one of the formulae in Dnf (ϕ) has a model. Thus, we have reduced the problem of deciding satisfiability for arbitrary formula in Kn to the more restricted problem of deciding satisfiability for conjunctive formulae. We then exploit statement 5 of Theorem 2.3.1 which tells us that a conjunctive formula T has a model just in the case that its propositional part has a model (i.e. no complementary propositional literals) and for each conjunct 3iψ of T , the formula ψ ∧Vχ∈Boxi(T )χ possesses a model. To check whether the latter holds, we make a recursive call to Sat. Ter- mination of Sat follows from the fact that at each level of recursion the depth of the input formula decreases, and the recursion stops when the input formula is a

propositional formula. Algorithm 2.6 Sat Input: a formula ϕ in Kn

Output: yes if ϕ is satisfiable, and no otherwise

(1) Run Dnf (ϕ), and for each output formula T , do the following: Check whether the following conditions are verified by T :

(a) T has no conjunct ⊥

(b) P rop(T ) contains no complementary literals

(c) For each conjunct 3iψ of T , Sat(ψ ∧Vζ∈Boxi(T )ζ)=yes Return yes if all three conditions hold.

(2) Return no.

We illustrate the functioning of the algorithm Sat on two small examples: Example 2.5.3.

We use Sat to determine whether the formula ϕ = a ∧ ¬(31¬b ∧ 21c) ∧ (31¬b ∨ ¬3231⊤) is satisfiable. In Step 1, Sat calls Dnf on input ϕ. We know from Example 2.4.3 that the first formula returned by Dnf will be T1 = a ∧ 21b∧ 31¬b. We examine T1 in order to determine whether it satisfies the three conditions of Step 1. The first two conditions are verified since T1 has no conjunct ⊥ and no complementary propositional literal conjuncts. To check condition (c), we must call Sat on input b ∧ ¬b because of the conjunct 31¬b. Sat will return no on this input, as there is a single formula b ∧ ¬b returned by Dnf on input b ∧ ¬b, and it falsifies condition (b). This means that we will not return yes when examining T1. The next formula output by Dnf will be T2= a ∧ 21b∧ 2221⊥. This formula satisfies all three conditions since it contains no conjunct ⊥, no complementary literal conjuncts, and no 3-formulae as conjuncts. This means that Sat will return yes in Step 1.

Example 2.5.4.

We use the algorithm Sat to test whether ϕ = 21(a ∧ b ∧ 31⊤) ∧ 31(¬a ∨ ¬b ∨ 2132(b ∧ ⊥)) is satisfiable. In Step 1, the transformation Dnf is called on ϕ. There is a single formula in the output of Dnf , which is ϕ itself. The first two conditions are satisfied by ϕ since it does not contain any conjunct of the form ⊥ nor any propositional conjuncts. In order to determine whether ϕ satisfies condition (c), we call Sat on the formula ψ = (a ∧ b ∧ 31⊤) ∧ (¬a ∨ ¬b ∨ 2132(b ∧ ⊥)). It can be verified that the first formula in Dnf (ψ) is a ∧ b ∧ 31⊤ ∧ ¬a, which falsifies condition (b). The next formula returned by Dnf is a ∧ b ∧ 31⊤ ∧ ¬b, which also violates condition (b). The next and final formula in the output of Dnf is

42 2.5. Basic Reasoning Tasks

a∧ b ∧ 31⊤ ∧ 2132(b ∧ ⊥). This formula satisfies (a) and (b) but not (c) since Sat(b ∧ ⊥)=no and hence Sat(⊤ ∧ 32(b ∧ ⊥))=no. It follows that Sat(ψ)=no, which means Sat(ϕ)=no as well.

Theorem 2.5.5.

The algorithm Sat terminates and outputs yes if and only if the input formula is satisfiable.

Proof. The proof is by induction on the depth of the input formula. We begin with the case where the input formula has depth 0. In this case, we know by Theorems 2.4.4 and 2.4.6 that the set of formulae output by Dnf (ϕ) is a set of propositional terms whose disjunction is equivalent to ϕ. If ϕ is satisfiable, then there must be some element T in the output of Dnf (ϕ) which is satisfiable. This means that when we examine T , we will find no conjunct ⊥ nor any pair of complementary literals in P rop(T ), and so will return yes. If instead ϕ is unsatisfiable, then every formula in the output of Dnf (ϕ) must be unsatisfiable. This means that every such formula must either have a conjunct ⊥ or contain a pair of complementary literals, so we will not return yes during Step 1, which means we will continue on to Step 2, where we return no.

Next suppose the Sat gives the desired result whenever the input formula has depth at most k, and consider some formula ϕ having depth k + 1. In Step 1 of Sat, we run Dnf on input ϕ. By Theorems 2.4.4, the set of formulae output Dnf consists of a set of conjunctive formula whose disjunction is equivalent to ϕ. If ϕ is satisfiable, then there must be some satisfiable T which is output at some stage by Dnf . Since T is a satisfiable conjunctive formula, we know that it cannot contain a conjunct ⊥, nor a pair of complementary propositional literal conjuncts, nor a conjunct 3iψ such that ψ ∧Vζ∈Boxi(T )ζ is unsatisfiable (by Theorem 2.3.1). But

we know from Theorem 2.4.6 that T is of depth at most k + 1, which means that if 3iψ is a conjunct of T , then ψ ∧Vζ∈Boxi(T )ζ must be of depth at most k. It follows that we can apply the induction hypothesis to ψ ∧Vζ∈Box

i(T )ζ to find that

Sat(ψ ∧Vζ∈Boxi(T )ζ)=yes. This means that T satisfies all three conditions, and so Sat will return yes in Step 1. If instead ϕ is an unsatisfiable formula, then all of the formulae output by Dnf on input ϕ must themselves be unsatisfiable. There are three possibilities for every such formula T : either T has a conjunct ⊥, or it has complementary propositional literal conjuncts, or there is some conjunct 3iψ of T such that ψ ∧Vζ∈Boxi(T )ζ is unsatisfiable (Theorem 2.3.1). In the first two cases, either condition (a) or (b) is falsified. In the third case, we can apply the induction hypothesis to ψ∧Vζ∈Box

i(T )ζto find that Sat(ψ∧

V

ζ∈Boxi(T )ζ)=no, and

all three conditions, so yes will not be output in Step 1 of Sat, which means no will be returned in Step 2.

Theorem 2.5.6.

The algorithm Sat runs in polynomial space in the size of the input formula. Proof. We will show the result in the case that ϕ is in NNF. This is without loss of generality since the transformation to NNF is polynomial (see Theorem 2.4.2).

The proof is by induction on the depth of the input formula ϕ. The base case is when δ(ϕ) = 0. In Step 1, Sat runs Dnf on ϕ. We know from Theorem 2.4.7 that Dnf requires only polynomial space in |ϕ|. Moreover, by Theorem 2.4.6, we know that every formula T output by Dnf has depth 0 and has length at most |ϕ| (since ϕ is assumed to be in NNF). This means that testing conditions (a), (b), and (c) for some formula T in the output of Dnf takes linear space in |ϕ|. As only one formula is tested at any given time, it follows that Sat runs in polynomial space in |ϕ|.

Now suppose the result holds for formulae with depth at most k, and let ϕ be a formula with depth k + 1. Now, in Step 1, Sat runs Dnf on ϕ. We know from Theorem 2.4.7 that running Dnf on ϕ requires only polynomial space in |ϕ|. Moreover, because ϕ is assumed to be in NNF, we know that every formula T output by Dnf has depth k + 1 and has length at most |ϕ| (Theorem 2.4.6). It follows that testing conditions (a) and (b) for a given T can be accomplished in linear space in |ϕ|. As for condition (c), we remark that if 3iψ is a conjunct of T , then the formula ψ ∧Vζ∈Box

i(T )ζ is a formula in NNF with depth at most k, so according to

the induction hypothesis, Sat runs in polynomial space in |ψ ∧Vζ∈Boxi(T )ζ|. But the length of ψ ∧Vζ∈Box

i(T )ζ is bounded above by the length of T , which we know

to be bounded above by |ϕ|. It follows that condition (c) can also be checked in polynomial space in |ϕ|, which means that Sat runs in polynomial space in |ϕ|. Theorem 2.5.7 ([Lad77]).

Satisfiability and unsatisfiability of Kn formulae are both in Pspace. Proof. Follows directly from Theorems 2.5.5 and 2.5.6.

We now introduce an algorithm Entails for testing entailment between Kn formulae. Our algorithm leverages statement 1 of Theorem 2.3.1, which tells us how entailment queries can be reformulated as unsatisfiability checks.

Theorem 2.5.8.

The algorithm Entails is a sound and complete decision procedure for entailment and runs in polynomial space.

Documento similar