Quantifier Elimination Assia Mahboubi Syntax of first order - - PowerPoint PPT Presentation

quantifier elimination
SMART_READER_LITE
LIVE PREVIEW

Quantifier Elimination Assia Mahboubi Syntax of first order - - PowerPoint PPT Presentation

Quantifier Elimination Assia Mahboubi Syntax of first order formulae Terms T on a signature and a set X of variables are: Syntax of first order formulae Terms T on a signature and a set X of variables are: Variables: x X


slide-1
SLIDE 1

Quantifier Elimination

Assia Mahboubi

slide-2
SLIDE 2

Syntax of first order formulae

Terms T on a signature Σ and a set X of variables are:

slide-3
SLIDE 3

Syntax of first order formulae

Terms T on a signature Σ and a set X of variables are:

◮ Variables:

x ∈ X

◮ Constants:

c ∈ Σ, with arity 0

◮ Composed terms:

f (t1, . . . , tn), where f ∈ Σ has arity n and t1, . . . , tn ∈ T

slide-4
SLIDE 4

Syntax of first order formulae

Given:

◮ Terms T on a signature Σ and a set X of variables; ◮ Atoms built on a predicate signature Ψ;

slide-5
SLIDE 5

Syntax of first order formulae

Given:

◮ Terms T on a signature Σ and a set X of variables; ◮ Atoms built on a predicate signature Ψ;

First order formulae F on Σ, Ψ are:

◮ false, true

⊥, ⊤

◮ atoms

p(t1, . . . , tk) with p ∈ Ψ with arity k and t1, . . . , tk ∈ T

◮ negated formulae

¬F for F ∈ F

◮ conjunction, disjunction, implication

F1 ∧ F2, F1 ∨ F2, F1 ⇒ F2 for F1, F2 ∈ F

◮ quantified formulae

∀xF, ∃xF for F ∈ F

slide-6
SLIDE 6

Expressivity of first order statements

Consider Σlin := {0, 1, +, −} and Ψord := {=, ≤, ≥, <, >}:

slide-7
SLIDE 7

Expressivity of first order statements

Consider Σlin := {0, 1, +, −} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x + y = 0 is:

slide-8
SLIDE 8

Expressivity of first order statements

Consider Σlin := {0, 1, +, −} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x + y = 0 is:

◮ well-formed ◮ true in the (usual) model of linear rational arithmetic; ◮ false in the (usual) model of natural number arithmetic

slide-9
SLIDE 9

Expressivity of first order statements

Consider Σlin := {0, 1, +, −} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x + y = 0 is:

◮ well-formed ◮ true in the (usual) model of linear rational arithmetic; ◮ false in the (usual) model of natural number arithmetic

◮ ∀x, 2x ≥ 0 is:

slide-10
SLIDE 10

Expressivity of first order statements

Consider Σlin := {0, 1, +, −} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x + y = 0 is:

◮ well-formed ◮ true in the (usual) model of linear rational arithmetic; ◮ false in the (usual) model of natural number arithmetic

◮ ∀x, 2x ≥ 0 is:

◮ well-formed ◮ is false in the (usual) model of linear rational arithmetic; ◮ is true in the (usual) model of natural number arithmetic

slide-11
SLIDE 11

Expressivity of first order statements

Consider Σlin := {0, 1, +, −} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x + y = 0 is:

◮ well-formed ◮ true in the (usual) model of linear rational arithmetic; ◮ false in the (usual) model of natural number arithmetic

◮ ∀x, 2x ≥ 0 is:

◮ well-formed ◮ is false in the (usual) model of linear rational arithmetic; ◮ is true in the (usual) model of natural number arithmetic

◮ ∀x∃y, x ∗ y = 0 is:

slide-12
SLIDE 12

Expressivity of first order statements

Consider Σlin := {0, 1, +, −} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x + y = 0 is:

◮ well-formed ◮ true in the (usual) model of linear rational arithmetic; ◮ false in the (usual) model of natural number arithmetic

