generating sharper and
play

Generating Sharper and Simpler Nonlinear Interpolants for Program - PowerPoint PPT Presentation

Generating Sharper and Simpler Nonlinear Interpolants for Program Verification Takamasa Okudono 1 , Yuki Nishida 2 , Kensuke Kojima 2 , Kohei Suenaga 2 , Kengo Kido 1 and Ichiro Hasuo 3 1 University of Tokyo, Japan 2 Kyoto University, Japan 3


  1. Generating Sharper and Simpler Nonlinear Interpolants for Program Verification Takamasa Okudono 1 , Yuki Nishida 2 , Kensuke Kojima 2 , Kohei Suenaga 2 , Kengo Kido 1 and Ichiro Hasuo 3 1 University of Tokyo, Japan 2 Kyoto University, Japan 3 National Institute of Informatics, Japan APLAS 2017, Suzhou, China. November 28 th 2017 Takamasa Okudono (University of Tokyo) 1

  2. Interpolant is effective Purpose of This Work at program verification Disjointness of the regions β€’ Automatic generation of polynomial interpolants. Def. [interpolant] β€’ 𝐡, 𝐢: Formulas satisfying ⊨ Β¬(𝐡 ∧ 𝐢) . Essential to β€’ Formula 𝐽 is an interpolant of 𝐡 and 𝐢 if: separate the regions 1. ⊨ 𝐡 β†’ 𝐽 2. ⊨ Β¬(𝐢 ∧ 𝐽) 3. Variables in 𝐽 appear in both of 𝐡, 𝐢 For polynomial interpolants, atomic propositions are: (Poly.) ≧ 0, (Poly.)>0, (Poly.)=0 2 Takamasa Okudono (University of Tokyo)

  3. Existing Work β€’ [Dai+, CAV’13]: generation of polynomial interpolants with numerical optimization β€’ Challenge 1: Unable to generate any interpolants in β€œ touching ” cases β€’ Challenge 2: Incorrect and complex due to numerical errors Touching 54.1800𝑦 + 108.3601𝑧 β‰₯ 0 𝑦 + 2𝑧 β‰₯ 0 Takamasa Okudono (University of Tokyo) 3

  4. Our Contribution β€’ [Dai+, CAV’13]: generation of polynomial interpolants with numerical optimization β€’ Challenge 1: Unable to generate any interpolants in β€œ touching ” cases β€’ Challenge 2: Incorrect and complex due to numerical errors Touching 54.1800𝑦 + 108.3601𝑧 β‰₯ 0 Solved! 𝑦 + 2𝑧 β‰₯ 0 Solved! (Contribution 1) (Contribution 2) Takamasa Okudono (University of Tokyo) 4

  5. Challenge 1 in [Dai+]: Sharpness β€’ If two regions of 𝐡, 𝐢 are β€œtouching”, [Dai+, CAV’13] always fails at generating their interpolant. β€’ 𝐡 = (𝑧 βˆ’ 𝑦 > 0 ∧ 𝑧 + 𝑦 > 0) Touching β€’ 𝐢 = (βˆ’π‘§ β‰₯ 0) Takamasa Okudono (University of Tokyo) 5

  6. Challenge 1 in [Dai+]: Sharpness β€’ If two regions of 𝐡, 𝐢 are β€œtouching”, [Dai+, CAV’13] always fails at generating their interpolant. β€’ 𝐡 = (𝑧 βˆ’ 𝑦 > 0 ∧ 𝑧 + 𝑦 > 0) Touching β€’ 𝐢 = βˆ’π‘§ β‰₯ 0 β€’ 𝐽 = 𝑧 > 0 β€’ There is an interpolant, but [Dai, CAV’13] cannot find it! Takamasa Okudono (University of Tokyo) 6

  7. Challenge 1 in [Dai+]: Sharpness β€’ If two regions of 𝐡, 𝐢 are β€œtouching”, [Dai+, CAV’13] always fails at generating their interpolant. Takamasa Okudono (University of Tokyo) 7

  8. Challenge 1: Flow of [Dai+] [Parrilo , Mathematical Programming’03] (2) Polynomial (1) Formulas (3) SDP ↦ ↦ Optimization Use SDP Solver 𝐡, 𝐢 Problem Problem ↦ (5) Numerical (4) Numerical (6) Interpolant ↦ ↦ Solution Solution 𝐽 of (2) of (3) Takamasa Okudono (University of Tokyo) 8

  9. Contribution 1: Method for Sharpness [Parrilo , Mathematical Programming’03] Method for Sharpness (2) Polynomial (1) Formulas (3) SDP ↦ ↦ Optimization Use SDP Solver 𝐡, 𝐢 Problem Problem ↦ (5) Numerical (4) Numerical (6) Interpolant ↦ ↦ Solution Solution 𝐽 of (2) of (3) Takamasa Okudono (University of Tokyo) 9

  10. Contribution 1: Example Method for Sharpness (2) Polynomial (1) Formulas ↦ Optimization 𝐡, 𝐢 Problem 𝐡 = y βˆ’ x > 0, y + x > 0 , 𝐢 = (βˆ’π‘§ β‰₯ 0) Takamasa Okudono (University of Tokyo) 10

  11. Contribution 1: Example [Dai+, CAV’13] β€’ 𝐡 = (y βˆ’ x > 0, y + x > 0), 𝐢 = (βˆ’π‘§ β‰₯ 0) β€’ [Dai+, CAV’13] β€’ Find polynomials 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 ∈ ℝ[π‘Œ] s.t. 1 𝑧 + 𝑦 + 𝑧 βˆ’ 𝑦 2 𝑧 + 𝑦 2 β€’ 𝐽 ≔ 2 + 𝜏 1 + 𝜏 2 𝑧 βˆ’ 𝑦 + 𝜏 3 𝑧 + 𝑦 + 𝜏 4 𝑧 βˆ’ 𝑦 β€’ 𝐽 β€² ≔ 1 2 + 𝜏 5 (βˆ’π‘§) β€’ 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 are sums of squares β€’ 𝐽 + 𝐽 β€² = 0 𝜏 is a sum of squares β€’ ( 𝐽 contains only 𝑧 ) ⟺ β€’ Then 𝐽 > 0 is an interpolant 2 + β‹― + πœ’ π‘œ 2 βˆƒπœ’ 1 , … , πœ’ π‘œ ∈ ℝ π‘Œ ; 𝜏 = πœ’ 1 Takamasa Okudono (University of Tokyo) 11

  12. Contribution 1: Example [Dai+, CAV’13] β€’ 𝐡 = (y βˆ’ x > 0, y + x > 0), 𝐢 = (βˆ’π‘§ β‰₯ 0) β€’ [Dai+, CAV’13] β€’ Find polynomials 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 ∈ ℝ[π‘Œ] s.t. 1 𝑧 + 𝑦 + 𝑧 βˆ’ 𝑦 2 𝑧 + 𝑦 2 β€’ 𝐽 ≔ 2 + 𝜏 1 + 𝜏 2 𝑧 βˆ’ 𝑦 + 𝜏 3 𝑧 + 𝑦 + 𝜏 4 𝑧 βˆ’ 𝑦 β€’ 𝐽 β€² ≔ 1 2 + 𝜏 5 (βˆ’π‘§) β€’ 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 are sums of squares β€’ 𝐽 + 𝐽 β€² = 0 β€’ ( 𝐽 contains only 𝑧 ) β€’ Then 𝐽 > 0 is an interpolant Infeasible and unable to generate any interpolants! Takamasa Okudono (University of Tokyo) 12

  13. Contribution 1: Example [Dai+, CAV’13] β€’ 𝐡 = (y βˆ’ x > 0, y + x > 0), 𝐢 = (βˆ’π‘§ β‰₯ 0) β€’ [Dai+, CAV’13] β€’ Find 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 ∈ ℝ[π‘Œ] s.t. 1 𝑧 + 𝑦 + 𝑧 βˆ’ 𝑦 2 𝑧 + 𝑦 2 β€’ 𝐽 ≔ 2 + 𝜏 1 + 𝜏 2 𝑧 βˆ’ 𝑦 + 𝜏 3 𝑧 + 𝑦 + 𝜏 4 𝑧 βˆ’ 𝑦 β€’ 𝐽 β€² ≔ 1 2 + 𝜏 5 (βˆ’π‘§) ∡ Assume the feasibility. β€’ 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 are sums of squares 0 = 𝐽 + 𝐽 β€² 0, 0 β€’ 𝐽 + 𝐽 β€² = 0 = 1 + 𝜏 1 0, 0 > 0. β€’ ( 𝐽 contains only 𝑧 ) Contradiction. β–‘ β€’ Then 𝐽 > 0 is an interpolant Infeasible and unable to generate any interpolants! Takamasa Okudono (University of Tokyo) 13

  14. Contribution 1: Example [Dai+, CAV’13] β€’ 𝐡 = (y βˆ’ x > 0, y + x > 0), 𝐢 = (βˆ’π‘§ β‰₯ 0) β€’ Our method for sharpness β€’ Find polynomials 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 ∈ ℝ[π‘Œ] and 𝑠 1 , 𝑠 2 , 𝑠 3 ∈ ℝ β‰₯0 s.t. β€’ 𝐽 ≔ 𝜏 1 + 𝜏 2 𝑧 βˆ’ 𝑦 + 𝜏 3 𝑧 + 𝑦 + 𝜏 4 𝑧 βˆ’ 𝑦 𝑧 + 𝑦 + 𝑠 1 + 𝑠 2 𝑧 βˆ’ 𝑦 + 𝑠 3 𝑧 + 𝑦 β€’ 𝐽 β€² ≔ 𝜏 5 βˆ’π‘§ β€’ 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 are sums of squares β€’ 𝑠 1 + 𝑠 2 + 𝑠 3 > 0 β€’ 𝐽 + 𝐽 β€² = 0 β€’ 𝐽 contains only 𝑧 β€’ Then 𝐽 > 0 is an interpolant Takamasa Okudono (University of Tokyo) 14

  15. Contribution 1: Example [Dai+, CAV’13] 𝑠 3 = 0 𝑠 2 = 1 𝑠 1 = 0 β€’ 𝐡 = (y βˆ’ x > 0, y + x > 0), 𝐢 = (βˆ’π‘§ β‰₯ 0) 𝜏 3 = 1 𝜏 4 = 0 𝜏 2 = 0 β€’ Our method for sharpness 𝜏 1 = 0 β€’ Find polynomials 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 ∈ ℝ[π‘Œ] and 𝑠 1 , 𝑠 2 , 𝑠 3 ∈ ℝ β‰₯0 s.t. β€’ 𝐽 ≔ 𝜏 1 + 𝜏 2 𝑧 βˆ’ 𝑦 + 𝜏 3 𝑧 + 𝑦 + 𝜏 4 𝑧 βˆ’ 𝑦 𝑠 5 = 2 𝑧 + 𝑦 + 𝑠 1 + 𝑠 2 𝑧 βˆ’ 𝑦 + 𝑠 3 𝑧 + 𝑦 β€’ 𝐽 β€² ≔ 𝜏 5 βˆ’π‘§ β€’ 𝜏 1 , 𝜏 2 , 𝜏 3 , 𝜏 4 , 𝜏 5 are sums of squares β€’ 𝑠 1 + 𝑠 2 + 𝑠 3 > 0 𝐽 = 2𝑧 β€’ 𝐽 + 𝐽 β€² = 0 β€’ 𝐽 contains only 𝑧 β€’ Then 𝐽 > 0 is an interpolant Feasible and able to generate an interpolant! Takamasa Okudono (University of Tokyo) 15

  16. Contribution 1: Completeness A and B s.t. ⊨ Β¬(A∧ B) Method for Sharpness β€œtouching” cases [Dai+] Takamasa Okudono (University of Tokyo) 16

  17. Challenge 2: Numerical Error in [Dai+] (2) Polynomial (1) Formulas (3) SDP ↦ ↦ Optimization Use SDP Solver 𝐡, 𝐢 Problem Problem ↦ (5) Numerical (4) Numerical (6) Interpolant ↦ ↦ Solution Solution 𝐽 of (2) of (3) Numerical Error Takamasa Okudono (University of Tokyo) 17

  18. Challenge 2: Numerical Error in [Dai+] (2) Polynomial (1) Formulas (3) SDP ↦ ↦ Optimization Use SDP Solver 𝐡, 𝐢 Problem Problem ↦ (5) Numerical (4) Numerical (6) Interpolant ↦ ↦ Solution Solution 𝐽 of (2) of (3) Numerical Numerical Error Error Takamasa Okudono (University of Tokyo) 18

  19. Challenge 2: Numerical Error in [Dai+] (2) Polynomial (1) Formulas (3) SDP ↦ ↦ Optimization Use SDP Solver 𝐡, 𝐢 Problem Problem Less ↦ simple (5) Numerical (4) Numerical (6) Interpolant ↦ ↦ Maybe Solution Solution 𝐽 spurious of (2) of (3) Numerical Numerical Numerical Error Error Error Numerical error spreads Takamasa Okudono (University of Tokyo) 19

  20. Challenge 2: Numerical Error in [Dai+] (2) Polynomial (1) Formulas (3) SDP ↦ ↦ Optimization Use SDP Solver 𝐡, 𝐢 Problem Problem Less ↦ simple The same problem occurs in our method for sharpness (Contribution 1) (5) Numerical (4) Numerical (6) Interpolant ↦ ↦ Maybe Solution Solution 𝐽 spurious of (2) of (3) Numerical Numerical Numerical Error Error Error Numerical error spreads Takamasa Okudono (University of Tokyo) 20

  21. Challenge 2: Example β€’ Example: 𝐡 = 𝑦 = 0 ∧ 𝑧 = 0 , 𝐢 = (𝑦 + 2𝑧 < 0) β€’ Spurious interpolant 𝐽 = 54.1800𝑦 + 108.3601𝑧 β‰₯ 0 β€’ 𝑦, 𝑧 = (βˆ’108.3601, 54.1800) satisfies both 𝐢 and 𝐽 Def. [interpolant] β€’ 𝐡, 𝐢: Formulas satisfying ⊨ (𝐡 ∧ 𝐢) . β€’ Formula 𝐽 is an interpolant of 𝐡 and 𝐢 if: 1. ⊨ 𝐡 β†’ 𝐽 2. ⊨ Β¬(𝐢 ∧ 𝐽) 3. Variables in 𝐽 appears in both of 𝐡, 𝐢 Takamasa Okudono (University of Tokyo) 21

  22. Contribution 2: Observation Spurious Interpolant: 𝐽 = 54.1800𝑦 + 108.3601𝑧 β‰₯ 0 β‰ˆΓ— 2 Simplified Interpolant: 𝐽 = 𝑦 + 2𝑧 β‰₯ 0 Correct and simple interpolant of 𝐡 = 𝑦 = 0 ∧ 𝑧 = 0 , 𝐢 = (𝑦 + 2𝑧 < 0) Takamasa Okudono (University of Tokyo) 22

Recommend


More recommend