a practical construction for decomposing numerical
play

A Practical Construction for Decomposing Numerical Abstract Domains - PowerPoint PPT Presentation

A Practical Construction for Decomposing Numerical Abstract Domains Gagandeep Singh Markus Pschel Martin Vechev Department of Computer Science 1 Numerical abstract domains ( ) Cost and Numerical Domain


  1. A Practical Construction for Decomposing Numerical Abstract Domains Gagandeep Singh Markus PΓΌschel Martin Vechev Department of Computer Science 1

  2. Numerical abstract domains ( 𝑑 πœ— β„š 𝑝𝑠 ℝ ) Cost and Numerical Domain Representable Constraints ±𝑦 𝑗 ≀ 𝑑 Expressivity ±𝑦 𝑗 ≀ 𝑑 𝑝𝑠 (𝑦 𝑗 ≀ 𝑦 π‘˜ ) Interval ±𝑦 𝑗 ≀ 𝑑 𝑝𝑠 (𝑦 𝑗 βˆ’ 𝑦 π‘˜ ≀ 𝑑 ) Pentagon ±𝑦 𝑗 ≀ 𝑑 𝑝𝑠 (±𝑦 𝑗 Β± 𝑦 π‘˜ ≀ 𝑑 ) Zones 𝑏 𝑗 𝑦 𝑗 + 𝑏 π‘˜ 𝑦 π‘˜ ≀ 𝑑 , 𝑏 𝑗 ∈ β„€ Octagon 𝑏 1 𝑦 1 + 𝑏 2 𝑦 2 + β‹―+ 𝑏 π‘œ 𝑦 π‘œ ≀ 𝑑 , 𝑏 𝑗 ∈ β„€ TVPI Polyhedra Static analysis with precise numerical domains is expensive 2

  3. Domain transformers // abstract program state: { βˆ’π‘¦ 1 βˆ’ 𝑦 2 ≀ 0, βˆ’π‘¦ 2 ≀ 0, βˆ’π‘¦ 3 βˆ’ 𝑦 4 ≀ 0 } Octagon // program statement : If ( 𝑦 2 + 𝑦 3 + 𝑦 4 ≀ 1) Best, Trivial, Standard, { βˆ’π‘¦ 1 βˆ’ 𝑦 2 ≀ 0, βˆ’π‘¦ 2 ≀ { βˆ’π‘¦ 1 βˆ’ 𝑦 2 ≀ 0, βˆ’π‘¦ 2 ≀ Exponential Constant Quadratic 0, βˆ’π‘¦ 3 βˆ’ 𝑦 4 ≀ 0 , 𝑦 2 ≀ 0, βˆ’π‘¦ 3 βˆ’ 𝑦 4 ≀ 0 , 𝑦 3 + {} 1, 𝑦 3 + 𝑦 4 ≀ 1, βˆ’π‘¦ 1 ≀ 1 } 𝑦 4 ≀ 1 } Best abstract transformers for even less precise domains are expensive 3

  4. Online decomposition Octagon 𝜌 ℐ′ ℐ 𝜌 ℐ ℐ′ Numerical domain analysis can be made faster through online decomposition { βˆ’π‘¦ 1 βˆ’ 𝑦 2 ≀ 0 , { βˆ’π‘¦ 1 βˆ’ 𝑦 2 ≀ 0 , { 𝑦 1 , 𝑦 2 } { 𝑦 1 , 𝑦 2 } βˆ’π‘¦ 2 ≀ 0 } βˆ’π‘¦ 2 ≀ 0 } If( 𝑦 2 + 𝑦 3 + 𝑦 4 ≀ 1) { βˆ’π‘¦ 3 βˆ’ 𝑦 4 ≀ 0 , { βˆ’π‘¦ 3 βˆ’ 𝑦 4 ≀ 0 } { 𝑦 3 , 𝑦 4 } { 𝑦 3 , 𝑦 4 } 𝑦 3 + 𝑦 4 ≀ 1 } Decomposing standard Octagon analysis ([PLDI 2015]) β€’ Decomposing standard Polyhedra analysis ([SAS 2003, POPL2017]) β€’ 4

  5. Limitations of prior work Numerical abstract domains and their transformers β€’ ad hoc design β€’ guided by cost precision tradeoff β€’ tailored for specific use cases β€’ Drawback: Prior work cannot be reused for new domain transformers Required: Universal construction for decomposing numerical domains 5

  6. Contributions Decomposed Our decomposed analysis Original β€’ Significantly fast 32 vars Abstract β€’ Always sound 3 vars element + Black box β€’ Monotonic Under practical Transformer construction 28 vars β€’ Precise conditions 80 vars 17 vars Complete end-to-end implementation Benchmark: >30K LOC, >550 vars β€’ Polyhedra Analysis Poly Oct Zones β€’ Octagon Original 6142 s 28 s 3 s β€’ Zones Decomposed 4.4 s 1.9 s 1.5 s elina.ethz.ch 6

  7. Requirements on numerical abstract domains β€’ An abstract element ℐ in domain 𝒠 is conjunction of finite number of β€’ The concretization function 𝛿 for 𝒠 should be meet preserving representable constraints 𝛿 ( ℐ ∩ 𝒦 ) = 𝛿(ℐ) ∩ 𝛿 ( 𝒦 ) ℐ βŠ‘ ℐ′ ⟺ 𝛿(ℐ) βŠ† 𝛿(ℐ′) β€’ The ordering of abstract elements in the domain satisfies: 7

  8. Partitioning variable set Octagon partition 𝜌 ℐ partition ΰ΄€ 𝜌 ℐ ℐ ℐ Finest unique A permissible An invalid { βˆ’π‘¦ 1 βˆ’ 𝑦 2 ≀ 0 } { 𝑦 1 , 𝑦 2 } { βˆ’π‘¦ 1 βˆ’ 𝑦 2 ≀ 0 } { 𝑦 1 , 𝑦 2 } { 𝑦 1 , 𝑦 3 } partition { 𝑦 3 ≀ 0 } { 𝑦 3 } { 𝑦 3 ≀ 0 , 𝑦 4 ≀ 0 } { 𝑦 3 , 𝑦 4 } { 𝑦 2 } { 𝑦 4 ≀ 0 } { 𝑦 4 } { 𝑦 4 } Expensive to maintain finest partitions thus online decomposition β€’ maintains permissible partitions 8

  9. Decomposable transformers { 𝑦 1 + 𝑦 2 ≀ 0} { 𝑦 1 , 𝑦 2 } Polyhedra { 𝑦 3 + 𝑦 4 ≀ 5} { 𝑦 3 , 𝑦 4 } //abstract program state: //program statement: If ( 𝑦 5 + 𝑦 6 ≀ 0) 𝜌 ℐ′′ ΰ΄€ ℐ′′ Decomposable Non-decomposable ℐ′ { 𝑦 1 , 𝑦 2 } { 𝑦 1 + 𝑦 2 + 𝑦 3 + 𝑦 4 + 𝑦 5 + 𝑦 6 ≀ 5 } { 𝑦 1 + 𝑦 2 ≀ 0 } 𝜌 ℐ′ { 𝑦 1 , 𝑦 2 , 𝑦 3 , 𝑦 4 , 𝑦 5 , 𝑦 6 } ΰ΄€ { 𝑦 3 + 𝑦 4 ≀ 5 } { 𝑦 3 , 𝑦 4 } { 𝑦 5 + 𝑦 6 ≀ 0 } { 𝑦 5 , 𝑦 6 } 9

  10. Decomposable transformers Decomposed Non-decomposed Black box transformer transformer construction Design from scratch Conditional β€’ Assignment β€’ β€’ Meet Join β€’ β€’ Widening 10

  11. Conditional Transformer Definition: Let ℐ be an abstract element in domain 𝒠 with the associated Polyhedra permissible partition ΰ΄€ 𝜌 ℐ and Οƒ 𝑏 𝑗 𝑦 𝑗 ≀ 𝑑 be the conditional statement then, ℬ π‘‘π‘π‘œπ‘’ : ={ 𝑦 𝑗 ∢ 𝑏 𝑗 β‰  0 } ℬ π‘‘π‘π‘œπ‘’ := ⋃ 𝒴 𝑙 βˆ©β„¬ π‘‘π‘π‘œπ‘’ β‰ βˆ… 𝒴 𝑙 , 𝒴 𝑙 ∈ ΰ΄€ 𝜌 ℐ βˆ— 𝜌 ℐ ΰ΄€ ℐ { 𝑦 1 , 𝑦 2 , 𝑦 3 } { 2𝑦 1 βˆ’ 𝑦 2 + 4𝑦 3 ≀ 0 } ℬ π‘‘π‘π‘œπ‘’ βˆ— If( 𝑦 3 + 𝑦 6 ≀ 0) { 𝑦 1 , 𝑦 2 , 𝑦 3 , 𝑦 6 } { 2𝑦 4 + 3𝑦 5 ≀ 5 } { 𝑦 4 , 𝑦 5 } ℬ π‘‘π‘π‘œπ‘’ ={ 𝑦 3 , 𝑦 6 } { 𝑦 6 } { 𝑦 6 = 1 } 11

  12. Conditional Transformer ℐ 𝑃 := π‘ˆ ℐ := π‘ˆ π‘‘π‘π‘œπ‘’ ℐ ℬ π‘‘π‘π‘œπ‘’ ⋃ ℐ(𝒴 βˆ– ℬ π‘‘π‘π‘œπ‘’ ) 𝑒 βˆ— βˆ— Octagon π‘‘π‘π‘œπ‘’ 𝜌 ℐ 𝑃 ≔ {𝒴 𝑙 ∈ ΰ΄€ ΰ΄€ 𝜌 ℐ :𝒴 𝑙 ⋂ℬ π‘‘π‘π‘œπ‘’ = βˆ…}⋃{ℬ π‘‘π‘π‘œπ‘’ } βˆ— βˆ— ℐ 𝜌 ℐ ΰ΄€ 𝜌 ℐ 𝑃 ΰ΄€ π‘ˆ ℐ 𝑒 π‘‘π‘π‘œπ‘’ If( 𝑦 3 ≀ 0) { 𝑦 1 } { 𝑦 1 ≀ 0 } { 𝑦 1 } { 𝑦 1 ≀ 0 } ℬ π‘‘π‘π‘œπ‘’ ={ 𝑦 2 , 𝑦 3 } βˆ— { 𝑦 2 + 𝑦 3 ≀ 0 } { 𝑦 2 , 𝑦 3 } { 𝑦 2 + 𝑦 3 ≀ 0, { 𝑦 2 , 𝑦 3 } 𝑦 3 ≀ 0 } 12

  13. Conditional Transformer Theorem: 𝛿(π‘ˆ π‘‘π‘π‘œπ‘’ ℐ ) = 𝛿(π‘ˆ ℐ ) if for any associated permissible 𝑒 Octagon π‘‘π‘π‘œπ‘’ partition ΰ΄€ 𝜌 ℐ , the output π‘ˆ π‘‘π‘π‘œπ‘’ (ℐ) satisfies: π‘ˆ π‘‘π‘π‘œπ‘’ ℐ = ℐ⋃ℐ β€² ⋃ℐ β€²β€² where ℐ′ is a set of non-redundant constraints between the variables from ℬ π‘‘π‘π‘œπ‘’ only and ℐ β€²β€² is a set of redundant βˆ— β€’ constraints between the variables in 𝒴 𝛿(π‘ˆ π‘‘π‘π‘œπ‘’ ℐ ℬ π‘‘π‘π‘œπ‘’ ) = 𝛿(ℐ(ℬ π‘‘π‘π‘œπ‘’ )⋃ℐ′) βˆ— βˆ— ℐ 𝜌 ℐ ΰ΄€ π‘ˆ π‘‘π‘π‘œπ‘’ ℐ ℐ′ β€’ If( 𝑦 3 ≀ 0) { 𝑦 1 } { 𝑦 1 ≀ 0 } {𝑦 3 ≀ 0} { 𝑦 1 ≀ 0, 𝑦 2 + 𝑦 3 ≀ 0, 𝑦 1 + ℬ π‘‘π‘π‘œπ‘’ ={ 𝑦 2 , 𝑦 3 } ℐ′′ βˆ— { 𝑦 2 , 𝑦 3 } { 𝑦 2 + 𝑦 3 ≀ 0 } 𝑦 3 ≀ 0, 𝑦 3 ≀ 0 } {𝑦 1 + 𝑦 3 ≀ 0} 𝛿(π‘ˆ π‘‘π‘π‘œπ‘’ ℐ ℬ π‘‘π‘π‘œπ‘’ ) = 𝛿(ℐ(ℬ π‘‘π‘π‘œπ‘’ )⋃ℐ′) = 𝛿 ({ 𝑦 2 + 𝑦 3 ≀ 0, 𝑦 3 ≀ 0 }) βˆ— βˆ— 13

  14. Refinement β€’ The output partition can be refined after computing the output β€’ non-invertible assignment β€’ join β€’ Allows us to produce finer output partitions than prior work for β€’ Polyhedra β€’ Octagon 14

  15. Experimental Evaluation β€’ Crab-llvm analyzer β€’ intra procedural analysis β€’ analyzes llvm bitcode β€’ Software verification competition benchmarks β€’ linux device drivers β€’ control flow β€’ Polyhedra β€’ n on decomposed transformers from PPL and decomposed from [POPL’17] β€’ Octagon β€’ n on decomposed and decomposed transformers from [PLDI’15] β€’ Zones β€’ Implemented non decomposed transformers 15

  16. Polyhedra Benchmark PPL POPL’17 POPL’18 Speedup vs (s) (s) (s) PPL POPL’17 ∞ net_fddi_skfp 6142 9.2 4.4 1386 2 mtd_ubi MO 4 1.9 2.1 ∞ usb_core_main0 4003 65 29 136 2.2 tty_synclinkmp MO 3.4 2.5 1.4 scsi_advansys TO 4 3.4 >4183 1.2 staging_vt6656 TO 2 0.5 >28800 4 net_ppp 10530 924 891 11.8 1 ∞ p10_l00 121 11 5.4 22.4 2 ∞ MO 11 2.9 3.8 p16_l40 ∞ p12_l57 MO 14 6.5 2.1 ∞ p13_l53 MO 54 25 2.2 16 p19_l59 MO 70 12 5.9

  17. Octagon Benchmark PLDI’15 PLDI’15 POPL’18 Speedup vs ND(s) D(s) (s) ND D net_fddi_skfp 28 2.6 1.9 15 1.4 mtd_ubi 3411 979 532 6.4 1.8 usb_core_main0 107 6.1 4.9 22 1.2 tty_synclinkmp 8.2 1 0.8 10 1.2 scsi_advansys 9.3 1.5 0.8 12 1.9 staging_vt6656 4.8 0.3 0.2 24 1.5 net_ppp 11 1.1 1.2 9.2 0.9 p10_l00 20 0.5 0.5 40 1 8.8 0.6 0.5 18 1.2 p16_l40 p12_l57 19 1.2 0.7 27 1.7 p13_l53 43 1.7 1.3 33 1.3 17 p19_l59 41 2.8 1.2 31 2.2

  18. Zones Benchmark Non Decomposed POPL’18 Speedup (s) (s) net_fddi_skfp 3 1.5 2 mtd_ubi 1.4 0.7 2 usb_core_main0 10.3 4.6 2.2 tty_synclinkmp 1.1 0.7 1.6 scsi_advansys 0.9 0.7 1.3 staging_vt6656 0.5 0.2 2.5 net_ppp 1.1 0.7 1.5 p10_l00 1.9 0.4 4.6 p16_l40 1.7 0.7 2.5 p12_l57 3.5 0.9 3.9 8.7 2.1 4.2 p13_l53 p19_l59 9.8 1.6 6.1 18

  19. Complete end-to-end implementation Benchmark: >30K LOC, >550 vars β€’ Polyhedra Analysis Poly Oct Zones β€’ Octagon Original 6142 s 28 s 3 s β€’ Zones Decomposed 4.4 s 1.9 s 1.5 s elina.ethz.ch 19

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend