• No results found

In addition, the co-occurrence graph has a transitive set of edges. This is due to the transitivity of the implication relation. If a system S has three changes such as c1 → c2 and c2 → c3, by definition, for every set of changes C giving

a consistent update of S, if c1 ∈ C then c2 ∈ C, and if c2 ∈ C then c3 ∈ C.

Therefore, ifc1 ∈C thenc2 ∈C, which in turn givesc3 ∈C, i.e. c1 →c3. Hence, the co-occurrence graph has a transitive edge set.

Having defined the problem of deciding pair constraints for given (in)equality collections and sets of changes, the next section focuses on its complexity. As seen above, this will be useful for the time complexity analysis of COMB.

4.3

Complexity Analysis of PAIR

Pair constraints carry important information about how two constraints can ap- pear together in a combination. Therefore, the focus of this section will be on finding the computational complexity of checking if a certain constraint in the form c1 →(¬)c2 is a pair constraint for a given system of (in)equalities S and a set of changesC. This will be done under the assumption of constant time checks on the membership of systems in IR. In order to do this, the first subsection identifies the non-changing aspects of the current set of relations when transiting to any of its updates.

4.3.1

Common Relations

Given a consistent system of (in)equalitiesS and a set of changesC, some knowl- edge can be inferred about the commonalities of all updates ofS. For example, if

S ={x < y, x+z < y+z}andC ={(x < y, x=y),(x+z < y+z, x+z =y+z)}, then it can be deduced that any update of S will have x≤y and x+z ≤y+z. Those statements that can be inferred to hold for any update ofS will be referred to as the common relations forS and C.

Formally, the set of common relations for S and C is

CommonS,C ={r∨

_

(r,r0)∈C

r0|r ∈S}.

This says that, for every relationrin the system, after an update, the new system must have either r or one of its possible developments according to C. So, for the example before, the set of common relations is {x < y ∨x = y, x +z < y+z∨x+z =y+z}.

This concept will be used later, when analysing the complexity of PAIR. The construction of the set of common relations can be done in polynomial time; starting with the set equal toS, eachr∈S is replaced with the logical expression

er := r ∨

W

looping through all elements ofC and adding∨r0 whenever some (r, r0) is found. Therefore, the common set of constraints can be constructed inO(|S| · |C|) time. Hence, we have identified a set of relations that remain invariant over updates. Note the important fact that the construction of this set is polynomial. In the next subsection, we use this set to check the validity of pair constraints.

4.3.2

Complexity of

PAIR

At this point, we have all the ingredients needed to analyse the complexity of deciding whether a pair constraint is valid for a given system of (in)equalities and changes. Therefore, in this section, we prove the following result.

Theorem 4.3.1. PAIR∈PIR.

Since IRisNP-hard, andPAIR is clearly in NP, this theorem follows imme- diately. However, for pragmatic reasons, we opt for also providing a constructive proof, which will prove useful in the following chapter.

To show this, let’s consider the following algorithm, P. 1. Check the validity of the input:

• that S is a system of (in)equalities, C a set of changes on S, and pair

is in the form c1 →(¬)c2 with ci ∈ C; the notation of ci = (ri, r0i) will

be used;

• moreover, check that S ∈IR.

If the input is not valid, then output 0.

2. Construct the set of common relations for S and C, CommonS,C.

3. Next, proceed by cases:

• First, suppose pair = c1 → c2. In the particular case that c1 = c2,

always output 1. Otherwise, output 1 iff for all r ∈ {r|(r2, r)∈ C, r6= r20} ∪ {r2} CommonS,C∪ {r01, r}∈/ IR.

• If pair=c1 → ¬c2, then output 1 iff CommonS,C∪ {r10, r02}∈/ IR.

This procedure is polynomial with an oracle for language IR. The first step, checking the validity of the input, can be done in O(|S| · |C|). The second step builds the common set of relations, and, as shown in the previous section, is polynomial, while the last step consists of at most |C| calls to the oracle.

Therefore, it remains to show that the presented algorithm indeed outputs 1 iff pair is a pair constraint in canonical form for S and C.

Lemma 4.3.2. If S is a consistent system of (in)equality relations,C is a set of changes onS, then procedureP outputs 1 iffpairis a pair constraint in canonical form.

4.3. Complexity Analysis of PAIR 59

Proof. We prove each implication in turn.

(⇒) If P outputs 1, then, by the first step,pair=c1 →(¬)c2. Now we proceed by cases.

Ifpair =c1 →c2, and c1 =c2, then pair=c1 → c1 which is trivially true.

However, if c1 6= c2, since P produced output 1, for all r ∈ {r|(r2, r) ∈

C, r 6=r20} ∪ {r2} CommonS,C∪ {r01, r} ∈/ IR. Informally, this means that

any update of S that uses the change c1, but either leaves r2 as it is, or

changes it to something different fromr20 is inconsistent.

For a formal proof, let C ⊆ C such that c1 ∈ C , SC is consistent, but

c2 ∈/ C. By definition, SC ⇒ CommonS,C ∪ {r01,∨r∈{r|(r2,r)∈C−{c2}}∪{r2}r}.

Since, CommonS,C ∪ {r10, r} ⇒ ⊥ for all r 6= r20, this means there is a

proof by cases of ⊥ from CommonS,C ∪ {r10,∨r∈{r|(r2,r)∈C−{c2}}∪{r2}r}, and,

therefore, Sc is inconsistent, which is a contradiction. Hence, any set of

changes containing c1 and consistently updatingS also contains c2.

Otherwise, if pair = c1 → ¬c2, since 1 is the output of P, CommonS,C ∪

{r01, r02}∈/ IR. By lemma 4.1.1, this is equivalent to CommonS,C∪ {r10} ⇒

¬r02. Let C ⊆ C such that c1 ∈ C and SC is consistent. Then, SC ⇒

CommonS,C∪ {r10} directly from proof theoretic axioms. Therefore, SC ⇒

¬r02, which meansc2 ∈/ C.

(⇐) By hypothesis pair =c1 → (¬)c2 is a pair constraint. We consider each of the two cases.

If pair = c1 → c2, then for all C ⊆ C such that SC is consistent, c1 ∈ C ⇒c2 ∈ C. In other words, for all C ⊆ C such that c1 ∈ C and c2 ∈/ C, SC is inconsistent. Hence, any update from S obtained by changing r1 to r01, r2 with something different from r20 and any other change of relations

according to C results in an inconsistent set. Hence, there is a proof by cases that if the update contains r01 but something different from r20, then falsehood will result. That is, for all r ∈ {r|(r2, r) ∈ C, r 6= r20} ∪ {r2} we

haveCommonS,C∪ {r10, r} ⇒ ⊥, which means CommonS,C∪ {r10, r}∈/ IR.

Otherwise, that is if pair = c1 → ¬c2 is a pair constraint, then for all C ⊆ C such that SC is consistent, c1 ∈ C ⇒ c2 ∈/ C. In other words, for

all C ⊆ C such that c1 ∈ C and c2 ∈ C, SC ⇒ ⊥. Similarly as above,

we then have a proof by cases of ⊥ from CommonS,C ∪ {r01, r20}. That is, CommonS,C∪ {r01, r

0

2}∈/ IR.

This finalises the proof of the correctness of the output of P.

With the above result, P is known to be both polynomial with oracleIR and to decide PAIR. Therefore this concludes the proof of theorem 4.3.1. Next, we show how this result is used to solve the search problemCOM B, and under which conditions it becomes polynomial.

Related documents