◮ ∀x, 2x ≥ 0 is:

◮ well-formed ◮ is false in the (usual) model of linear rational arithmetic; ◮ is true in the (usual) model of natural number arithmetic

◮ ∀x∃y, x ∗ y = 0 is:

◮ not a well-formed first-order statement on Σlin, Ψord.

slide-13
SLIDE 13

Expressivity of first order statements

Consider Σring := {0, 1, +, −, ∗} and Ψord := {=, ≤, ≥, <, >}:

slide-14
SLIDE 14

Expressivity of first order statements

Consider Σring := {0, 1, +, −, ∗} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x ∗ y = 0

slide-15
SLIDE 15

Expressivity of first order statements

Consider Σring := {0, 1, +, −, ∗} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x ∗ y = 0

◮ well-formed; ◮ valid in any instance of ring structure.

slide-16
SLIDE 16

Expressivity of first order statements

Consider Σring := {0, 1, +, −, ∗} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x ∗ y = 0

◮ well-formed; ◮ valid in any instance of ring structure.

◮ ∀n∀x∀y∀z,

[¬[(x = 0) ∧ (y = 0) ∧ (z = 0)] ∧ n > 2] ⇒ ¬(xn + yn = zn)

slide-17
SLIDE 17

Expressivity of first order statements

Consider Σring := {0, 1, +, −, ∗} and Ψord := {=, ≤, ≥, <, >}:

◮ ∀x∃y, x ∗ y = 0

◮ well-formed; ◮ valid in any instance of ring structure.

◮ ∀n∀x∀y∀z,

[¬[(x = 0) ∧ (y = 0) ∧ (z = 0)] ∧ n > 2] ⇒ ¬(xn + yn = zn)

◮ not a well-formed first-order statement on Σring, Ψord; ◮ yet valid in the model of integer arithmetic

(Wiles, 1995)

slide-18
SLIDE 18

Decidability of a first order theory

For some

◮ term signature Σ, predicate signature Ψ and set of variables X; ◮ theory T on these signatures;

there is an algorithm which (terminates and) decides whether: T F for any closed first-order formula F on Σ, Ψ. We say that T is decidable (its Σ, Ψ first-order consequences are).

slide-19
SLIDE 19

Quantifier elimination

A theory T admits quantifier elimination if for every formula F(x), there exists a formula G(x) such that:

◮ For any model M of T, and any assignment e for x:

M e F iff M e G

◮ G(x) is quantifier-free.

Quantifier elimination reduces the decidability of formulae to the decidability of (closed) atoms.

slide-20
SLIDE 20

Reduction theorem

Theorem: If:

◮ (i) for every atom p, for any model M and assignment e:

M e p ∨ ¬p

◮ (ii) for every formula F(x) of the form:

∃y, α1(y, x) ∧ . . . , ∧αn(y, x) where each αi(y, x) is a literal, there is a formula G(x) such that for any model M and assignment e:

◮ M e F(x) iff M e G(x) ◮ G(x) is quantifier-free.

Then theory T admits quantifier elimination (constructively).

slide-21
SLIDE 21

Reduction theorem

By induction on the depth of the formula, eliminating first the inner-most quantifier.

slide-22
SLIDE 22

Reduction theorem

Let F(x) := ∃y, F1(y, x) with F1 is quantifier free:

◮ We can put F1 in DNF form:

⊢ F1(y, x) ⇔ [

  • k

(

  • i

αi,k(y, x))]

◮ Now the ∃ quantifier distributes over disjunctions:

⊢ [∃y, F1(y, x)] ⇔ [

  • k

∃y, (

  • i

αi,k(y, x))]

◮ And hypothesis (ii) applies for each k, and gives:

  • k

Gk(x)

slide-23
SLIDE 23

Reduction theorem

Let F(x) := ∀y, F1(y, x) with F1 is quantifier free:

◮ F is (semantically) equivalent to ¬∃y, ¬F1(y, x); ◮ ¬F1 is quantifier free and can be converted in DNF form; ◮ and the rest of the proof is similar to the previous case.

slide-24
SLIDE 24

Meaning of the reduction theorem

Polyhedrons, for linear arithmetics

π π

1 2

Semi-algebraic varieties, for non linear arithmetics

slide-25
SLIDE 25

Geometrical interpretation

These can be highly non trivial results...

slide-26
SLIDE 26

Complexity issues

◮ Our sufficient criterium is good for theoretical intuition. ◮ But it crucially involves DNF conversion.

More realistic algorithms require an additional ingredient.

slide-27
SLIDE 27

Linear integer arithmetic

Signature: Σ := {0, 1, +, −} and Ψ := {=, <}. Axioms:

◮ Total order: < is a total order ◮ Non trivial: ∀x, ¬(0 = x + 1) ◮ Regular successor: ∀x, x + 1 = y + 1 ⇒ x = y ◮ Neutral zero: ∀x, x + 0 = x ◮ Associativity: ∀x∀y, x + (y + 1) = (x + y) + 1 ◮ Additive inverse: ∀x, x + (−x) = 0 ◮ Recursion scheme: for any first order statement P,

[P(0) ∧ ∀x, (P(x) ⇒ P(x + 1))] ⇒ ∀x, P(x)

slide-28
SLIDE 28

Linear integer arithmetic

◮ This theory is decidable (Presburger, 1929).

slide-29
SLIDE 29

Linear integer arithmetic

◮ This theory is decidable (Presburger, 1929). ◮ This theory does not have quantifier elimination:

∃x, y = x + x has no quantifier-free equivalent in this signature.

slide-30
SLIDE 30

Linear integer arithmetic

◮ This theory is decidable (Presburger, 1929). ◮ This theory does not have quantifier elimination:

∃x, y = x + x has no quantifier-free equivalent in this signature.

◮ We hence extend Ψ with an infinite number of (divisibility)

predicates n | . for n ≥ 2. By definition: n | y means ∃x, y = x + · · · + x

slide-31
SLIDE 31

Linear integer arithmetic

◮ This theory is decidable (Presburger, 1929). ◮ This theory does not have quantifier elimination:

∃x, y = x + x has no quantifier-free equivalent in this signature.

◮ We hence extend Ψ with an infinite number of (divisibility)

predicates n | . for n ≥ 2. By definition: n | y means ∃x, y = x + · · · + x Cooper’s QE algorithm (1972) avoids DNF transformations.

slide-32
SLIDE 32

Example: Linear integer arithmetic

Consider ∃x, F(x, y), where F(x, y) is quantifier-free (but arbitrarily complex in the other connectives).

◮ We transform F(x, y) so that it features only ∨, ∧ and ¬. ◮ Without loss of generality, we can suppose that all the terms

  • ccurring in F(x, y) have the form:

cx + c1y1 + · · · + cnyn + k where c1, . . . , cn, k are numeral constants.

slide-33
SLIDE 33

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F(x, y) is quantifier-free (but arbitrarily complex in the other connectives).

◮ Every atom which does not feature x is moved out of the

scope of the quantifier.

◮ All negated inequalities ¬(s < t) are replaced by a positive

equivalent (t < s + 1).

◮ Every left hand side is set at zero: t = s becomes 0 = t − s

and t < s becomes 0 < t − s. Now F(x, y) features only literals of the form: 0 = t, ¬(0 = t), 0 < t, n|t, ¬(n|t) where the t are normalised terms with free variables in {x, y}. We say that F(x, y) itself is normalised.

slide-34
SLIDE 34

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F(x, y) is quantifier-free and normalised. Let ℓ be the least common multiple (lcm) of all the coefficients of

  • ccurrences of x in F(x, y).

We can transform F(x, y) so that every occurrence of x has coefficient ℓ.

◮ “Multiply”equality and divisibility atoms featuring a cx by ℓ c ◮ “Multiply”inequality atoms featuring a cx by | ℓ c |

