• No results found

of changes that can be performed on that system, and finds a superset of the combinations of changes that give consistent developments of the original sys- tem. Secondly, the inequality reasoning problem decides the consistency of a set of (in)equalities, which may be linked with logical connectors. Thirdly, the pair ordering problem, which decides dependencies between occurrences of the pairs of changes, is discussed in Section 4.2. Sections 4.3 and 4.4 look at the theoretical complexity analysis of these problems. Section 4.5 presents a procedure improv- ing the number of calls to the inequality reasoner, and hence better suited for practical use. This chapter ends with a discussion on the benefits of introducing these procedures.

4.1

Combining Changes and Inequality Reason-

ing

Consider a set of (in)equalities which is initially consistent. This set may develop into another consistent one by performing one or more changes of its elements. If only certain changes are allowed, but in any combination, we wish to identify which combinations of changes could preserve the consistency of the set. In this

section, we formally define this problem. Since solving this problem requires performing calls to the inequality reasoning procedure, the latter will be formally defined first.

4.1.1

Inequality Reasoning Problem

This chapter considers dynamic sets of (in)equalities. The (in)equalities are de- fined as usual as two terms linked by one of the relations<,≤,=,6=,≥and >. A term is formed from constants and variables linked together with arithmetic op- erations and parenthesis. In addition to this, an(in)equality relation is obtained from (in)equalities linked together with logical connectives. A set of (in)equality relations will also be referred to as a system of (in)equalities.

When considering a system of (in)equalities, the problem of its consistency (i.e. is the system non-contradictory) can be introduced. For example, the system {x = 1, x+y <2} is non-contradictory, but adding the relationy = 1 makes it inconsistent, as the new relation with x+y < 2 implies x < 1, which in turn gives 1<1 since x= 1. Of course, this is a contradiction. Hence, the problem of deciding if a system is consistent, which we will refer to as theinequality reasoning problem, is defined as follows:

IR:={S|S is a consistent system of (in)equalities}

Given a system of (in)equalities, new relations can be deduced from it using arithmetic rules and natural deduction. Returning to the previous example,y <1 can be deduced from{x= 1, x+y <2}. For this, the notationS⇒rwill be used to signify that relation r can be inferred from system S. Hence, {x= 1, x+y <

2} ⇒ y < 1. The inconsistency of a set S is then simply a proof of ⊥ from S, i.e. S ⇒ ⊥. There is also a link between the deductibility of some relation r

fromS and the inconsistency ofS∪ {¬r}, which will be used later. Notice that a tautology is needed for pragmatic reasons, since, in practice, inequality reasoning engines check consistency of a system together with a relation (see Section 3.2).

Lemma 4.1.1. If S is a system of (in)equalities, and r is an (in)equality, then

S ⇒r iff S∪ {¬r} ⇒ ⊥.

Proof. We prove each implication in turn:

(⇒) If r is deducible from S this means that there is an arithmetic proof of r

fromS. The same proof holds of course from S∪ {¬r}. But, of course, in

S∪ {¬r}, r is also deducible, so we have both r and ¬r being true. This gives a contradiction, that is a deduction of⊥ and hence the inconsistency of S∪ {¬r}.

(⇐) To show this, we proverfromS. As the reasoning is done in classical logic, either r or ¬r must hold. But, by hypothesis, adding ¬r to S gives an

4.1. Combining Changes and Inequality Reasoning 53

inconsistent system. Hence, r holds. This gives a proof of r from S, and, therefore,S ⇒r.

By the two implications we conclude that S ⇒r iff S∪ {¬r} ⇒ ⊥.

Another property of the systems of (in)equality is the monotonicity of their inconsistency. To see this, consider some inconsistent set S. This means there is a proof of falsehood from S, i.e. S ⇒ ⊥. But the same proof will hold when extendingSwith some other systemS0. So, ifS ⇒ ⊥then for anyS0,S∪S0 ⇒ ⊥.

4.1.2

Combining Changes Problem

The problem of performing certain modifications to systems of (in)equalities will now be considered. A change on a given (in)equality relation r is an ordered pair where the first element, the source relation, is r and the second one, the destination relation, is r0, i.e. c= (r, r0). The update with a change of a system of (in)equalities, S, results in a new system, Sc, obtained from S by replacing

any occurrence of r with r0. Formally, if r /∈ S then Sc = S, otherwise, Sc =

S− {r} ∪ {r0}. For example, the system S ={x < y, x+z < y+z}updated with the change c= (x < y, x =y) forms Sc ={x = y, x+z < y+z}. Notice that

we can also (simultaneously) update a system with a set of one or more changes as long as they do not change the same relation, that is if any two changes have different source relations. Moreover,C is a set of changes onS if for all (r, r0)∈ C,

r∈S. A subset of changes fromC is called a combination. Such a combinationC

is consideredvalid for a systemSif the resulting updated systemSC is consistent.

Using this, the search problem of combining changes, COMB can be formu- lated as follows:

Input: A consistent set of (in)equalities S, and a set of changes, C, on S.

Output: Some set Comb ⊆ P(C) such that, for all C ⊆ C, if C is valid for S, then C ∈Comb.

An alternative, stricter formulation of this problem would be to demand the output set containing precisely the valid combinations, and no invalid ones. Notice however that, when using IR as an oracle, the two problems belong to the same time complexity class. To see this, firstly a solution for the strong version of the formulation is obviously also a solution for the weak version. For the converse, by updating S in turn with each member of the result set, and checking its consistency with IR, the output of the strong version can be produced linearly from the weak version’s one. To avoid appending this last step of IR checks at the end, we choose to analyse the weak version.

Having introduced the combining changes problem, its complexity will be con- sidered. The trivial case when all individual changes give consistent updates will

have exponentially many valid combinations, so the problem COMB is clearly exponential. However, when the relations within the system are interdependent, the number of valid combinations decreases. In the remaining part of this chapter we investigate what are some conditions that would make the problem of com- bining changes polynomial in time when given access to constant time inequality reasoner checks.

Related documents