20: Virtual Substitution & Real Equations 15-424: Foundations of - - PowerPoint PPT Presentation

20 virtual substitution real equations
SMART_READER_LITE
LIVE PREVIEW

20: Virtual Substitution & Real Equations 15-424: Foundations of - - PowerPoint PPT Presentation

20: Virtual Substitution & Real Equations 15-424: Foundations of Cyber-Physical Systems Andr e Platzer aplatzer@cs.cmu.edu Computer Science Department Carnegie Mellon University, Pittsburgh, PA 0.5 0.4 0.3 0.2 1.0 0.1 0.8 0.6


slide-1
SLIDE 1

20: Virtual Substitution & Real Equations

15-424: Foundations of Cyber-Physical Systems Andr´ e Platzer

aplatzer@cs.cmu.edu Computer Science Department Carnegie Mellon University, Pittsburgh, PA

0.2 0.4 0.6 0.8 1.0

0.1 0.2 0.3 0.4 0.5

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 1 / 25

slide-2
SLIDE 2

Outline

1

Learning Objectives

2

Real Arithmetic Evaluating Real Arithmetic Framing the Miracle QE Example Quantifier Elimination QE Framework Virtual Substitution by Example Linear Virtual Substitution Quadratic Virtual Substitution

3

Virtual Substitution Square Root Expression Algebra Virtual Square Root Comparisons Example

4

Summary

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 2 / 25

slide-3
SLIDE 3

Outline

1

Learning Objectives

2

Real Arithmetic Evaluating Real Arithmetic Framing the Miracle QE Example Quantifier Elimination QE Framework Virtual Substitution by Example Linear Virtual Substitution Quadratic Virtual Substitution

3

Virtual Substitution Square Root Expression Algebra Virtual Square Root Comparisons Example

4

Summary

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 2 / 25

slide-4
SLIDE 4

Learning Objectives

Virtual Substitution & Real Equations

CT M&C CPS rigorous arithmetical reasoning miracle of quantifier elimination logical trinity for reals switch between syntax & semantics at will virtual substitution lemma bridge gap between semantics and inexpressibles analytic complexity modeling tradeoffs verifying CPS at scale

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 3 / 25

slide-5
SLIDE 5

Outline

1

Learning Objectives

2

Real Arithmetic Evaluating Real Arithmetic Framing the Miracle QE Example Quantifier Elimination QE Framework Virtual Substitution by Example Linear Virtual Substitution Quadratic Virtual Substitution

3

Virtual Substitution Square Root Expression Algebra Virtual Square Root Comparisons Example

4

Summary

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 3 / 25

slide-6
SLIDE 6

Evaluating Real Arithmetic Formulas

x2 > 2 ∧ 2x < 3 ∨ x3 < x2

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-7
SLIDE 7

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-8
SLIDE 8

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω = 22 > 2 ∧ 2 · 2 < 3 ∨ 23 < 22 = false

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-9
SLIDE 9

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω = 22 > 2 ∧ 2 · 2 < 3 ∨ 23 < 22 = false When ν(x) = −1 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ν

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-10
SLIDE 10

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω = 22 > 2 ∧ 2 · 2 < 3 ∨ 23 < 22 = false When ν(x) = −1 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ν = (−1)2>2∧2 · (−1)<3∨(−1)3<(−1)2=true

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-11
SLIDE 11

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω = 22 > 2 ∧ 2 · 2 < 3 ∨ 23 < 22 = false When ν(x) = −1 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ν = (−1)2>2∧2 · (−1)<3∨(−1)3<(−1)2=true

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-12
SLIDE 12

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω = 22 > 2 ∧ 2 · 2 < 3 ∨ 23 < 22 = false When ν(x) = −1 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ν = (−1)2>2∧2 · (−1)<3∨(−1)3<(−1)2=true Are the following formulas valid? x2 > 2 ∧ 2x < 3 ∨ x3 < x2 ∀x (x2 > 2 ∧ 2x < 3 ∨ x3 < x2) ∃x (x2 > 2 ∧ 2x < 3 ∨ x3 < x2)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-13
SLIDE 13

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω = 22 > 2 ∧ 2 · 2 < 3 ∨ 23 < 22 = false When ν(x) = −1 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ν = (−1)2>2∧2 · (−1)<3∨(−1)3<(−1)2=true Are the following formulas valid? x2 > 2 ∧ 2x < 3 ∨ x3 < x2 ∀x (x2 > 2 ∧ 2x < 3 ∨ x3 < x2) ∃x (x2 > 2 ∧ 2x < 3 ∨ x3 < x2)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-14
SLIDE 14

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω = 22 > 2 ∧ 2 · 2 < 3 ∨ 23 < 22 = false When ν(x) = −1 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ν = (−1)2>2∧2 · (−1)<3∨(−1)3<(−1)2=true Are the following formulas valid? x2 > 2 ∧ 2x < 3 ∨ x3 < x2 ∀x (x2 > 2 ∧ 2x < 3 ∨ x3 < x2) ∃x (x2 > 2 ∧ 2x < 3 ∨ x3 < x2)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-15
SLIDE 15

Evaluating Real Arithmetic Formulas

When ω(x) = 2 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ω = 22 > 2 ∧ 2 · 2 < 3 ∨ 23 < 22 = false When ν(x) = −1 [ [x2 > 2 ∧ 2x < 3 ∨ x3 < x2] ]ν = (−1)2>2∧2 · (−1)<3∨(−1)3<(−1)2=true Are the following formulas valid? x2 > 2 ∧ 2x < 3 ∨ x3 < x2 ∀x (x2 > 2 ∧ 2x < 3 ∨ x3 < x2) ∃x (x2 > 2 ∧ 2x < 3 ∨ x3 < x2)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 4 / 25

slide-16
SLIDE 16

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for:

1 Propositional logic 2 FOL uninterpreted 3 FOLN[+, ·, =] 4 FOLR[+, ·, =, <] 5 FOLQ[+, ·, =] 6 FOLC[+, ·, =] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-17
SLIDE 17

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable

2 FOL uninterpreted 3 FOLN[+, ·, =] 4 FOLR[+, ·, =, <] 5 FOLQ[+, ·, =] 6 FOLC[+, ·, =] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-18
SLIDE 18

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

3 FOLN[+, ·, =] 4 FOLR[+, ·, =, <] 5 FOLQ[+, ·, =] 6 FOLC[+, ·, =] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-19
SLIDE 19

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

4 FOLR[+, ·, =, <] 5 FOLQ[+, ·, =] 6 FOLC[+, ·, =] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-20
SLIDE 20

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51]

5 FOLQ[+, ·, =] 6 FOLC[+, ·, =] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-21
SLIDE 21

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51] × FOLQ[+, ·, =] not semidecidable [Robinson’49]

6 FOLC[+, ·, =] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-22
SLIDE 22

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51] × FOLQ[+, ·, =] √ 2 ∈ Q not semidecidable [Robinson’49] FOLC[+, ·, =] decidable [Tarski’51,Chevalley’51]

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-23
SLIDE 23

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51] × FOLQ[+, ·, =] √ 2 ∈ Q not semidecidable [Robinson’49] FOLC[+, ·, =] decidable [Tarski’51,Chevalley’51]

7 FOLR[+, =, ∧, ∃] 8 FOLR[+, ≤, ∧, ∃] 9 FOLN[+, =, 2|, 3|, ...] 10 FOLR[+, ·, exp, =, <] 11 FOLR[+, ·, sin, =, <] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-24
SLIDE 24

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51] × FOLQ[+, ·, =] √ 2 ∈ Q not semidecidable [Robinson’49] FOLC[+, ·, =] decidable [Tarski’51,Chevalley’51] FOLR[+, =, ∧, ∃] decidable Gaussian elim. [179 CE]

8 FOLR[+, ≤, ∧, ∃] 9 FOLN[+, =, 2|, 3|, ...] 10 FOLR[+, ·, exp, =, <] 11 FOLR[+, ·, sin, =, <] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-25
SLIDE 25

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51] × FOLQ[+, ·, =] √ 2 ∈ Q not semidecidable [Robinson’49] FOLC[+, ·, =] decidable [Tarski’51,Chevalley’51] FOLR[+, =, ∧, ∃] decidable Gaussian elim. [179 CE] FOLR[+, ≤, ∧, ∃] decidable [Fourier 1826]

9 FOLN[+, =, 2|, 3|, ...] 10 FOLR[+, ·, exp, =, <] 11 FOLR[+, ·, sin, =, <] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-26
SLIDE 26

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51] × FOLQ[+, ·, =] √ 2 ∈ Q not semidecidable [Robinson’49] FOLC[+, ·, =] decidable [Tarski’51,Chevalley’51] FOLR[+, =, ∧, ∃] decidable Gaussian elim. [179 CE] FOLR[+, ≤, ∧, ∃] decidable [Fourier 1826] FOLN[+, =, 2|, 3|, ...] decidable [Presburger’29,Skolem’31]

10 FOLR[+, ·, exp, =, <] 11 FOLR[+, ·, sin, =, <] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-27
SLIDE 27

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51] × FOLQ[+, ·, =] √ 2 ∈ Q not semidecidable [Robinson’49] FOLC[+, ·, =] decidable [Tarski’51,Chevalley’51] FOLR[+, =, ∧, ∃] decidable Gaussian elim. [179 CE] FOLR[+, ≤, ∧, ∃] decidable [Fourier 1826] FOLN[+, =, 2|, 3|, ...] decidable [Presburger’29,Skolem’31] ? FOLR[+, ·, exp, =, <] unknown

11 FOLR[+, ·, sin, =, <] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-28
SLIDE 28

Framing the Miracle: Quiz

Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: Propositional logic decidable FOL uninterpreted semidecidable [G¨

  • del’30,Herbrand’30]

× FOLN[+, ·, =] Peano arithmetic not semidecidable [G¨

  • del’31]

FOLR[+, ·, =, <] decidable [Tarski’31..51] × FOLQ[+, ·, =] √ 2 ∈ Q not semidecidable [Robinson’49] FOLC[+, ·, =] decidable [Tarski’51,Chevalley’51] FOLR[+, =, ∧, ∃] decidable Gaussian elim. [179 CE] FOLR[+, ≤, ∧, ∃] decidable [Fourier 1826] FOLN[+, =, 2|, 3|, ...] decidable [Presburger’29,Skolem’31] ? FOLR[+, ·, exp, =, <] unknown × FOLR[+, ·, sin, =, <] not semidecidable

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

slide-29
SLIDE 29

Quantifier Elimination Projection

x y F ≡ ∃y (y ≥ 0 ∧ 1 − x − 1.83x2 + 1.66x3 > y)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

slide-30
SLIDE 30

Quantifier Elimination Projection

x y F ≡ ∃y (y ≥ 0 ∧ 1 − x − 1.83x2 + 1.66x3 > y)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

slide-31
SLIDE 31

Quantifier Elimination Projection

x y F ≡ ∃y (y ≥ 0 ∧ 1 − x − 1.83x2 + 1.66x3 > y)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

slide-32
SLIDE 32

Quantifier Elimination Projection

x y F ≡ ∃y (y ≥ 0 ∧ 1 − x − 1.83x2 + 1.66x3 > y) QE(F) ≡ 0.75 < x ∧ x < 0.68 ∨ x > 1.17 QE

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

slide-33
SLIDE 33

Quantifier Elimination Projection