Now ∃x, F(x, y)(x) has the form ∃x, G(ℓx, y).

slide-35
SLIDE 35

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F(x, y) is quantifier-free and normalised. Now ∃x, F(x, y)(x) has the form ∃x, G(ℓx, y):

◮ By a simple change of variable, it is hence equivalent to:

∃z, G(z, y) ∧ ℓ|z

◮ And all occurrences of z is G(z, y) have coefficient 1 or −1.

slide-36
SLIDE 36

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F(x, y) is quantifier-free, normalised, such that all coefficients of x in F(x, y) are 1 or −1. Consider an assignment v, for the free variables y. There are (exactly) two ways for the (closed) formula ∃x, F(x, v) to be true:

◮ Either F(x, v) is true for arbitrarily small values x; ◮ Or there exists a smallest x0 that makes F(x0, v) true.

But the situation may of course depend on the value of v so we have to investigate both behaviours.

slide-37
SLIDE 37

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F(x, y) is quantifier-free, normalised, such that all coefficients of x in F(x, y) are 1 or −1. First case: arbitrary small solutions. We perform the following transformations on F(x, y):

◮ Equality atoms 0 = t featuring 1.x are turned to ⊥ ◮ Inequality atoms 0 < t featuring 1.x are turned to ⊥ ◮ Order atoms 0 < t featuring −1.x are turned to ⊤ ◮ Other atoms stay unchanged.

and we call F−∞(x, y) the obtained formula: note that it only contains divisibility atoms.

slide-38
SLIDE 38

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F(x, y) is quantifier-free, normalised, such that all coefficients of x in F(x, y) are 1 or −1. Divisibility atoms are of the shape: n1 | x + p1(y), . . . nk | x + pk(y) Let m is the lcm of n1, . . . , nk: if a witness exists for F−∞(x, y), it can be found among 1, . . . , m.

slide-39
SLIDE 39

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F(x, y) is quantifier-free, normalised, such that all coefficients of x in F(x, y) are 1 or −1. First case: arbitrary small solutions.

◮ Our formalisation is right:

[∀z∃x, (x < z ∧ F(x, y))] ⇔ [∃x, F−∞(x, y)]

◮ And leads to a quantifier-free expression:

[∀z∃x, (x < z ∧ F(x, y))] ⇔ [

m

  • i=1

F−∞(x → i, y)]] where m is the lcm of the all the divisor numerals occurring in F−∞(x, y). Proofs left as exercises...

slide-40
SLIDE 40

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F is quantifier-free, normalised, such that all coefficients of x in F(x, y) are 1 or −1. Second case: a smallest solution. We can now construct a set BF of terms that surely contains a witness if there is one: For each literal α(x, y), we put in BF a term t(y) such that α(x → t(y), y) does not hold, but α(x → t(y) + 1, y) holds:

◮ Equality atoms 0 = 1.x + t(y) : put −(t(y) + 1) in BF ◮ Inequality atoms ¬(0 = 1.x + t(y)) : put −t(y) in BF ◮ Inequality atoms 0 < 1.x + t(y) : put −t(y) in BF

Other atoms do not contribute to BF.

slide-41
SLIDE 41

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F is quantifier-free, normalised, such that all coefficients of x in F(x, y) are 1 or −1. Second case: a smallest solution. Theorem:Let m be the lcm of all the all the divisor numerals

  • ccurring in F and v a valuation. For all integers i, if F(x → i, v)

holds but F(x → i − m, v) does not, then i = bv + j for some b ∈ BF and some j ∈ {1 . . . m}. Proof: By structural induction on F(x, y). Exercise.

slide-42
SLIDE 42

Example: Linear integer arithmetic

Consider (∃x, F(x, y)), where F is quantifier-free, normalised, such that all coefficients of x in F(x, y) are 1 or −1. Then, with the previous definitions: T ∃x, F(x, y) ⇔ T

m

  • j=1

(F−∞(x → j, y) ∨

  • b∈BF

m

  • j=1

F(x → b + j, y))

slide-43
SLIDE 43

Other examples

Doubly exponential in the number of quantifiers:

◮ Linear integer arithmetics (Cooper) ◮ Linear real arithmetics (Ferrante-Rackhoff) ◮ Non-linear real arithmetics

slide-44
SLIDE 44

Real closed fields

Signature: Σ := {0, 1, +, ×} and P := {=, <}. Axioms:

◮ Total order: < is a total order ◮ Ordered field ◮ Intermediate value theorem holds for polynomials

Models: Real numbers, real algebraic numbers, Puiseux series,... Intuition: Fields with the same first order theory as real numbers.

slide-45
SLIDE 45

Decidability, algorithms

◮ A Decision Method for Elementary Algebra and Geometry.

Tarski (1948)

◮ Decision procedures for real and p-adic fields. Cohen (1969) -

The Analysis of Linear Partial Differential Operators II. H¨

  • rmander (1983)

◮ Quantifier elimination for real closed fields by cylindrical

algebraic decomposition. Collins (1976)

◮ ...

slide-46
SLIDE 46

Real algebraic geometry

slide-47
SLIDE 47

Example

∃X, AX 2 + BX + C = 0 ⇔ [(A = 0) ∧ (B2 − 4AC ≥ 0)] ∨ [A = 0 ∧ B = 0] ∨ [A = B = C = 0]

slide-48
SLIDE 48

One variable

∃x, P(x) = 0 ∧ Q1(x) ⊲1 0 ∧ . . . Ql(x) ⊲n 0

◮ Isolate the roots of P, Q1, . . . Ql; ◮ Obtain the signs of P, Q1, . . . Ql at these roots; ◮ Obtain the signs of P, Q1, . . . Ql outside these roots.

slide-49
SLIDE 49

Cylindrical Algebraic Decomposition

Example: X 2 + Y 2 + Z 2 − 1

π π

1 2

slide-50
SLIDE 50

CAD in a nutshell

R[X1, . . . , Xn+1] R[X1, . . . , Xn] P = P1, . . . , Ps

projection

Q = Q1, . . . , Qt CAD and signs for P CAD and signs for Q

lifting

  • Rn+1

Rn

slide-51
SLIDE 51

CAD in a nutshell

◮ Uniform behavior of the initial (n + 1)-dimensional family

  • ver each cell of the n-dimensional family;

◮ (n + 1)-cells as pieces of cylinders above n dimension cells. ◮ One sample point per n-dimensional cell; ◮ Root isolation on fibers above the sample points;

slide-52
SLIDE 52

Cylindrical Algebraic Decomposition

Example: X 2 + Y 2 + Z 2 − 1

π π

1 2

slide-53
SLIDE 53

Sturm sequences

Let P ∈ R[X] non constant. Sturm sequence of P: P0 = P, P1 = P′, . . . , Pi+1 = −rem(Pi−1Pi), PK where PK = gcd(P, P′). For a ∈ R, vP(a) is the number of sign changes in the sequence: P0(a), . . . , PK(a)

slide-54
SLIDE 54

Sturm sequences and root counting

Theorem (Sturm): Let a < b in R, with P(a), P(b) = 0. The number of roots of P in the interval (a, b) is equal to vP(a) − vP(b).

slide-55
SLIDE 55

Sturm sequences and sign conditions

Let P, Q ∈ R[X] non constant. Sturm sequence of P, Q: P0 = P, P1 = P′Q, . . . , Pi+1 = −rem(Pi−1Pi), PK where PK − gcd(P, P′). For a ∈ R, vP,Q(a) is the number of sign changes in the sequence: P0(a), . . . , PK(a)

slide-56
SLIDE 56

Sturm sequences and root counting

Theorem (Sturm): Let a < b in R, with P(a), P(b) = 0. vP,Q(a) − vP,Q(b) =

  • c∈(a,b)

P(c)=0

