20 virtual substitution real equations
play

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


  1. Framing the Miracle: Quiz Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: � Propositional logic decidable � FOL uninterpreted semidecidable [G¨ odel’30,Herbrand’30] × FOL N [+ , · , =] Peano arithmetic not semidecidable [G¨ odel’31] � FOL R [+ , · , = , < ] decidable [Tarski’31..51] √ × FOL Q [+ , · , =] 2 �∈ Q not semidecidable [Robinson’49] � FOL C [+ , · , =] decidable [Tarski’51,Chevalley’51] 7 FOL R [+ , = , ∧ , ∃ ] 8 FOL R [+ , ≤ , ∧ , ∃ ] 9 FOL N [+ , = , 2 | , 3 | , ... ] 10 FOL R [+ , · , exp , = , < ] 11 FOL R [+ , · , sin , = , < ] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

  2. Framing the Miracle: Quiz Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: � Propositional logic decidable � FOL uninterpreted semidecidable [G¨ odel’30,Herbrand’30] × FOL N [+ , · , =] Peano arithmetic not semidecidable [G¨ odel’31] � FOL R [+ , · , = , < ] decidable [Tarski’31..51] √ × FOL Q [+ , · , =] 2 �∈ Q not semidecidable [Robinson’49] � FOL C [+ , · , =] decidable [Tarski’51,Chevalley’51] � FOL R [+ , = , ∧ , ∃ ] decidable Gaussian elim. [179 CE] 8 FOL R [+ , ≤ , ∧ , ∃ ] 9 FOL N [+ , = , 2 | , 3 | , ... ] 10 FOL R [+ , · , exp , = , < ] 11 FOL R [+ , · , sin , = , < ] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

  3. Framing the Miracle: Quiz Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: � Propositional logic decidable � FOL uninterpreted semidecidable [G¨ odel’30,Herbrand’30] × FOL N [+ , · , =] Peano arithmetic not semidecidable [G¨ odel’31] � FOL R [+ , · , = , < ] decidable [Tarski’31..51] √ × FOL Q [+ , · , =] 2 �∈ Q not semidecidable [Robinson’49] � FOL C [+ , · , =] decidable [Tarski’51,Chevalley’51] � FOL R [+ , = , ∧ , ∃ ] decidable Gaussian elim. [179 CE] � FOL R [+ , ≤ , ∧ , ∃ ] decidable [Fourier 1826] 9 FOL N [+ , = , 2 | , 3 | , ... ] 10 FOL R [+ , · , exp , = , < ] 11 FOL R [+ , · , sin , = , < ] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

  4. Framing the Miracle: Quiz Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: � Propositional logic decidable � FOL uninterpreted semidecidable [G¨ odel’30,Herbrand’30] × FOL N [+ , · , =] Peano arithmetic not semidecidable [G¨ odel’31] � FOL R [+ , · , = , < ] decidable [Tarski’31..51] √ × FOL Q [+ , · , =] 2 �∈ Q not semidecidable [Robinson’49] � FOL C [+ , · , =] decidable [Tarski’51,Chevalley’51] � FOL R [+ , = , ∧ , ∃ ] decidable Gaussian elim. [179 CE] � FOL R [+ , ≤ , ∧ , ∃ ] decidable [Fourier 1826] � FOL N [+ , = , 2 | , 3 | , ... ] decidable [Presburger’29,Skolem’31] 10 FOL R [+ , · , exp , = , < ] 11 FOL R [+ , · , sin , = , < ] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

  5. Framing the Miracle: Quiz Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: � Propositional logic decidable � FOL uninterpreted semidecidable [G¨ odel’30,Herbrand’30] × FOL N [+ , · , =] Peano arithmetic not semidecidable [G¨ odel’31] � FOL R [+ , · , = , < ] decidable [Tarski’31..51] √ × FOL Q [+ , · , =] 2 �∈ Q not semidecidable [Robinson’49] � FOL C [+ , · , =] decidable [Tarski’51,Chevalley’51] � FOL R [+ , = , ∧ , ∃ ] decidable Gaussian elim. [179 CE] � FOL R [+ , ≤ , ∧ , ∃ ] decidable [Fourier 1826] � FOL N [+ , = , 2 | , 3 | , ... ] decidable [Presburger’29,Skolem’31] ? FOL R [+ , · , exp , = , < ] unknown 11 FOL R [+ , · , sin , = , < ] Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

  6. Framing the Miracle: Quiz Is validity of formulas decidable/semidecidable/undecidable/not semidecidable for: � Propositional logic decidable � FOL uninterpreted semidecidable [G¨ odel’30,Herbrand’30] × FOL N [+ , · , =] Peano arithmetic not semidecidable [G¨ odel’31] � FOL R [+ , · , = , < ] decidable [Tarski’31..51] √ × FOL Q [+ , · , =] 2 �∈ Q not semidecidable [Robinson’49] � FOL C [+ , · , =] decidable [Tarski’51,Chevalley’51] � FOL R [+ , = , ∧ , ∃ ] decidable Gaussian elim. [179 CE] � FOL R [+ , ≤ , ∧ , ∃ ] decidable [Fourier 1826] � FOL N [+ , = , 2 | , 3 | , ... ] decidable [Presburger’29,Skolem’31] ? FOL R [+ , · , exp , = , < ] unknown × FOL R [+ , · , sin , = , < ] not semidecidable Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 5 / 25

  7. Quantifier Elimination � Projection F ≡ ∃ y ( y ≥ 0 ∧ 1 − x − 1 . 83 x 2 + 1 . 66 x 3 > y ) y x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

  8. Quantifier Elimination � Projection F ≡ ∃ y ( y ≥ 0 ∧ 1 − x − 1 . 83 x 2 + 1 . 66 x 3 > y ) y x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

  9. Quantifier Elimination � Projection F ≡ ∃ y ( y ≥ 0 ∧ 1 − x − 1 . 83 x 2 + 1 . 66 x 3 > y ) y x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

  10. Quantifier Elimination � Projection F ≡ ∃ y ( y ≥ 0 ∧ 1 − x − 1 . 83 x 2 + 1 . 66 x 3 > y ) y QE x QE( F ) ≡ 0 . 75 < x ∧ x < 0 . 68 ∨ x > 1 . 17 Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 6 / 25

  11. 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

  12. Quantifier Elimination � Projection F ≡ ∃ y ( y ≥ 0 ∧ 1 − x − 1 . 83 x 2 + 1 . 66 x 3 > y ) QE x QE( F ) ≡ 0 . 75 < x ∧ x < 0 . 68 ∨ x > 1 . 17 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

  13. Polynomial Equations � Algebraic Varieties y y y x 2 + y 2 = 1 x 3 = y x x x y 2 = x 2 ( x + 1) z = x 2 − y 2 4 x 3 + 4 x 2 y + 9 xy 2 − 9 y 3 − 36 x + 36 y = 0 Algebraic variety: defined by conjunction of polynomial equations Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 7 / 25

  14. Polynomial Inequalities � Semialgebraic Sets y y y x 2 + y 2 ≤ 1 | y | ≤ x 3 x x x y 2 = x 2 ( x + 1) y ∧ x ≤ 0 . 44 | y | ≥ x 3 ∧ | y | ≤ 1 . 7 x z = x 2 − y 2 x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 8 / 25

  15. 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

  16. 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). 2 2 O ( n ) Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 9 / 25

  17. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

  18. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ y ≤ 5 Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

  19. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ y ≤ 5 QE( ∀ y ∃ x (2 x 2 + y ≤ 5)) Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

  20. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ y ≤ 5 QE( ∀ y ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y QE( ∃ x (2 x 2 + y ≤ 5)) Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

  21. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ y ≤ 5 QE( ∀ y ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y QE( ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y ( y ≤ 5)) Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

  22. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ y ≤ 5 QE( ∀ y ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y QE( ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y ( y ≤ 5)) ≡ − 100 ≤ 5 ∧ 5 ≤ 5 ∧ 100 ≤ 5 Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

  23. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ y ≤ 5 QE( ∀ y ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y QE( ∃ x (2 x 2 + 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

  24. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ y ≤ 5 QE( ∀ y ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y QE( ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y ( y ≤ 5)) ≡ − 100 ≤ 5 ∧ 5 ≤ 5 ∧ 100 ≤ 5 ≡ false QE( ∃ x ( a = b + x 2 )) ≡ Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

  25. Quantifier Elimination Examples QE( ∃ x (2 x 2 + y ≤ 5)) ≡ y ≤ 5 QE( ∀ y ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y QE( ∃ x (2 x 2 + y ≤ 5)) ≡ QE( ∀ y ( y ≤ 5)) ≡ − 100 ≤ 5 ∧ 5 ≤ 5 ∧ 100 ≤ 5 ≡ false QE( ∃ x ( a = b + x 2 )) ≡ a ≥ b Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 10 / 25

  26. 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

  27. 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

  28. 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

  29. 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

  30. 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

  31. 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

  32. Framework: Logical Normalization for QE QE( ∃ x ( A 1 ∧ . . . ∧ A k )) with atomic A i Normal Form 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

  33. Framework: Arithmetical Normalization for QE QE( ∃ x ( p 1 ∼ i 0 ∧ . . . ∧ p k ∼ k 0)) and ∼ i ∈ { >, = , ≥ , � = } Normal Form 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

  34. Quantifier Elimination by Virtual Substitution Virtual Substitution � A t ∧ F t ∃ x F ↔ x t ∈ T where terms T substituted (virtually) into F depend on F where A t are quantifier-free additional compatibility conditions Needs simplifier for intermediate results Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 13 / 25

  35. Quantifier Elimination by Virtual Substitution Virtual Substitution � Quantifier Quantifier-free A t ∧ F t ∃ x F ↔ x t ∈ T where terms T substituted (virtually) into F depend on F where A t are quantifier-free additional compatibility conditions Needs simplifier for intermediate results Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 13 / 25

  36. Virtual Substitution by Example x 0 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

  37. Virtual Substitution by Example x 0 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

  38. Virtual Substitution by Example x 0 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

  39. Virtual Substitution by Example x 0 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 boundary case “ x = 17 ∨ 5 ) 5 ” Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

  40. Virtual Substitution by Example x 0 2+ 17 2 17 5 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 boundary case “ x = 17 ∨ 5 ) 5 ” 2+ 17 2+ 17 2+ 17 < 17 ∨ ( 5 > 2 ∧ 5 5 ) intermediate case “ x = 5 ” 2 2 2 Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

  41. Virtual Substitution by Example x −∞ 0 2+ 17 2 17 5 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 boundary case “ x = 17 ∨ 5 ) 5 ” 2+ 17 2+ 17 2+ 17 < 17 ∨ ( 5 > 2 ∧ 5 5 ) intermediate case “ x = 5 ” 2 2 2 ( −∞ > 2 ∧ −∞ < 17 ∨ 5 ) extremal case “ x = − ∞ ” Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

  42. Virtual Substitution by Example x ∞ −∞ 0 2+ 17 2 17 5 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 boundary case “ x = 17 ∨ 5 ) 5 ” 2+ 17 2+ 17 2+ 17 < 17 ∨ ( 5 > 2 ∧ 5 5 ) intermediate case “ x = 5 ” 2 2 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

  43. Virtual Substitution by Example x ∞ −∞ 0 2+ 17 2 17 5 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 boundary case “ x = 17 ∨ 5 ) 5 ” 2+ 17 2+ 17 2+ 17 < 17 ∨ ( 5 > 2 ∧ 5 5 ) intermediate case “ x = 5 ” 2 2 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

  44. Virtual Substitution by Example x ∞ −∞ 0 2+ 17 2 17 5 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 boundary case “ x = 17 ∨ 5 ) 5 ” 2+ 17 2+ 17 2+ 17 < 17 ∨ ( 5 > 2 ∧ 5 5 ) intermediate case “ x = 5 ” 2 2 2 ( −∞ > 2 ∧ −∞ < 17 ∨ 5 ) extremal case “ x = − ∞ ” ( ∞ > 2 ∧ ∞ < 17 ∨ 5 ) extremal case “ x = ∞ ” ≡ true evaluate ∞ is not in FOL R Interior points aren’t always in FOL R Substituting them into formulas requires attention Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 14 / 25

  45. 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

  46. 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

  47. 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

  48. Linear Virtual Substitution Theorem (Virtual Substitution: Linear Equation) � � ∃ x ( bx + c = 0 ∧ F ) ↔ b � = 0 ∧ F − c / b b � = 0 → x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

  49. Linear Virtual Substitution Theorem (Virtual Substitution: Linear Equation x �∈ b , c ) � � ∃ x ( bx + c = 0 ∧ F ) ↔ b � = 0 ∧ F − c / b b � = 0 → if x �∈ b , c x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

  50. Linear Virtual Substitution Theorem (Virtual Substitution: Linear Equation x �∈ b , c ) � � ∃ x ( bx + c = 0 ∧ F ) ↔ b � = 0 ∧ F − c / b b � = 0 → if x �∈ b , c x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 15 / 25

  51. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation) ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  52. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation) ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ √ F ( − b + b 2 − 4 ac ) / (2 a ) x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  53. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation) ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ √ √ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) � x x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  54. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation) ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ √ √ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) � a � = 0 ∧ x x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  55. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation) ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ √ √ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) � x x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  56. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation) ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x √ √ ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) � x x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  57. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  58. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  59. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x x 1 Quantifier-free equivalent Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  60. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x x 1 Quantifier-free equivalent 2 Just not a formula . . . Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  61. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x x 1 Quantifier-free equivalent 2 Just not a formula . . . √ b 2 − 4 ac ) / (2 a ) is not in FOL R and neither is − c / b 3 ( − b + Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  62. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x x 1 Quantifier-free equivalent 2 Just not a formula . . . √ b 2 − 4 ac ) / (2 a ) is not in FOL R and neither is − c / b 3 ( − b + 4 Virtual substitution F ( a + b √ c ) / d acts as if it were to substitute ¯ ( a + b √ c ) / d for x in F x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  63. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x ¯ √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x ¯ x ¯ 1 Quantifier-free equivalent 2 Just not a formula . . . √ b 2 − 4 ac ) / (2 a ) is not in FOL R and neither is − c / b 3 ( − b + 4 Virtual substitution F ( a + b √ c ) / d acts as if it were to substitute ¯ ( a + b √ c ) / d for x in F . . . it’s merely equivalent x Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  64. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x ¯ √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x ¯ x ¯ 1 Quantifier-free equivalent 2 Just not a formula . . . √ b 2 − 4 ac ) / (2 a ) is not in FOL R and neither is − c / b 3 ( − b + 4 Virtual substitution F ( a + b √ c ) / d acts as if it were to substitute ¯ ( a + b √ c ) / d for x in F . . . it’s merely equivalent x 5 ∃ r ( r 2 = c ) would do it for √ c Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  65. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x ¯ √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � F ( − b + b 2 − 4 ac ) / (2 a ) ∨ F ( − b − b 2 − 4 ac ) / (2 a ) x ¯ x ¯ 1 Quantifier-free equivalent 2 Just not a formula . . . √ b 2 − 4 ac ) / (2 a ) is not in FOL R and neither is − c / b 3 ( − b + 4 Virtual substitution F ( a + b √ c ) / d acts as if it were to substitute ¯ ( a + b √ c ) / d for x in F . . . it’s merely equivalent x 5 ∃ r ( r 2 = c ) would do it for √ c but that’s going in circles Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  66. Outline Learning Objectives 1 Real Arithmetic 2 Evaluating Real Arithmetic Framing the Miracle QE Example Quantifier Elimination QE Framework Virtual Substitution by Example Linear Virtual Substitution Quadratic Virtual Substitution Virtual Substitution 3 Square Root Expression Algebra Virtual Square Root Comparisons Example Summary 4 Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 16 / 25

  67. Quadratic Virtual Substitution Theorem (Virtual Substitution: Quadratic Equation x �∈ a , b , c ) a � = 0 ∨ b � = 0 ∨ c � = 0 → � ∃ x ( ax 2 + bx + c = 0 ∧ F ) ↔ a = 0 ∧ b � = 0 ∧ F − c / b x ¯ √ √ �� ∨ a � = 0 ∧ b 2 − 4 ac ≥ 0 ∧ � b 2 − 4 ac ) / (2 a ) b 2 − 4 ac ) / (2 a ) F ( − b + ∨ F ( − b − x ¯ x ¯ Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 17 / 25

  68. Square Root Expression Algebra Virtual Substitution into Polynomial Virtually substitute ( a + b √ c ) / d into a polynomial p : p ( a + b √ c ) / d def = ¯ x 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

  69. Square Root Expression Algebra Virtual Substitution into Polynomial Virtually substitute ( a + b √ c ) / d into a polynomial p : = p (( a + b √ c ) / d ) p ( a + b √ c ) / d def ¯ x 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

  70. Square Root Expression Algebra Virtual Substitution into Polynomial Virtually substitute ( a + b √ c ) / d into a polynomial p : = p (( a + b √ c ) / d ) p ( a + b √ c ) / d def algebraic evaluation ¯ x 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

  71. Square Root Expression Algebra Virtual Substitution into Polynomial Virtually substitute ( a + b √ c ) / d into a polynomial p : = p (( a + b √ c ) / d ) p ( a + b √ c ) / d def algebraic evaluation ¯ x √ c -algebra Algebra of terms ( a + b √ c ) / d with polynomials a , b , c , d ∈ Q [ x 1 , .., x n ]: (( 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

  72. Square Root Expression Algebra Virtual Substitution into Polynomial Virtually substitute ( a + b √ c ) / d into a polynomial p : = p (( a + b √ c ) / d ) p ( a + b √ c ) / d def algebraic evaluation ¯ x √ c -algebra Algebra of terms ( a + b √ c ) / d with polynomials a , b , c , d ∈ Q [ x 1 , .., x n ]: (( 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

  73. Square Root Expression Algebra Virtual Substitution into Polynomial Virtually substitute ( a + b √ c ) / d into a polynomial p : = p (( a + b √ c ) / d ) p ( a + b √ c ) / d def algebraic evaluation ¯ x √ c -algebra Algebra of terms ( a + b √ c ) / d with polynomials a , b , c , d ∈ Q [ x 1 , .., x n ]: (( 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

  74. Square Root Expression Algebra Virtual Substitution into Polynomial Virtually substitute ( a + b √ c ) / d into a polynomial p : = p (( a + b √ c ) / d ) p ( a + b √ c ) / d def algebraic evaluation ¯ x √ c -algebra Algebra of terms ( a + b √ c ) / d with polynomials a , b , c , d ∈ Q [ x 1 , .., x n ]: 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

  75. 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

  76. Virtual √· Substitution Virtual Substitution into Comparisons Virtually substitute ( a + b √ c ) / d into a comparison p ∼ 0: ( p ∼ 0) ( a + b √ c ) / d ≡ ( p ( a + b √ c ) / d ∼ 0) x ¯ x ¯ Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 19 / 25

  77. Virtual √· Substitution Virtual Substitution into Comparisons Virtually substitute ( a + b √ c ) / d into a comparison p ∼ 0: ( p ∼ 0) ( a + b √ c ) / d ≡ ( p ( a + b √ c ) / d ∼ 0) x ¯ x ¯ √ 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

  78. Virtual √· Substitution Virtual Substitution into Comparisons Virtually substitute ( a + b √ c ) / d into a comparison p ∼ 0: ( p ∼ 0) ( a + b √ c ) / d ≡ ( p ( a + b √ c ) / d ∼ 0) x ¯ x ¯ √ 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 ∧ a 2 − b 2 c = 0 ( a + b √ c ) / d ≤ 0 ≡ ad ≤ 0 ∧ a 2 − b 2 c ≥ 0 ∨ bd ≤ 0 ∧ a 2 − b 2 c ≤ 0 ( a + b √ c ) / d < 0 ≡ ad < 0 ∧ a 2 − b 2 c > 0 ∨ bd ≤ 0 ∧ ( ad < 0 ∨ a 2 − b 2 c < 0) Andr´ e Platzer (CMU) FCPS / 20: Virtual Substitution & Real Equations 19 / 25

Recommend


More recommend