x QE(F) ≡ 0.75 < x ∧ x < 0.68 ∨ x > 1.17

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

slide-34
SLIDE 34

Quantifier Elimination Projection

x F ≡ ∃y (y ≥ 0 ∧ 1 − x − 1.83x2 + 1.66x3 > y) QE(F) ≡ 0.75 < x ∧ x < 0.68 ∨ x > 1.17 QE If all but one variable fixed: Finite union of intervals. Univariate polynomials have finitely many roots.

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

slide-35
SLIDE 35

Polynomial Equations Algebraic Varieties

x y x3 = y x y x2 + y2 = 1 x y y2 = x2(x + 1) 4x3 + 4x2y + 9xy2 − 9y3 − 36x + 36y = 0 z = x2 − y2 Algebraic variety: defined by conjunction of polynomial equations

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 7 / 25

slide-36
SLIDE 36

Polynomial Inequalities Semialgebraic Sets

x y |y| ≤ x3 x y x2 + y2 ≤ 1 x y y2 = x2(x + 1) ∧ x ≤ 0.44 x y |y| ≥ x3 ∧ |y| ≤ 1.7x z = x2 − y2

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 8 / 25

slide-37
SLIDE 37

Quantifier Elimination in Real Arithmetic

Theorem (Tarski’31)

First-order logic of real arithmetic is decidable since it admits quantifier elimination, i.e. with each formula φ, a quantifier-free formula QE(φ) can be associated effectively that is equivalent, i.e. φ ↔ QE(φ) is valid.

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 9 / 25

slide-38
SLIDE 38

Quantifier Elimination in Real Arithmetic

Theorem (Tarski’31)

First-order logic of real arithmetic is decidable since it admits quantifier elimination, i.e. with each formula φ, a quantifier-free formula QE(φ) can be associated effectively that is equivalent, i.e. φ ↔ QE(φ) is valid.

Theorem (Complexity, Davenport&Heintz’88,Weispfenning’88)

(Time and space) complexity of QE for R is doubly exponential in the number of quantifier (alternations). 22O(n)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 9 / 25

slide-39
SLIDE 39

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-40
SLIDE 40

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡ y ≤ 5

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-41
SLIDE 41

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡ y ≤ 5 QE(∀y ∃x (2x2 + y ≤ 5))

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-42
SLIDE 42

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡ y ≤ 5 QE(∀y ∃x (2x2 + y ≤ 5)) ≡ QE(∀y QE(∃x (2x2 + y ≤ 5))

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-43
SLIDE 43

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡ y ≤ 5 QE(∀y ∃x (2x2 + y ≤ 5)) ≡ QE(∀y QE(∃x (2x2 + y ≤ 5)) ≡ QE(∀y (y ≤ 5))

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-44
SLIDE 44

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡ y ≤ 5 QE(∀y ∃x (2x2 + y ≤ 5)) ≡ QE(∀y QE(∃x (2x2 + y ≤ 5)) ≡ QE(∀y (y ≤ 5)) ≡ −100 ≤ 5 ∧ 5 ≤ 5 ∧ 100 ≤ 5

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-45
SLIDE 45

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡ y ≤ 5 QE(∀y ∃x (2x2 + y ≤ 5)) ≡ QE(∀y QE(∃x (2x2 + y ≤ 5)) ≡ QE(∀y (y ≤ 5)) ≡ −100 ≤ 5 ∧ 5 ≤ 5 ∧ 100 ≤ 5 ≡ false

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-46
SLIDE 46

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡ y ≤ 5 QE(∀y ∃x (2x2 + y ≤ 5)) ≡ QE(∀y QE(∃x (2x2 + y ≤ 5)) ≡ QE(∀y (y ≤ 5)) ≡ −100 ≤ 5 ∧ 5 ≤ 5 ∧ 100 ≤ 5 ≡ false QE(∃x (a = b + x2)) ≡

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-47
SLIDE 47

Quantifier Elimination Examples

QE(∃x (2x2 + y ≤ 5)) ≡ y ≤ 5 QE(∀y ∃x (2x2 + y ≤ 5)) ≡ QE(∀y QE(∃x (2x2 + y ≤ 5)) ≡ QE(∀y (y ≤ 5)) ≡ −100 ≤ 5 ∧ 5 ≤ 5 ∧ 100 ≤ 5 ≡ false QE(∃x (a = b + x2)) ≡ a ≥ b

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

slide-48
SLIDE 48

Framework: Logical Normalization for QE

QE(A ∧ B) ≡ QE(A ∨ B) ≡ QE(¬A) ≡ QE(∀x A) ≡ QE(∃x A) ≡ A not quantifier-free

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 11 / 25

slide-49
SLIDE 49

Framework: Logical Normalization for QE

QE(A ∧ B) ≡ QE(A) ∧ QE(B) QE(A ∨ B) ≡ QE(A) ∨ QE(B) QE(¬A) ≡ ¬ QE(A) QE(∀x A) ≡ QE(¬∃x ¬A) QE(∃x A) ≡ QE(∃x QE(A)) A not quantifier-free

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 11 / 25

slide-50
SLIDE 50

Framework: Logical Normalization for QE

QE(A ∧ B) ≡ QE(A) ∧ QE(B) QE(A ∨ B) ≡ QE(A) ∨ QE(B) QE(¬A) ≡ ¬ QE(A) QE(∀x A) ≡ QE(¬∃x ¬A) QE(∃x A) ≡ QE(∃x QE(A)) A not quantifier-free QE(∃x (A ∨ B)) ≡ QE(∃x ¬(A ∧ B)) ≡ QE(∃x ¬(A ∨ B)) ≡ QE(∃x ¬¬A) ≡

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 11 / 25

slide-51
SLIDE 51

Framework: Logical Normalization for QE

QE(A ∧ B) ≡ QE(A) ∧ QE(B) QE(A ∨ B) ≡ QE(A) ∨ QE(B) QE(¬A) ≡ ¬ QE(A) QE(∀x A) ≡ QE(¬∃x ¬A) QE(∃x A) ≡ QE(∃x QE(A)) A not quantifier-free QE(∃x (A ∨ B)) ≡ QE(∃x A) ∨ QE(∃x B) QE(∃x ¬(A ∧ B)) ≡ QE(∃x (¬A ∨ ¬B)) with cost QE(∃x ¬(A ∨ B)) ≡ QE(∃x (¬A ∧ ¬B)) with cost QE(∃x ¬¬A) ≡ QE(∃x A)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 11 / 25

slide-52
SLIDE 52

Framework: Logical Normalization for QE

QE(A ∧ B) ≡ QE(A) ∧ QE(B) QE(A ∨ B) ≡ QE(A) ∨ QE(B) QE(¬A) ≡ ¬ QE(A) QE(∀x A) ≡ QE(¬∃x ¬A) QE(∃x A) ≡ QE(∃x QE(A)) A not quantifier-free QE(∃x (A ∨ B)) ≡ QE(∃x A) ∨ QE(∃x B) QE(∃x ¬(A ∧ B)) ≡ QE(∃x (¬A ∨ ¬B)) with cost QE(∃x ¬(A ∨ B)) ≡ QE(∃x (¬A ∧ ¬B)) with cost QE(∃x ¬¬A) ≡ QE(∃x A) QE(∃x (A ∧ (B ∨ C))) ≡ QE(∃x ((A ∨ B) ∧ C)) ≡

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 11 / 25

slide-53
SLIDE 53

Framework: Logical Normalization for QE

QE(A ∧ B) ≡ QE(A) ∧ QE(B) QE(A ∨ B) ≡ QE(A) ∨ QE(B) QE(¬A) ≡ ¬ QE(A) QE(∀x A) ≡ QE(¬∃x ¬A) QE(∃x A) ≡ QE(∃x QE(A)) A not quantifier-free QE(∃x (A ∨ B)) ≡ QE(∃x A) ∨ QE(∃x B) QE(∃x ¬(A ∧ B)) ≡ QE(∃x (¬A ∨ ¬B)) with cost QE(∃x ¬(A ∨ B)) ≡ QE(∃x (¬A ∧ ¬B)) with cost QE(∃x ¬¬A) ≡ QE(∃x A) QE(∃x (A ∧ (B ∨ C))) ≡ QE(∃x ((A ∧ B) ∨ (A ∧ C))) if need be QE(∃x ((A ∨ B) ∧ C)) ≡ QE(∃x ((A ∧ C) ∨ (B ∧ C))) if need be

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 11 / 25

slide-54
SLIDE 54

Framework: Logical Normalization for QE

Normal Form QE(∃x (A1 ∧ . . . ∧ Ak)) with atomic Ai QE(A ∧ B) ≡ QE(A) ∧ QE(B) QE(A ∨ B) ≡ QE(A) ∨ QE(B) QE(¬A) ≡ ¬ QE(A) QE(∀x A) ≡ QE(¬∃x ¬A) QE(∃x A) ≡ QE(∃x QE(A)) A not quantifier-free QE(∃x (A ∨ B)) ≡ QE(∃x A) ∨ QE(∃x B) QE(∃x ¬(A ∧ B)) ≡ QE(∃x (¬A ∨ ¬B)) with cost QE(∃x ¬(A ∨ B)) ≡ QE(∃x (¬A ∧ ¬B)) with cost QE(∃x ¬¬A) ≡ QE(∃x A) QE(∃x (A ∧ (B ∨ C))) ≡ QE(∃x ((A ∧ B) ∨ (A ∧ C))) if need be QE(∃x ((A ∨ B) ∧ C)) ≡ QE(∃x ((A ∧ C) ∨ (B ∧ C))) if need be

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 11 / 25

slide-55
SLIDE 55

Framework: Arithmetical Normalization for QE

Normal Form QE(∃x (p1 ∼i 0 ∧ . . . ∧ pk ∼k 0)) and ∼i ∈ {>, =, ≥, =} p = q ≡ p − q = 0 p ≥ q ≡ p − q ≥ 0 p > q ≡ p − q > 0 p = q ≡ p − q = 0 p ≤ q ≡ q − p ≥ 0 p < q ≡ q − p > 0 ¬(p ≥ q) ≡ p < q ¬(p > q) ≡ p ≤ q ¬(p = q) ≡ p = q ¬(p = q) ≡ p = q

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 12 / 25

slide-56
SLIDE 56

Quantifier Elimination by Virtual Substitution

Virtual Substitution

∃x F ↔

  • t∈T

At ∧ F t

x

where terms T substituted (virtually) into F depend on F where At are quantifier-free additional compatibility conditions Needs simplifier for intermediate results

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 13 / 25

slide-57
SLIDE 57

Quantifier Elimination by Virtual Substitution

Virtual Substitution

Quantifier ∃x F ↔

  • t∈T

At ∧ F t

x

Quantifier-free where terms T substituted (virtually) into F depend on F where At are quantifier-free additional compatibility conditions Needs simplifier for intermediate results

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 13 / 25

slide-58
SLIDE 58

Virtual Substitution by Example

x Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-59
SLIDE 59

Virtual Substitution by Example

x 2

17 5

Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-60
SLIDE 60

Virtual Substitution by Example

x 2

17 5

Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

≡ (2 > 2 ∧ 2 < 17

5 )

boundary case “x = 2”

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-61
SLIDE 61

Virtual Substitution by Example

x 2

17 5

Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

≡ (2 > 2 ∧ 2 < 17

5 )

boundary case “x = 2” ∨ ( 17

5 > 2 ∧ 17 5 < 17 5 )

boundary case “x = 17

5 ”

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-62
SLIDE 62

Virtual Substitution by Example

x 2

17 5 2+ 17

5

2

Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

≡ (2 > 2 ∧ 2 < 17

5 )

boundary case “x = 2” ∨ ( 17

5 > 2 ∧ 17 5 < 17 5 )

boundary case “x = 17

5 ”

∨ (

2+ 17

5

2

> 2 ∧

2+ 17

5

2

< 17

5 )

intermediate case “x =

2+ 17

5

2

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-63
SLIDE 63

Virtual Substitution by Example

x 2

17 5 2+ 17

5

2

−∞ Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

≡ (2 > 2 ∧ 2 < 17

5 )

boundary case “x = 2” ∨ ( 17

5 > 2 ∧ 17 5 < 17 5 )

boundary case “x = 17

5 ”

∨ (

2+ 17

5

2

> 2 ∧

2+ 17

5

2

< 17

5 )

intermediate case “x =

2+ 17

5

2

” ∨ (−∞ > 2 ∧ −∞ < 17

5 )

extremal case “x = − ∞”

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-64
SLIDE 64

Virtual Substitution by Example

x 2

17 5 2+ 17

5

2

−∞ ∞ Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

≡ (2 > 2 ∧ 2 < 17

5 )

boundary case “x = 2” ∨ ( 17

5 > 2 ∧ 17 5 < 17 5 )

boundary case “x = 17

5 ”

∨ (

2+ 17

5

2

> 2 ∧

2+ 17

5

2

< 17

5 )

intermediate case “x =

2+ 17

5

2

” ∨ (−∞ > 2 ∧ −∞ < 17

5 )

extremal case “x = − ∞” ∨ (∞ > 2 ∧ ∞ < 17

5 )

extremal case “x = ∞”

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-65
SLIDE 65

Virtual Substitution by Example

x 2

17 5 2+ 17

5

2

−∞ ∞ Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

≡ (2 > 2 ∧ 2 < 17

5 )

boundary case “x = 2” ∨ ( 17

5 > 2 ∧ 17 5 < 17 5 )

boundary case “x = 17

5 ”

∨ (

2+ 17

5

2

> 2 ∧

2+ 17

5

2

< 17

5 )

intermediate case “x =

2+ 17

5

2

” ∨ (−∞ > 2 ∧ −∞ < 17

5 )

extremal case “x = − ∞” ∨ (∞ > 2 ∧ ∞ < 17

5 )

extremal case “x = ∞” ≡ true evaluate

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-66
SLIDE 66

Virtual Substitution by Example

x 2

17 5 2+ 17

5

2

−∞ ∞ Can we get rid of the quantifier without changing the semantics? ∃x(x > 2 ∧ x < 17

5 )

≡ (2 > 2 ∧ 2 < 17

5 )

boundary case “x = 2” ∨ ( 17

5 > 2 ∧ 17 5 < 17 5 )

boundary case “x = 17

5 ”

∨ (

2+ 17

5

2

> 2 ∧

2+ 17

5

2

< 17

5 )

intermediate case “x =

2+ 17

5

2

” ∨ (−∞ > 2 ∧ −∞ < 17

5 )

extremal case “x = − ∞” ∨ (∞ > 2 ∧ ∞ < 17

5 )

extremal case “x = ∞” ≡ true evaluate ∞ is not in FOLR Interior points aren’t always in FOLR Substituting them into formulas requires attention

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

slide-67
SLIDE 67

Linear Virtual Substitution

Theorem (Virtual Substitution: Linear Equation)

∃x (bx + c = 0 ∧ F) ↔

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

slide-68
SLIDE 68

Linear Virtual Substitution

Theorem (Virtual Substitution: Linear Equation)

∃x (bx + c = 0 ∧ F) ↔ F −c/b

x

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

slide-69
SLIDE 69

Linear Virtual Substitution

Theorem (Virtual Substitution: Linear Equation)

∃x (bx + c = 0 ∧ F) ↔ b = 0 ∧ F −c/b

x

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

slide-70
SLIDE 70

Linear Virtual Substitution

Theorem (Virtual Substitution: Linear Equation)

b = 0 →

  • ∃x (bx + c = 0 ∧ F) ↔ b = 0 ∧ F −c/b

x

  • Andr´

e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

slide-71
SLIDE 71

Linear Virtual Substitution

Theorem (Virtual Substitution: Linear Equation x ∈ b, c)

b = 0 →

  • ∃x (bx + c = 0 ∧ F) ↔ b = 0 ∧ F −c/b

x

  • if x ∈ b, c

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

slide-72
SLIDE 72

Linear Virtual Substitution

Theorem (Virtual Substitution: Linear Equation x ∈ b, c)

b = 0 →

  • ∃x (bx + c = 0 ∧ F) ↔ b = 0 ∧ F −c/b

x

  • if x ∈ b, c

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

slide-73
SLIDE 73

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation)

∃x (ax2 + bx + c = 0 ∧ F) ↔

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-74
SLIDE 74

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation)

∃x (ax2 + bx + c = 0 ∧ F) ↔ F (−b+

√ b2−4ac)/(2a) x

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-75
SLIDE 75

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation)

∃x (ax2 + bx + c = 0 ∧ F) ↔

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • Andr´

e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-76
SLIDE 76

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation)

∃x (ax2 + bx + c = 0 ∧ F) ↔ a = 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • Andr´

e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-77
SLIDE 77

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation)

∃x (ax2 + bx + c = 0 ∧ F) ↔ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • Andr´

e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-78
SLIDE 78

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation)

∃x (ax2 + bx + c = 0 ∧ F) ↔ a = 0 ∧ b = 0 ∧ F −c/b

x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • Andr´

e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-79
SLIDE 79

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • Andr´

e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-80
SLIDE 80

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • Andr´

e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-81
SLIDE 81

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • 1 Quantifier-free equivalent

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-82
SLIDE 82

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • 1 Quantifier-free equivalent

2 Just not a formula . . . Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-83
SLIDE 83

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • 1 Quantifier-free equivalent

2 Just not a formula . . . 3 (−b +

√ b2 − 4ac)/(2a) is not in FOLR and neither is −c/b

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-84
SLIDE 84

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) x

∨ F (−b−

√ b2−4ac)/(2a) x

  • 1 Quantifier-free equivalent

2 Just not a formula . . . 3 (−b +

√ b2 − 4ac)/(2a) is not in FOLR and neither is −c/b

4 Virtual substitution F (a+b√c)/d

¯ x

acts as if it were to substitute (a + b√c)/d for x in F

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-85
SLIDE 85

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • 1 Quantifier-free equivalent

2 Just not a formula . . . 3 (−b +

√ b2 − 4ac)/(2a) is not in FOLR and neither is −c/b

4 Virtual substitution F (a+b√c)/d

¯ x

acts as if it were to substitute (a + b√c)/d for x in F . . . it’s merely equivalent

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-86
SLIDE 86

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • 1 Quantifier-free equivalent

2 Just not a formula . . . 3 (−b +

√ b2 − 4ac)/(2a) is not in FOLR and neither is −c/b

4 Virtual substitution F (a+b√c)/d

¯ x

acts as if it were to substitute (a + b√c)/d for x in F . . . it’s merely equivalent

5 ∃r (r2 = c) would do it for √c Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-87
SLIDE 87

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • 1 Quantifier-free equivalent

2 Just not a formula . . . 3 (−b +

√ b2 − 4ac)/(2a) is not in FOLR and neither is −c/b

4 Virtual substitution F (a+b√c)/d

¯ x

acts as if it were to substitute (a + b√c)/d for x in F . . . it’s merely equivalent

5 ∃r (r2 = c) would do it for √c but that’s going in circles Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-88
SLIDE 88

Outline

1

Learning Objectives

2

Real Arithmetic Evaluating Real Arithmetic Framing the Miracle QE Example Quantifier Elimination QE Framework Virtual Substitution by Example Linear Virtual Substitution Quadratic Virtual Substitution

3

Virtual Substitution Square Root Expression Algebra Virtual Square Root Comparisons Example

4

Summary

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

slide-89
SLIDE 89

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Andr´

e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 17 / 25

slide-90
SLIDE 90

Square Root Expression Algebra

Virtual Substitution into Polynomial

Virtually substitute (a + b√c)/d into a polynomial p: p(a+b√c)/d

¯ x def

= Convention: On this slide c′ is not a derivative but just another name . . .

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 18 / 25

slide-91
SLIDE 91

Square Root Expression Algebra

Virtual Substitution into Polynomial

Virtually substitute (a + b√c)/d into a polynomial p: p(a+b√c)/d

¯ x def

= p((a + b√c)/d) Convention: On this slide c′ is not a derivative but just another name . . .

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 18 / 25

slide-92
SLIDE 92

Square Root Expression Algebra

Virtual Substitution into Polynomial

Virtually substitute (a + b√c)/d into a polynomial p: p(a+b√c)/d

¯ x def

= p((a + b√c)/d) algebraic evaluation Convention: On this slide c′ is not a derivative but just another name . . .

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 18 / 25

slide-93
SLIDE 93

Square Root Expression Algebra

Virtual Substitution into Polynomial

Virtually substitute (a + b√c)/d into a polynomial p: p(a+b√c)/d

¯ x def

= p((a + b√c)/d) algebraic evaluation

√c-algebra

Algebra of terms (a + b√c)/d with polynomials a, b, c, d ∈ Q[x1, .., xn]: ((a + b√c)/d) + ((a′ + b′√c)/d′) = ((a + b√c)/d) · ((a′ + b′√c)/d′) = Convention: On this slide c′ is not a derivative but just another name . . .

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 18 / 25

slide-94
SLIDE 94

Square Root Expression Algebra

Virtual Substitution into Polynomial

Virtually substitute (a + b√c)/d into a polynomial p: p(a+b√c)/d

¯ x def

= p((a + b√c)/d) algebraic evaluation

√c-algebra

Algebra of terms (a + b√c)/d with polynomials a, b, c, d ∈ Q[x1, .., xn]: ((a + b√c)/d) + ((a′ + b′√c)/d′) = ((ad′ + da′) + (bd′ + db′)√c)/(dd′) ((a + b√c)/d) · ((a′ + b′√c)/d′) = Convention: On this slide c′ is not a derivative but just another name . . .

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 18 / 25

slide-95
SLIDE 95

Square Root Expression Algebra

Virtual Substitution into Polynomial

Virtually substitute (a + b√c)/d into a polynomial p: p(a+b√c)/d

¯ x def

= p((a + b√c)/d) algebraic evaluation

√c-algebra

Algebra of terms (a + b√c)/d with polynomials a, b, c, d ∈ Q[x1, .., xn]: ((a + b√c)/d) + ((a′ + b′√c)/d′) = ((ad′ + da′) + (bd′ + db′)√c)/(dd′) ((a + b√c)/d) · ((a′ + b′√c)/d′) = ((aa′ + bb′c) + (ab′ + ba′)√c)/(dd′) Convention: On this slide c′ is not a derivative but just another name . . .

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 18 / 25

slide-96
SLIDE 96

Square Root Expression Algebra

Virtual Substitution into Polynomial

Virtually substitute (a + b√c)/d into a polynomial p: p(a+b√c)/d

¯ x def

= p((a + b√c)/d) algebraic evaluation

√c-algebra

Algebra of terms (a + b√c)/d with polynomials a, b, c, d ∈ Q[x1, .., xn]: where c ≥ 0, d = 0 ((a + b√c)/d) + ((a′ + b′√c)/d′) = ((ad′ + da′) + (bd′ + db′)√c)/(dd′) ((a + b√c)/d) · ((a′ + b′√c)/d′) = ((aa′ + bb′c) + (ab′ + ba′)√c)/(dd′) Convention: On this slide c′ is not a derivative but just another name . . .

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 18 / 25

slide-97
SLIDE 97

Virtual √· Substitution

Virtual Substitution into Comparisons

Virtually substitute (a + b√c)/d into a comparison p ∼ 0: (p ∼ 0)(a+b√c)/d

¯ x

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 19 / 25

slide-98
SLIDE 98

Virtual √· Substitution

Virtual Substitution into Comparisons

Virtually substitute (a + b√c)/d into a comparison p ∼ 0: (p ∼ 0)(a+b√c)/d

¯ x

≡ (p(a+b√c)/d

¯ x

∼ 0)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 19 / 25

slide-99
SLIDE 99

Virtual √· Substitution

Virtual Substitution into Comparisons

Virtually substitute (a + b√c)/d into a comparison p ∼ 0: (p ∼ 0)(a+b√c)/d

¯ x

≡ (p(a+b√c)/d

¯ x

∼ 0)

√c-comparisons d = 0 ∧ c ≥ 0

(a + 0√c)/d = 0 ≡ (a + 0√c)/d ≤ 0 ≡ (a + 0√c)/d < 0 ≡ (a + b√c)/d = 0 ≡ (a + b√c)/d ≤ 0 ≡ (a + b√c)/d < 0 ≡

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 19 / 25

slide-100
SLIDE 100

Virtual √· Substitution

Virtual Substitution into Comparisons

Virtually substitute (a + b√c)/d into a comparison p ∼ 0: (p ∼ 0)(a+b√c)/d

¯ x

≡ (p(a+b√c)/d

¯ x

∼ 0)

√c-comparisons d = 0 ∧ c ≥ 0

(a + 0√c)/d = 0 ≡ a = 0 (a + 0√c)/d ≤ 0 ≡ ad ≤ 0 (a + 0√c)/d < 0 ≡ ad < 0 (a + b√c)/d = 0 ≡ ab ≤ 0 ∧ a2 − b2c = 0 (a + b√c)/d ≤ 0 ≡ ad ≤ 0 ∧ a2 − b2c ≥ 0 ∨ bd ≤ 0 ∧ a2 − b2c ≤ 0 (a + b√c)/d < 0 ≡ ad < 0 ∧ a2 − b2c > 0 ∨ bd ≤ 0 ∧ (ad < 0 ∨ a2 − b2c < 0)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 19 / 25

slide-101
SLIDE 101

Virtual √· Substitution

Virtual Substitution into Comparisons

Virtually substitute (a + b√c)/d into a comparison p ∼ 0: (p ∼ 0)(a+b√c)/d

¯ x

≡ (p(a+b√c)/d

¯ x

∼ 0) accordingly for ∧, ∨, . . .

√c-comparisons d = 0 ∧ c ≥ 0

(a + 0√c)/d = 0 ≡ a = 0 (a + 0√c)/d ≤ 0 ≡ ad ≤ 0 (a + 0√c)/d < 0 ≡ ad < 0 (a + b√c)/d = 0 ≡ ab ≤ 0 ∧ a2 − b2c = 0 (a + b√c)/d ≤ 0 ≡ ad ≤ 0 ∧ a2 − b2c ≥ 0 ∨ bd ≤ 0 ∧ a2 − b2c ≤ 0 (a + b√c)/d < 0 ≡ ad < 0 ∧ a2 − b2c > 0 ∨ bd ≤ 0 ∧ (ad < 0 ∨ a2 − b2c < 0)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 19 / 25

slide-102
SLIDE 102

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Lemma (Virtual Substitution Lemma for √·)

F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 20 / 25

slide-103
SLIDE 103

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Lemma (Virtual Substitution Lemma for √·)

Extended logic F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

FOLR

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 20 / 25

slide-104
SLIDE 104

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Lemma (Virtual Substitution Lemma for √·)

Extended logic F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F (a+b√c)/d

¯ x

] ] where r = ([ [a] ]ω + [ [b] ]ω

  • [

[c] ]ω)/[ [d] ]ω ∈ R

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 20 / 25

slide-105
SLIDE 105

Example: Curiosity

a = 0 → (∃x (ax2 +bx +c = 0∧ax2 +bx +c ≤ 0) ↔ b2 −4ac ≥ 0∧true)

(ax2 + bx + c)

(−b+ √ b2−4ac)/(2a) ¯ x

=a((−b +

  • b2 − 4ac)/(2a))2 + b((−b +
  • b2 − 4ac)/(2a)) + c

=a((b2+b2−4ac + (−b−b)

  • b2−4ac)/(4a2)) + (−b2 + b
  • b2−4ac)/(2a) + c

=(ab2+ab2−4a2c + (−ab−ab)

  • b2−4ac)/(4a2) + (−b2+2ac + b
  • b2−4ac)/(2a)

=((ab2+ab2−4a2c)2a + (−b2+2ac)4a2 + ((−ab−ab)2a+b4a2)

  • b2−4ac)/(4a2)

=(2a2b2 + 2a2b2 − 8a3c − 4a2b2 + 8a3c + (−2a2b−2a2b+4a2b)

  • b2−4ac)/(4a2

=(0 + 0

  • b2 − 4ac)/1 = 0

(ax2+bx+c = 0)

(−b+ √ b2−4ac)/(2a) ¯ x

≡ ((0 + 0√..)/1 = 0) ≡ (0·1 = 0) ≡ true (ax2+bx+c ≤ 0)

(−b+ √ b2−4ac)/(2a) ¯ x

≡ ((0 + 0√..)/1

  • ≤ 0) ≡ (0·1 ≤ 0) ≡ true

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 21 / 25

slide-106
SLIDE 106

Example: Nonnegative Roots

a = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ x ≥ 0)

↔ b2 − 4ac ≥ 0 ∧ (2ba ≤ 0 ∧ 4ac ≥ 0 ∨ −2a ≤ 0 ∧ 4ac ≤ 0 ∨2ba ≤ 0 ∧ 4ac ≥ 0 ∨ 2a ≤ 0 ∧ 4ac ≤ 0)

  • −(−b +
  • b2−4ac)/(2a) = ((−1 + 0
  • b2−4ac)/1) · ((−b +
  • b2−4ac)/(2a

= (b −

  • b2−4ac)/(2a)

(−x ≤ 0)(b−

√ b2−4ac)/(2a) ¯ x

≡ b2a≤0 ∧ b2−(−1)2(b2−4ac)≥0 ∨ −1 · 2a≤0 ∧ b2−(−1)2(b2−4ac)≤0 ≡ 2ba ≤ 0 ∧ 4ac ≥ 0 ∨ −2a ≤ 0 ∧ 4ac ≤ 0 (−x ≤ 0)(b+

√ b2−4ac)/(2a) ¯ x

≡ b2a ≤ 0 ∧ b2 − 12(b2 − 4ac) ≥ 0 ∨ 1 · 2a ≤ 0 ∧ b2 − 12(b2 − 4ac) ≤ 0 ≡ 2ba ≤ 0 ∧ 4ac ≥ 0 ∨ 2a ≤ 0 ∧ 4ac ≤ 0

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 22 / 25

slide-107
SLIDE 107

Outline

1

Learning Objectives

2

Real Arithmetic Evaluating Real Arithmetic Framing the Miracle QE Example Quantifier Elimination QE Framework Virtual Substitution by Example Linear Virtual Substitution Quadratic Virtual Substitution

3

Virtual Substitution Square Root Expression Algebra Virtual Square Root Comparisons Example

4

Summary

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 22 / 25

slide-108
SLIDE 108

Square Root Expression Algebra

Virtual Substitution into Polynomial

Virtually substitute (a + b√c)/d into a polynomial p: p(a+b√c)/d

¯ x def

= p((a + b√c)/d) algebraic evaluation

√c-algebra

Algebra of terms (a + b√c)/d with polynomials a, b, c, d ∈ Q[x1, .., xn]: where c ≥ 0, d = 0 ((a + b√c)/d) + ((a′ + b′√c)/d′) = ((ad′ + da′) + (bd′ + db′)√c)/(dd′) ((a + b√c)/d) · ((a′ + b′√c)/d′) = ((aa′ + bb′c) + (ab′ + ba′)√c)/(dd′) Convention: On this slide c′ is not a derivative but just another name . . .

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 23 / 25

slide-109
SLIDE 109

Virtual √· Substitution

Virtual Substitution into Comparisons

Virtually substitute (a + b√c)/d into a comparison p ∼ 0: (p ∼ 0)(a+b√c)/d

¯ x

≡ (p(a+b√c)/d

¯ x

∼ 0)

√c-comparisons d = 0 ∧ c ≥ 0

(a + 0√c)/d = 0 ≡ a = 0 (a + 0√c)/d ≤ 0 ≡ ad ≤ 0 (a + 0√c)/d < 0 ≡ ad < 0 (a + b√c)/d = 0 ≡ ab ≤ 0 ∧ a2 − b2c = 0 (a + b√c)/d ≤ 0 ≡ ad ≤ 0 ∧ a2 − b2c ≥ 0 ∨ bd ≤ 0 ∧ a2 − b2c ≤ 0 (a + b√c)/d < 0 ≡ ad < 0 ∧ a2 − b2c > 0 ∨ bd ≤ 0 ∧ (ad < 0 ∨ a2 − b2c < 0)

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 24 / 25

slide-110
SLIDE 110

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Lemma (Virtual Substitution Lemma for √·)

Extended logic F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F (a+b√c)/d

¯ x

] ] where r = ([ [a] ]ω + [ [b] ]ω

  • [

[c] ]ω)/[ [d] ]ω ∈ R

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 25 / 25

slide-111
SLIDE 111

Andr´ e Platzer. Foundations of cyber-physical systems. Lecture Notes 15-424/624, Carnegie Mellon University, 2016. URL: http://www.cs.cmu.edu/~aplatzer/course/fcps16.html. Volker Weispfenning. Quantifier elimination for real algebra — the quadratic case and beyond.

  • Appl. Algebra Eng. Commun. Comput., 8(2):85–101, 1997.

Andr´ e Platzer. Logical Analysis of Hybrid Systems: Proving Theorems for Complex Dynamics. Springer, Heidelberg, 2010. doi:10.1007/978-3-642-14509-4. Saugata Basu, Richard Pollack, and Marie-Fran¸ coise Roy. Algorithms in Real Algebraic Geometry. Springer, 2nd edition, 2006. doi:10.1007/3-540-33099-2.

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 25 / 25

slide-112
SLIDE 112

Jacek Bochnak, Michel Coste, and Marie-Francoise Roy. Real Algebraic Geometry, volume 36 of Ergeb. Math. Grenzgeb. Springer, 1998. Alfred Tarski. A Decision Method for Elementary Algebra and Geometry. University of California Press, Berkeley, 2nd edition, 1951. George E. Collins. Hauptvortrag: Quantifier elimination for real closed fields by cylindrical algebraic decomposition. In H. Barkhage, editor, Automata Theory and Formal Languages, volume 33 of LNCS, pages 134–183. Springer, 1975.

Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 25 / 25