sign(Q(c)) where sign(x) = 1 if x > 0, = −1 if x < 0, sign(0) =

slide-57
SLIDE 57

Tarski Queries

Denote TaQ(Q, P) =

c,P(c)=0 sign(Q(c)).

Computing: TaQ(1, P), TaQ(Q, P), TaQ(Q2, P) describes all the possible signs of Q at the roots of P.

slide-58
SLIDE 58

More sign conditions

Computing: TaQ(Qǫ1

1 . . . Qǫl l , P), for every ǫ = (ǫ1, . . . , ǫl) ∈ {0, 1, 2}l

describes all the possible signs of Q at the roots of P.

slide-59
SLIDE 59

Preparing the parametric variant

Let P, Q ∈ R[X] non constant. Let σ be a sign condition on Q at roots of P. The realizability of σ is determined by:

◮ Signs of leading coefficients in the Sturm sequence of P, Q; ◮ Degrees of polynomials in the Sturm sequence of P, Q.

A similar remak holds for:

◮ sign conditions of Q1, . . . Ql at roots of P; ◮ strict sign conditions on Q1, . . . Ql.

slide-60
SLIDE 60

Example

P = X 4 + aX 2 + bX + c

slide-61
SLIDE 61

CAD in a nutshell

R[X1, . . . , Xn+1] R[X1, . . . , Xn] P = P1, . . . , Ps

projection

Q = Q1, . . . , Qt CAD and signs for P CAD and signs for Q

lifting

  • Rn+1

Rn

slide-62
SLIDE 62

Projection Operator

Possible elimination of Xn+1 in P = P1, . . . , Ps ⊂ R[X1, . . . , Xn+1]:

◮ Keep constant polynomials in Xn+1; ◮ Add leading coefficients in the appropriate Sturm sequences; ◮ Include elimination of all the variants obtained by truncation.

slide-63
SLIDE 63

Projection Operator

Possible elimination of Xn+1 in P = P1, . . . , Ps ⊂ R[X1, . . . , Xn+1]:

◮ Keep constant polynomials in Xn+1; ◮ Add leading coefficients in the appropriate Sturm sequences; ◮ Include elimination of all the variants obtained by truncation.

In practice (Collins): Use subresultant coefficients instead of Sturm sequences.

slide-64
SLIDE 64

Projection Operator

Elimination En+1(P) of Xn+1 in P = P1, . . . , Ps ⊂ R[X1, . . . , Xn+1]:

◮ Keep constant polynomials in Xn+1; ◮ Add subresultant coefficients of Pi and P′ i ; ◮ Add subresultant coefficients of Pi and Pj; ◮ Include elimination of all the variants obtained by truncation

slide-65
SLIDE 65

Implementations

◮ QEPCAD ◮ Mathematica (A. Strzebo´

nski)

◮ Redlog/Reduce ◮ ...

slide-66
SLIDE 66

Further Reading

This lecture largely borrowed from the following references:

◮ A course on decision procedures by Cesare Tinelli, with a lot

  • f reading material and a nice bibliography of research papers.

◮ A book, The Calculus of Computation by A. R. Bradley and

  • Z. Manna

◮ Another book and companion OCaml code, Handbook of

Practical Logic and Automated Reasoning by J. Harrison

slide-67
SLIDE 67

Further Reading

Decision procedures for non-linear arithmetics:

◮ An introduction to semi-algebraic geometry by Michel Coste ◮ Algorithms in Real Algebraic Geometry by Saugata Basu

Richard Pollack and Marie-Fran¸ coise Roy

◮ How to use Cylindrical Algebraic Decomposition by Manuel

Kauers, S´ eminaire Lotharingien de Combinatoire 65 (2011)

◮ Delta-Decidability over the Reals, by Sicun Gao, Jeremy

Avigad, Edmund Clarke (LICS’12) and the d-real solver

◮ Solving non-linear arithmetic by Dejan Jovanovi´

c and Leonardo de Moura (IJCAR’12)