A New Mehtod for Proving Certain Presburger Formules
Proceedings of the Fourth International Joint Conference on Artificial Intelligence. Mathematical and Theoretical Aspects of A.I. Pages 15-20.
© 1975 International Joint Conferences on Artificial Intelligence
Abstract
This paper describes a new method for determining the validity of certain formulas from Presburger Arithmetic, namely those with only universally quantified variables. To do this the notion of a Presburger formula, is generalized slightly to that of a quasi-linear formula. This so called "sup-inf'' method seems particularly suited for proving certain verification conditions that arise from program validation, especially those in which "proof by cases" is required. It also eliminates the need for proof by enumeration, inherent in some methods described earlier in the literature, which sometimes require a search through a large number of consecutive integers. These algorithms have been programmed and used extensively as a part of an automatic theorem proving system.
- J =("+"A B), where A has the form ("*" r A 1 ) , where r is a number and A' is a variable Put B 1 : = INF(B,L U (A'}) 6.1 6.2 B' = B Put J': = 7. SIMP("+"A B') 6.2.1 J' =("="A 8 1 ) 6.2.2 J' I ("+"A B') J = ("+''A B)Put J': = ("+"INF (A, L)B) ("+"INF (A, L)B I) INF(J',L) SIMP ("+"INF (A,L) INF (B, L)) 7.1 J' = J 7.2 J' I J INF(J',L) 8. J = ("max" A B) MAX (INF (A, L), INF (B,L)) 9. J = ("min"A B) MIN (INF (A, L), INF (B,L)) 10 . Otherwise References
- Cooper, D.C. Programs for mechanical pro- gram verification. Mach. Intell. 6. Ameri- can Elsevier, New York, 19~3-S9.
- Davis, M. A program for Presburger'a algor- ithm. ~ Inst. 12!. Symbolic Logic, Cornell U., 1957 . 215-233.
- Presburger, M. Uber die Vollstandigkeit eines genissen Systems der Arithmetik ganzer Axhlen, in Welshem die Addition als einzige Operation hervortritt, Sprawozdanie z I Kongresu Matematykow Krajow Slowcanskich Warszawa, 1929, pp. 92-101 .
- Wang, Hao. Toward Mechanical Mathematics, IBM~• Res . Dev. 4, 2-22.
- Bledsoe, W.W., Boyer, R.S. and Henneman, W.H. Computer proofs of limit theorems. Artif. Intell. 1, 1972 . 27-60. IJCAI
- Good, D.I . , London, R.L., Bledsoe, w.w. An interactive Verification System . Pro- ceedings of the 1975 International Conf . on Reliable Software, Los Angeles, April, 1975, pp. 482-492, and IEEE Trans. on Software Engineering, 1(1975), 59-67 .
- Bledsoe, W.W. and Tyson, M. Typing and proofs by cases in program verification. The University of Texas at Austin Mathematics Department Memo ATP 15, May 1975.
- Bledsoe, w.w. The Sup-Inf Method in Pres- burger Arithmetic, The University of Texas at Austin Mathematics Department Memo ATP 18, December, 1974. (This is essentially the same as the present paper except that it con- tainb proofs of the theorems in Section 4.)
- Bledsoe, W.W. and Tyson, Mabry. The UT Interactive Prover. The University of Texas at Austin Mathematics Department Memo ATP 17, May 1975.
- Shostak, Robert. Private Communication. s•tanford Research Inst . , March 1975 .
- Gomery, R.E . An algorithm for integer solutions to linear programs. Princeton- IBM Mathematics research project, Technical Report No. 1, 1958.
References were extracted automatically from the PDF and may contain errors.
Full text extracted automatically from the PDF; figures, tables and equations may differ. The PDF is the version of record.
1. Introduction
Presburger Arithmetic.
An expression is said to be a formula in Presburger arithmetic if it is a (well) formed algebraic expression, allowing only variables, integer constants, addition and subtraction, the arithmetic relations ~ and ~, the propositional calculus logical connectives, and quantification (either universal or existential). Constant multiplication is also allowed. See [3), Davis [2), and Cooper [1).
The Presburger algorithm is a decision pro cedure for Presburger arithmetic: Given a form ula in Presburger arithmetic decide whether it is true or false. Two main steps are utilized in this process: (i) Elimination of quantifiers (and replacement of variables by constants) (ii) Evaluation of the resulting formula (which has no variables) to determine its validity.
Cooper's method.
Cooper [1) utilizes such a procedure. For example his method would convert the theorem 'ix(x < 1 + x < 2) successively to
[2 < 1 /1 1 < 2), which is easily verified as true.
Apparently Cooper's method can result in a search through a list of consecutive integers when the coefficients of x are not unity. For example, the theorem 'Y/ x (5x < 11 + 7x < 16) is converted to - :I x (5x < 11 /1 15 < 7x), and
which requires testing the expression for each of the integers, j = 1, 2, ... , 35. In fairness to Cooper it should be stated here that such adverse examples apparently do not arise often in the applications he considers in [1].
Our method, and in more detail in [8), Presburger arithmetic has many applications in the field of proving assertions about computer programs. There a theorem about the program, is required to be proved. Such theorems are often not originally stated as formulas in Presburger Arithmetic but are reduced to such as the proof proceeds. For example for an array A, we might be given the theorem: V j(j ~ 4 /1 'tt/k(k ~ 5 +A[k) < A[k+l)) + A[j] < A[j+l]).
- Backchaining ;n the second hypothesis gen erates the subgoal (j < 4 + j < 5) which is a formula in Presburger A;ithmetic. Notice that j is a universally quantified variable or free variable and hence must be treated as a skolem
1 constant in the proof. Many applications result in Presburger formulas with only universally quantified variables. In this paper we describe a procedure, the sup-inf method, for deciding the validity of such formulas.
First let us note that the above formula (j ~ 4 + j ~ 5) is easily verified by 1 adding the negation of the conclusion to the hypothesis, getting (j < 4 /1 6 < j) and then combining to get the cont;adictio~ (6 ~ j ~ 4). Our pro cedure does essentially the same thing on this example. We now describe in Section 2 our pro cedure for determining the validity of univer sally quantified Presburger formulas. In Section 3 we define the pivotal algorithms SUP and INF and prove in Section 4 of [8] that they terminate with desirable outputs when applied to quasi-linear formulas. Several examples are listed in Section 3, and given in more detail in Section 5 of [8). This method has been pro grammed and used extensively in a program veri fication system [6).
2. The Sup-Inf Procedure
An Example using the procedure.
We begin with an example and the general procedure. then outline
Let F be the theorem
Notice that F has 3 (universally quantified)
1 The skolemization process will not be discussed here. These universally quantified variables (or skolem constants) will be referred to as "variables" in this paper.
variables x 1 ,x 2 ,x 3 . We will negate F and con vert it to the expression (8') below, which gives a range for each of these three xi's. (Ex-
pressions (5'), (7'), and (8') correspond to ex pressions (5), (7), and (8) given later in our general procedure).
We first obtain
as the negation of F, and then convert it to
and finally to
To show the invalidity of (8') we calculate a lower bound ~l for x 1 and an_ upper bound x 1 , and check that the interval [x 1 ,x ] contains no integer. For this example, x- = h and x - 5 s 11 -1 T 1-3' and since 3 < 5i we are finished. ~l and x 1 are computed by the algorithms INF and SUP given in Section 3.
Quasi-Linear Formulas.
The reader will observe that expression (8') is not a Presburger formula because it conS 5 3 tains non-integer constants <3, 2, 2, etc.), and the symbol "min". We now relax the condition on the integer constants to allow ~ rational number as well as oo and - ou . However, the variables (such as x 1 , x 2 , x 3 in the above example) will represent only non-negative integers. We also allow the symbols "max" and "min" . Such an ex tended Presburger formula will be called quasi ~· It will be called "quasi-linear in L" if each of its variables is a member of the set L.
We now describe our general procedure for determining the validity of such quasi-linear formulas.
Let F be a quasi-linear formula in the variables x 1 , x 2 , .. . ,xn . We first want to convert - F to the disjunctive form
3 (F 1 V F 2 v .. . v Fp) where each of the Fi is a conjunction of the form
2 How 3 ~ 2x 2 -1 is derived from 2x 2 { 3 is ex-
plained in Section 3 of [8] .
3 In our example above we had only one F . This has been the case in most examples we ~ave tried
so far.
and each aj' b j are quasi-linear expressions the other xk (but not in xj). This is done follows: in as
The Sup-Inf Procedure . First, place -F in disjunctive normal form (G 1 V G 2 v ... v Gp) where each Gi is a disjunct of the form
and the Ai, Bi, Ci, Di are quasi-linear ex pressions in x 1 , x 2 , ... ,xn. We eliminate the equalities in (4) by converting each (Ci"' Di) into (Ci ~ Di 1\ Di ~ Ci) 4 so that each Gi has the form
Now each (Ai ~ Bi) is converted into a set of exactly n inequalities
by "solving for" 5 each of the xj occuring in Ai and Bi in terms of the other ~· Thus the aij and bij appearing in (6) are expressions in the other ~ (but not xj). If xj does not occur in Ai or B i then we put aij = 0, b ij = -T-. So (5) is converted to
(a 1 ~ x 1 ~ b 1 ) /\ .. . 1\ (a < x < b ) n- n- n '
where, for k = 1, n, ~ = (max a 1 k a 2 k . .. amk) 6 bk = (min blk b 2 k · · · bmk). Thus, by this whole process we convert - F to a disjunct
4 In practice we do not always convert the equalities to inequalities, but rather use a "substi tution of equals" technique to gain efficiency .
See [9).
5 In solving for x 1 in an expression like sup (x 1 + 2, x 1 ) ~ x 3 , we obtain two answers: x 1 ~ x 3 -2 and x 1 ~ x 3 instead of one, as indicated in formula (6). However, this presents no diffi culty in proceeding to (7) and (8).
6 The function MAX (See Sect . 3) is applied to the aik' If the maximum is not immediately attain-
able then the symbol "max" is employed. Simi larly for MIN. See for example, (7') and (8')
above .
where each FL has the form
and the ~k' bLk are quasi-linear expressions in the
Now we determine that F is valid by show ing that each FL is false.
Since the ~k and bLk are usually ex pressions in the other xi (as was the case in our example) it is not immediately obvious how one can test for the invalidity of (9). Our method (the "sup-inf'' method) for doing this is simply to test whether the interval
contains no integer, for some where sups ~ and infs ~ follows: k, k=l,2, ... ,n, are defined as
De fini tiona .
If S is a set of inequalities of the form (9) and xi, xi, ... ,x~ are real numbers, then (xi, xi, ... ,x~) is said to satisfy S if each inequality in S becomes true when each symbol ~ is replaced by the number xk·
If A is a quasi-linear expression in d ' ' ' 1 x 1 , x 2 , ... ,xn' an x 1 , x 2 , .·. ,xn are rea numbers then
denotes the number gotten from each symbol ~ by the number A by replacing xk·
If A is a quasi-linear expression in x 1 , x 2 , ... ,xn' then sups A is defined to be the least upper bound of all numbers
where (xi, xi, . ·. ,x~) is a sequence of non negative integers satisfying S. Similarly, infs A is the greatest lower bound of such numbers. When no confusion will arise we omit the subscript S and write sup A and inf A.
Thus the validity of F has been reduced to determining sups ~ and infs xk, where S is the set of conjuncts of (9). We compute sups ~ and infs ~ by the algorithms SUP and INF given in Section 3.
In Section 4 of [8) we prove that if S is ~ set of inequalities of the form (9) where we assume only that the ~i' bLi are quasi-linear in x 1 , .·. ,xn' then the outputs SUP(~,NIL) and INF(~,NIL) are numbers (or possible ± oo ) with the property
7 Furthermore, we conjecture there that if the set S is in "natural form", in that it has been derived from a theorem F by the procedure des cribed above, then equality hold in the above formula, i.e.,
Thus to show the validity of F we need only show that the interval
contains no integer for some k, k = 1, 2, .·. , n.
Some Discussion of the Procedure.
This procedure for deciding the validity of a quasi-linear formula (and hence for a univer sally quantified Presburger formula) is called the .!.!!2_-.!!t[ ~· Of course it serves much the same purpose as the methods of Cooper in [1) and others. However, we feel that the sup-inf method has some advantages, especially for proving theorems arising from program validation.
One such advantage is that a hypothesis, such as
from our earlier example (3), can be stored in the concise form
to be used to establish various conclusions as required. Thus if we desire to establish (2x 2 $_ 3) we need only update (10) with its negation (3 $_ 2x 2 -l) to get (8 1 ) and then show that (8') is invalid. Also, using this same hypothesis (10) we might (later) be required to prove another conclusion, which itself has a hypothesis, such as
In this case getting is used to update (8')
which is used to prove x 3 $_ 8.
Also as mentioned earlier it avoids proof by searches through long lists of integers.
While these arguments have merit, they are not our main reason for prefering the sup-inf method, which is our desire to efficiently handle certain "proof by cases." This is explained in [8, pp . 11-15], and in [7].
7 This conjecture has recently been proved correct by Shotak [ 10).
3 . Algorithms
Here we describe the pivotal algorithms SUP and INF .
If A and B are quasi-linear expressions in L (see definition in Section 1), then so also are (A+B), max(A,B), min(A,B), and r*A, where r is a rational number. We can also divide a quasi-linear expression A by a non zero rational number r by multiplying by its inverse, i .e . , 1/r * A.
Let S be a set of inequalities of the form a ~ xj ~ b where a and b are quasilinear in x 1 , . . . ,xj-l' xj+l' . . . ,xn . Recall the definitions of sups xj and infs xj given in Section 2 . We now give algorithms for computing sups xj and inf 5 xj for a given S. S will be assumed to be fixed throughout the remainder of this section .
Definition. MAX(x,y) is a function which returns y if x < y, x if y < x, and ("max" x y) otherwise- . Similarly for MIN(x,y) . If J is a variable, then S contains one (and only one) inequality of the form a < J < b, which repre sents knowledge about J. -If -a = 0 and b = +"' then nothing is stated about J except that it represents a non-negative integer . ·
The notation LOWER(S,J) and UPPER(S,J) is used to denote these lower and upper bounds on J. For example, if (2 < j < 3-K) is in S, then LOWER(S,J) is 2, and UPPER(S,J) is 3-K.
SIMP is an algorithm that puts expressions in canonical form . See [8,7] . All outputs from the algorithms SUP, SUPP, INF, INFF, are auto matically simplified by applying the algorithms S IMP to them.
SUP and INF .
SUP and INF are each called with two arguments, J and L. J is an expression and L is a list. SUP(INF) attempts to find the largest (smallest) value that J can have con sistent with the inequalities in S. (See defi nitions of sups ~ and infs ~ in Section 2) .
L is a set of variables. The first call to (or to INF) is usually given with NIL for variables are then sometimes added to L by cursive calls to SUP and INF. See Tables SUP L; re I, II .
SUPP and INFF.
SUPP and INFF are called with arguments x and y. x is a variable and y is an expression . SUPP is called by SUP when J is a variable and J i L. Similarly INFF is called by INF . StiPP is designed to handle the case when SUP(J,L) returns an answer which contains J itself . See Tables III, IV. - ---
The action of SUP can be viewed as putting together a string of inequalities . For example, if S consists of the inequalities [(0 ~ J < k) A (0 < k < 3) I then SUP(J,NIL ) will determine (J ....: k ...: J), and r et urn 3 as the correct value . How; ver; i f S cons i st s of I (0 , J < k) A (0 ::: k :... 6- .1) I then il Re t s (J :;;: k S 6-J) and it must solve this inequality to determine: (2J < 6), (J < 3) , and again return the correct valu; 3 . This type of "solving" is done by the algorithm SUPP. That is, SUPP (and analogously INFF) handles the cases when SUP(J,L) might re turn an expression containing J it~elf .
For instance, in the above example, where S consists of I (0 < J < k) ~ (0 < k ~ 6-J)], since J is a variable and J t NIL, -the al gorithm SUP (Step 2. 2) finds the member (0 < J < k) of S with J as its middle term, and-then puts Z: = (SUP k (J}). Since SUP (k, ( J}) (eventually) returns the value (6-J), a call is made to SUPP(J, (6-J)) which returns the correct value 3. In evaluating SUPP(J, (6-J)), SUPP expresses (6-J) in the form b J + c, with b = - 1, c = 6, and returns the
On the other hand if S had consisted of [(0 < J < k) A (0 < k < 6+J)], then SUPP would have been called-with arguments J and (6 + J) which would lead to b = 1, c = 6, and result in the correct value + .x. for SUP(J,NIL). That this is the correct answer can be seen as follows: From S we get (J < k < 6+J), which implies 0 < 6 . But this is n~ restriction at all on J, -and hence ·sups J = + ''· .
Examples.
In Section 5 of [8], Tables I-IV and the sup-inf method, are used to prove (or disprove) Examples 1-4 below, and to compute the indicated values of SUP and INF given in Examples 5-9 below.
- 1 . (x < 1 + x < 2)
- (5x < 11 + 7x < 16)
- (Sx < 16 + 7x < 16) FALSE
- 4 . (2y + 3 ~ Sz A z ~ x- y A 3x ~ 5 + 2y ~ 3)
- S = ((j: 0 k)(k: 0 j +L)(L: 0 2-j}) supS k = 2 = SUP(k,NIL)
- S = ((j: 0 L)(k: j j)(L: 0 (2j -3k))) not "natural" (see Section 2) infs j = infs k = infs L = o = sups j = sups k = sup k , INF(J,NIL) = INF(k,NIL) = INF(L,NIL) = O,s SUP(j,NIL) = SUP(L,NIL) = 0, SUP(k,NIL) =+ co .
(This is the naturalized form of 6.) SUP(k,NIL) = 0 . Other values of SUP and INF are 0 as in 6 .
- S= ((k: 0 j}(j: 0 L}{L: 0 j-k+4}) . supS k = 4, SUP(k,NIL) = + ·' .
When S i s naturalized, SUP(k,NIL)=4.
- S= ((J: 0 k+L}(k: 0 S)(L: 0 k)) . INF(j,NIL) = INF(k,NIL) = INF(L,NIL) = 0, SUP(j,NIL) = 10, SUP(k,NIL) = SUP(L,NIL) = 5. Acknowledgments. I am indebted to Mabry Tyson, Michael Ballantyne and Mark Moriconi for their help on this paper .
ALOORITHM SUP p 1 L)
ALGORITHM INF(J 1 L)
| IF | ACTION | RETURN | !! | ~ | ~ | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1. | J is | a number | J | 1. | J is a | number | J | ||||
| 2. | J is a variable | J | 2. 2.1 J | J is a L | variable | J | |||||
| 2.1 2.2 | J E L J t L | Put b: = UPPER(S,J) Put Z: = SUP(b,L U (J}) | SUPP(J,Z) | 2.2 J | E t L J= | Put a: = LOWER(S,J) Put Z: = INF(a,L U (J}) | INFF(J,Z) | ||||
| 3. J | = ("-"A) J,. "/"A) (" /"INF(A,L)) | ("-"INF(A,L)) | 3. | ("-"SUP(A,L)) | (" -"SUP(A, L)) | ||||||
| 4. | Jz ("*"AN), | 4. J • | ("/"A) | = ("*"A N) | ("/"SUP(A,L)) | ||||||
| 5. | where N is a number N > 0 ("*"SUP(A,L)N)) | ("'*'' INF(A,L)N)) | 5. | J N = 0 | N > 0 N<O | ("*" INF (A, L)N) ("*"SUP (A, L )N) 0 | |||||
| 6. | N<O N = 0 J ~ ("-f''A B), where A has the form | 0 | 6. | J =("+"A B), where A has the form ("*" r A 1 ) , where r is a number and A' is a variable | |||||||
| 6.1 | ("*'' r A' ) , A' is a variable | where r is a | m.anber and | Put B 1 : = | |||||||
| 6.2 B | 1 "'B Put B':"' B' I B Put | SUP(B,LU(A'}) J' : "' | ("-f''SUP (A, L )B I) | 6.1 6.2 B' 6.2.1 J' | INF(B,L U (A'}) = B =("="A | Put J': = SIMP("+"A B') 8 1 ) | ("+"INF (A, L)B) ("+"INF (A, L)B I) | ||||
| 7. | 6.2.1 6.2.2 SIMP("+"A B') J'"' ("-f''A B 1 ) J I I ("of'' A B I) ("+''SUP (A,L)B') SUP(J',L) | 7. 6.2.2 J' | I ("+"A J = ("+''A B)Put J': = | B') | INF(J',L) | ||||||
| 7.1 | J = ("+''A B)Put J': = SIMP ("+"SUP (A, L)SUP (B,L)) | 7.1 7.2 J' | SIMP ("+"INF (A,L) INF (B, L)) J' = J I J | INF(J',L) | |||||||
| 7.2 | J' = J +oo J' I J | SUP(J',L) | 8. | MAX (INF (A, L), INF (B,L)) | |||||||
| 8. | J • ("max"A B) | MAX (SUP (A, L), SUP (B,L)) | J = ("max" A B) J = ("min"A B) | ||||||||
| 9. | J• ("min"A B) | MIN(SUP(A,L), SUP(B,L)) | 9. | MIN (INF (A, L), INF (B,L)) | |||||||
| +oo | 10. | Otherwise | |||||||||
| 10. | Otherwise | ||||||||||
ALOORITll1 SUPP (x, y)
ALGORITHM INFF(x,y)
| 1. | y is a number | y | y is a | number | y | |||
| 2. | x=y | +oo | 2. | x=y | 0 | |||
| 3. | x is not a variable | +oo | 3. | x is not | a variable | |||
| 4. | y = ("max" A B) | MAX (SUPP (x, A), SUPP(x,B)) | 4. | y = ("max"A | B) | MAX (INFF (X, A), INFF (x, B)) | ||
| 5. | y = ("min"A B) | MIN (SUPP (x, A), SUPP(x,B)) | 5. | y = ("min"A B) | MIN(INFF(X,A), INFF(x,B)) | |||
| 6. | "min" or "max" occurs in y | 6. | "min" or occurs in | "max" | ||||
| Pull or "max" fromt of getting | "min" to 8 y , y'. SUPP(x,y') | y Pull "min" or "max" ·to front of yB, getting y' | INFF(x,y') | |||||
| 7. | Otherwise express y x does not occur in as b x + c, where | b or c. | 7. | Otherwise express y as X does not | occur | b x +c, where or c. | ||
| 7.1 | b=O | y | 7.1 | b = 0 | in b | y | ||
| 7.2 | b not a number | + <» | 7.2 | b not a | number | 0 | ||
| 7.3 | b < 1 | _£.... 1-b | 7.3 | b < 1 | c l=b | |||
| 7.4 | 1 < b | +oo | 7.4 | 1 < b | 0 | |||
| 1.5 | b = 1 | 1.5 | b = 1 | |||||
| 7.5.1 | c is not a number | + oo | 7.5.1 | c is not a | number | 0 | ||
| 7.5.2 | c < 0 | 7.5.2 | c > 0 | + oo | ||||
| 7.5.3 | c ~ 0 | +oo | 7.5.3 | c ~ 0 | 0 | |||
It is clear that the methods of integer programming [11) can be used to prove theorems of the type we consider here, and similarly our procedure can be thought of as another method for solving integer programming problems.
@inproceedings{ijcai1975p3,
title = {A New Mehtod for Proving Certain Presburger Formules},
author = {Bledsoe, W. W.},
booktitle = {Proceedings of the Fourth International Joint Conference on
Artificial Intelligence, {IJCAI-75}},
publisher = {International Joint Conferences on Artificial Intelligence},
editor = {Patrick Winston and Carl Hewitt},
pages = {15--20},
year = {1975},
note = {Mathematical and Theoretical Aspects of A.I},
url = {https://ijcai.org/proceedings/1975/3},
}
TY - CPAPER TI - A New Mehtod for Proving Certain Presburger Formules AU - Bledsoe, W. W. T2 - Proceedings of the Fourth International Joint Conference on Artificial Intelligence, IJCAI-75 PB - International Joint Conferences on Artificial Intelligence PY - 1975 SP - 15 EP - 20 UR - https://ijcai.org/proceedings/1975/3 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: