definability of accelerated relations in a theory of
play

Definability of Accelerated Relations in a Theory of Arrays and its - PowerPoint PPT Presentation

Definability of Accelerated Relations in a Theory of Arrays and its Applications F. Alberti 1 , S. Ghilardi 2 , N. Sharygina 1 1 University of Lugano, Switzerland 2 University of Milan, Italy 9th International Symposium on Frontiers of Combining


  1. Acceleration Preventing divergence τ 1 τ 0 τ 2 ¯ I l 1 P Find control-flow graph: Precise backward reachability With accelerated transitions (desired behavior) ¯ P τ 2 ¯ P τ 0 v 1 ⊥ τ 2 τ 1 τ 0 v 1 ⊥ τ 0 v 2 ⊥ τ + τ 1 1 τ 1 v + v 2 ⊥ 2 τ 0 v 3 ⊥ τ 1 v + v 3 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 6 / 24

  2. Acceleration Preventing divergence τ 1 τ 0 τ 2 ¯ I l 1 P Find control-flow graph: Precise backward reachability With accelerated transitions (desired behavior) ¯ P τ 2 ¯ P τ 0 v 1 ⊥ τ 2 τ 1 τ 0 v 1 ⊥ τ 0 v 2 ⊥ τ + τ 1 1 τ 1 τ 0 v + v 2 ⊥ 2 τ 0 v 3 ⊥ τ 1 v + v 3 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 6 / 24

  3. Acceleration Preventing divergence τ 1 τ 0 τ 2 ¯ I l 1 P Find control-flow graph: Precise backward reachability With accelerated transitions (desired behavior) ¯ P τ 2 ¯ P τ 0 v 1 ⊥ τ 2 τ 1 τ 0 v 1 ⊥ τ 0 v 2 ⊥ τ + τ 1 1 τ 1 τ 0 v + v 2 ⊥ 2 τ 0 v 3 ⊥ τ 1 τ 1 v + v 3 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 6 / 24

  4. Acceleration Preventing divergence τ 1 τ 0 τ 2 ¯ I l 1 P Find control-flow graph: Precise backward reachability With accelerated transitions (desired behavior) ¯ P τ 2 ¯ P τ 0 v 1 ⊥ τ 2 τ 1 τ 0 v 1 ⊥ τ 0 v 2 ⊥ τ + τ 1 1 τ 1 τ 0 v + v 2 ⊥ 2 τ 0 v 3 ⊥ τ 1 τ 1 v + v 3 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 6 / 24

  5. Acceleration Preventing divergence τ 1 τ 0 τ 2 ¯ I l 1 P Find control-flow graph: Precise backward reachability With accelerated transitions (desired behavior) ¯ P τ 2 ¯ P τ 0 v 1 ⊥ τ 2 τ 1 τ 0 v 1 ⊥ τ 0 v 2 ⊥ τ + τ 1 1 τ 1 τ 0 v + v 2 ⊥ 2 τ 0 v 3 ⊥ τ + τ 1 1 τ 1 v + v 3 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 6 / 24

  6. Acceleration Preventing divergence τ 1 τ 0 τ 2 ¯ I l 1 P Find control-flow graph: Precise backward reachability With accelerated transitions (desired behavior) ¯ P τ 2 ¯ P τ 0 v 1 ⊥ τ 2 τ 1 τ 0 v 1 ⊥ τ 0 v 2 ⊥ τ + τ 1 1 τ 1 τ 0 v + v 2 ⊥ 2 τ 0 v 3 ⊥ τ + τ 1 1 τ 1 v + v 3 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 6 / 24

  7. Acceleration State of the art Acceleration: Transitive closure τ + of transitions τ encoding cyclic actions F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 7 / 24

  8. Acceleration State of the art Acceleration: Transitive closure τ + of transitions τ encoding cyclic actions Challenges: � In general transitive closure cannot be expressed in FOL F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 7 / 24

  9. Acceleration State of the art Acceleration: Transitive closure τ + of transitions τ encoding cyclic actions Challenges: � In general transitive closure cannot be expressed in FOL Only some (important) classes of τ ’s allow the definability of τ + Polling-based systems [BBD + 02] Imperative programs over integers [BIK10] F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 7 / 24

  10. Acceleration State of the art Acceleration: Transitive closure τ + of transitions τ encoding cyclic actions Challenges: � In general transitive closure cannot be expressed in FOL Only some (important) classes of τ ’s allow the definability of τ + Polling-based systems [BBD + 02] Imperative programs over integers [BIK10] What about arrays? F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 7 / 24

  11. Acceleration for arrays Contributions In theory: Identification of classes of transitions τ over arrays admitting definable acceleration F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 8 / 24

  12. Acceleration for arrays Contributions In theory: Identification of classes of transitions τ over arrays admitting definable acceleration Determine the price to pay for expressing τ + F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 8 / 24

  13. Acceleration for arrays Contributions In theory: Identification of classes of transitions τ over arrays admitting definable acceleration Determine the price to pay for expressing τ + In practice: Template-based solution ✔ High degree of automation ✔ Computationally cheap F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 8 / 24

  14. Acceleration for arrays Contributions In theory: Identification of classes of transitions τ over arrays admitting definable acceleration Determine the price to pay for expressing τ + In practice: Template-based solution ✔ High degree of automation ✔ Computationally cheap Combination with abstraction-based frameworks F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 8 / 24

  15. Acceleration for arrays Example i ′ = i + 1 τ 1 := pc = l L ∧ i < L ∧ a [ i ] � = e ∧ � �� � � �� � update guard F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 9 / 24

  16. Acceleration for arrays Example i ′ = i + 1 τ 1 := pc = l L ∧ i < L ∧ a [ i ] � = e ∧ � �� � � �� � update guard ⇓ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 9 / 24

  17. Acceleration for arrays Example i ′ = i + 1 τ 1 := pc = l L ∧ i < L ∧ a [ i ] � = e ∧ � �� � � �� � update guard ⇓   y > 0 ∧ pc = l L ∧ τ +   1 := ∃ y. ∀ j. ( i ≤ j < i + y → j < L ∧ a [ j ] � = e )   i ′ = i + y F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 9 / 24

  18. Acceleration for arrays Example i ′ = i + 1 τ 1 := pc = l L ∧ i < L ∧ a [ i ] � = e ∧ � �� � � �� � update guard ⇓   y > 0 ∧ pc = l L ∧ τ +   1 := ∃ y. ∀ j. ( i ≤ j < i + y → j < L ∧ a [ j ] � = e )   i ′ = i + y F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 9 / 24

  19. The formal framework Iterators Definition (Iterators) A tuple of m -ary terms u ( x ) is said to be an iterator iff there exists an m -tuple of m + 1-ary terms u ∗ ( x, y ) such that for any natural number n it happens that the formula u n ( x ) = u ∗ ( x, ¯ n ) is valid. F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 10 / 24

  20. The formal framework Iterators Definition (Iterators) A tuple of m -ary terms u ( x ) is said to be an iterator iff there exists an m -tuple of m + 1-ary terms u ∗ ( x, y ) such that for any natural number n it happens that the formula u n ( x ) = u ∗ ( x, ¯ n ) is valid. Example u ( x ) := x + 1 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 10 / 24

  21. The formal framework Iterators Definition (Iterators) A tuple of m -ary terms u ( x ) is said to be an iterator iff there exists an m -tuple of m + 1-ary terms u ∗ ( x, y ) such that for any natural number n it happens that the formula u n ( x ) = u ∗ ( x, ¯ n ) is valid. Example u ( x ) := x + 1 u ∗ ( x, y ) := x + y F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 10 / 24

  22. The formal framework Selectors Definition (Selectors) Given an iterator u ( x ), an m -ary term κ ( x 1 , . . . , x m ) is a selector for u ( x ) iff there is an m + 1-ary term ι ( x 1 , . . . , x m , y ) yielding the validity of the formula z = κ ( u ∗ ( x, y )) → y = ι ( x, z ) F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 11 / 24

  23. The formal framework Selectors Definition (Selectors) Given an iterator u ( x ), an m -ary term κ ( x 1 , . . . , x m ) is a selector for u ( x ) iff there is an m + 1-ary term ι ( x 1 , . . . , x m , y ) yielding the validity of the formula z = κ ( u ∗ ( x, y )) → y = ι ( x, z ) Most likely κ is a projection F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 11 / 24

  24. The formal framework Selectors Definition (Selectors) Given an iterator u ( x ), an m -ary term κ ( x 1 , . . . , x m ) is a selector for u ( x ) iff there is an m + 1-ary term ι ( x 1 , . . . , x m , y ) yielding the validity of the formula z = κ ( u ∗ ( x, y )) → y = ι ( x, z ) Most likely κ is a projection Can a cell z be reached in m iterations? The number ι ( x, z ) gives “the only possible candidate” y number of iterations z = κ ( u ∗ ( x, y )) checks if the candidate y is correct F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 11 / 24

  25. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  26. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  27. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  28. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  29. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  30. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  31. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 a [7] in 3 iterations? F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  32. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 a [7] in 3 iterations? � 7 − 3 � ι ( i, z ) = 2 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  33. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 a [7] in 3 iterations? � 7 − 3 � ι ( i, z ) = = 2 2 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  34. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 a [7] in 3 iterations? � 7 − 3 � ι ( i, z ) = = 2 ✔ 2 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  35. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 a [7] in 3 iterations? � 7 − 3 � ι ( i, z ) = = 2 ✔ 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  36. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 a [7] in 3 iterations? � 7 − 3 � ι ( i, z ) = = 2 ✔ 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 ✔ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  37. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 i = 3 a [7] in 3 iterations? � 7 − 3 � ι ( i, z ) = = 2 ✔ 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 ✔ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  38. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 i = 3 a [7] in 3 iterations? a [6] in 3 iterations? � 7 − 3 � ι ( i, z ) = = 2 ✔ 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 ✔ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  39. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 i = 3 a [7] in 3 iterations? a [6] in 3 iterations? � 7 − 3 � 6 − 3 � � ι ( i, z ) = = 2 ✔ ι ( i, z ) = 2 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 ✔ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  40. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 i = 3 a [7] in 3 iterations? a [6] in 3 iterations? � 7 − 3 � 6 − 3 � � ι ( i, z ) = = 2 ✔ ι ( i, z ) = = 1 2 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 ✔ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  41. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 i = 3 a [7] in 3 iterations? a [6] in 3 iterations? � 7 − 3 � 6 − 3 � � ι ( i, z ) = = 2 ✔ ι ( i, z ) = = 1 ✔ 2 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 ✔ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  42. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 i = 3 a [7] in 3 iterations? a [6] in 3 iterations? � 7 − 3 � 6 − 3 � � ι ( i, z ) = = 2 ✔ ι ( i, z ) = = 1 ✔ 2 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 u ∗ ( i, 1) = 3 + 2 · 1 = 5 ✔ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  43. The formal framework Example while ( true ) { a [ i ] = 0; i = i + 2; } iterator: u ( i ) := i + 2 u ∗ ( i, y ) = i + 2 y κ ( x ) := x � z − i � ι ( i, z ) := 2 Example i = 3 i = 3 a [7] in 3 iterations? a [6] in 3 iterations? � 7 − 3 � 6 − 3 � � ι ( i, z ) = = 2 ✔ ι ( i, z ) = = 1 ✔ 2 2 u ∗ ( i, 2) = 3 + 2 · 2 = 7 u ∗ ( i, 1) = 3 + 2 · 1 = 5 ✔ ✘ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 12 / 24

  44. The formal framework Local ground assignments Definition (Local ground assignment) A local ground assignment is a ground assignment of the form pc = l ∧ φ L ( a , c ) ∧ pc ′ = l ∧ a ′ = wr ( a , κ (˜ c ′ = u (˜ c ) ∧ d ′ = d c ) , t ( a , c )) ∧ ˜ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 13 / 24

  45. The formal framework Local ground assignments Definition (Local ground assignment) A local ground assignment is a ground assignment of the form pc = l ∧ φ L ( a , c ) ∧ pc ′ = l ∧ a ′ = wr ( a , κ (˜ c ′ = u (˜ c ) ∧ d ′ = d c ) , t ( a , c )) ∧ ˜ where (i) c = ˜ c , d ; F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 13 / 24

  46. The formal framework Local ground assignments Definition (Local ground assignment) A local ground assignment is a ground assignment of the form pc = l ∧ φ L ( a , c ) ∧ pc ′ = l ∧ a ′ = wr ( a , κ (˜ c ′ = u (˜ c ) ∧ d ′ = d c ) , t ( a , c )) ∧ ˜ where (i) c = ˜ c , d ; (ii) u = u 1 , . . . , u | ˜ c | is an iterator; F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 13 / 24

  47. The formal framework Local ground assignments Definition (Local ground assignment) A local ground assignment is a ground assignment of the form pc = l ∧ φ L ( a , c ) ∧ pc ′ = l ∧ a ′ = wr ( a , κ (˜ c ′ = u (˜ c ) ∧ d ′ = d c ) , t ( a , c )) ∧ ˜ where (i) c = ˜ c , d ; (ii) u = u 1 , . . . , u | ˜ c | is an iterator; (iii) the terms κ are a selector assignment for a relative to u ; F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 13 / 24

  48. The formal framework Local ground assignments Definition (Local ground assignment) A local ground assignment is a ground assignment of the form pc = l ∧ φ L ( a , c ) ∧ pc ′ = l ∧ a ′ = wr ( a , κ (˜ c ′ = u (˜ c ) ∧ d ′ = d c ) , t ( a , c )) ∧ ˜ where (i) c = ˜ c , d ; (ii) u = u 1 , . . . , u | ˜ c | is an iterator; (iii) the terms κ are a selector assignment for a relative to u ; (iv) the formula φ L ( a , c ) and the terms t ( a , c ) are purely arithmetical over the set of terms { c , a ( κ (˜ c )) } ∪ { a i ( d j ) } 1 ≤ i ≤ s, 1 ≤ j ≤| d | ; F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 13 / 24

  49. The formal framework Local ground assignments Definition (Local ground assignment) A local ground assignment is a ground assignment of the form pc = l ∧ φ L ( a , c ) ∧ pc ′ = l ∧ a ′ = wr ( a , κ (˜ c ′ = u (˜ c ) ∧ d ′ = d c ) , t ( a , c )) ∧ ˜ where (i) c = ˜ c , d ; (ii) u = u 1 , . . . , u | ˜ c | is an iterator; (iii) the terms κ are a selector assignment for a relative to u ; (iv) the formula φ L ( a , c ) and the terms t ( a , c ) are purely arithmetical over the set of terms { c , a ( κ (˜ c )) } ∪ { a i ( d j ) } 1 ≤ i ≤ s, 1 ≤ j ≤| d | ; (v) the guard φ L contains the conjuncts κ i (˜ c ) � = d j , for 1 ≤ i ≤ s and 1 ≤ j ≤ | d | . F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 13 / 24

  50. The formal framework Contribution Theorem If τ is a local ground assignment, then τ + is a Σ 0 2 -assignment. Francesco Alberti, Silvio Ghilardi, and Natasha Sharygina. Tackling divergence: abstraction and acceleration in array programs. Technical Report 2012/01, University of Lugano, oct 2012. F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 14 / 24

  51. The formal framework Contribution Theorem If τ is a local ground assignment, then τ + is a Σ 0 2 -assignment. Francesco Alberti, Silvio Ghilardi, and Natasha Sharygina. Tackling divergence: abstraction and acceleration in array programs. Technical Report 2012/01, University of Lugano, oct 2012. The proof of the theorem shows the “template” for τ + F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 14 / 24

  52. The formal framework Contribution Theorem If τ is a local ground assignment, then τ + is a Σ 0 2 -assignment. Francesco Alberti, Silvio Ghilardi, and Natasha Sharygina. Tackling divergence: abstraction and acceleration in array programs. Technical Report 2012/01, University of Lugano, oct 2012. The proof of the theorem shows the “template” for τ + The template is parametric with respect to iterators selectors F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 14 / 24

  53. Tool architecture S T = � v , I ( v ) , τ ( v , v ′ ) � � I 1 , I 2 , . . . � , � S 1 , S 2 , . . . � ✔ Loop Model ? Acceleration identification Checker ✘ F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 15 / 24

  54. Acceleration for arrays Practical issue - classification of formulas Different kind of formulas 2 representing the (backward reachable) state-space: ground – formulas of the kind φ ( v ) 2 In all the formulas we admit the term a ( t ) only if t is a variable or a constant. F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 16 / 24

  55. Acceleration for arrays Practical issue - classification of formulas Different kind of formulas 2 representing the (backward reachable) state-space: ground – formulas of the kind φ ( v ) Σ 0 1 – formulas of the kind ∃ i.φ ( i, v ) 2 In all the formulas we admit the term a ( t ) only if t is a variable or a constant. F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 16 / 24

  56. Acceleration for arrays Practical issue - classification of formulas Different kind of formulas 2 representing the (backward reachable) state-space: ground – formulas of the kind φ ( v ) Σ 0 1 – formulas of the kind ∃ i.φ ( i, v ) Σ 0 2 – formulas of the kind ∃ i ∀ j.φ ( i, j, v ) 2 In all the formulas we admit the term a ( t ) only if t is a variable or a constant. F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 16 / 24

  57. Acceleration for arrays Practical issue - classification of formulas Different kind of formulas 2 representing the (backward reachable) state-space: ground – formulas of the kind φ ( v ) Σ 0 1 – formulas of the kind ∃ i.φ ( i, v ) Σ 0 2 – formulas of the kind ∃ i ∀ j.φ ( i, j, v ) � Σ 0 2 -formulas might not fall in any known decidable fragment [BMS06, GdM09] 2 In all the formulas we admit the term a ( t ) only if t is a variable or a constant. F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 16 / 24

  58. Acceleration for arrays Practical issue - classification of transitions Transition formulas can be: ground assignment – transitions of the kind τ ( v , v ′ ) Σ 0 1 -assignment – transitions of the kind ∃ i.τ ( i, v , v ′ ) Σ 0 2 -assignment – transitions of the kind ∃ i ∀ j.τ ( i, j, v , v ′ ) F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 17 / 24

  59. Acceleration for arrays Practical issue - classification of transitions Transition formulas can be: ground assignment – transitions of the kind τ ( v , v ′ ) Σ 0 1 -assignment – transitions of the kind ∃ i.τ ( i, v , v ′ ) Σ 0 2 -assignment – transitions of the kind ∃ i ∀ j.τ ( i, j, v , v ′ ) Preimages with respect to a Σ 0 2 -assignment are Σ 0 2 -formulas F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 17 / 24

  60. Acceleration for arrays Practical issue - classification of transitions Transition formulas can be: ground assignment – transitions of the kind τ ( v , v ′ ) Σ 0 1 -assignment – transitions of the kind ∃ i.τ ( i, v , v ′ ) Σ 0 2 -assignment – transitions of the kind ∃ i ∀ j.τ ( i, j, v , v ′ ) Preimages with respect to a Σ 0 2 -assignment are Σ 0 2 -formulas This prevents the practical application of the theoretical result! F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 17 / 24

  61. Acceleration for arrays Practical issue - classification of transitions Transition formulas can be: ground assignment – transitions of the kind τ ( v , v ′ ) Σ 0 1 -assignment – transitions of the kind ∃ i.τ ( i, v , v ′ ) Σ 0 2 -assignment – transitions of the kind ∃ i ∀ j.τ ( i, j, v , v ′ ) Preimages with respect to a Σ 0 2 -assignment are Σ 0 2 -formulas This prevents the practical application of the theoretical result! Solution: over-approximate problematic Σ 0 2 -formulas with their monotonic abstraction [AGP + 12] F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 17 / 24

  62. Acceleration for arrays Example τ 1 τ 0 τ 2 ¯ I l 1 P ¯ P τ 2 τ 0 v 1 ⊥ τ + τ 1 1 v + v 2 ⊥ 2 v + v 3 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 18 / 24

  63. Acceleration for arrays Example τ 1 τ 0 τ 2 ¯ I l 1 P ¯ P τ 2 τ 0 v 1 ⊥ τ + τ 1 1 v + v 2 ⊥ 2 v + v 3 3 F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 18 / 24

  64. Acceleration for arrays Example v 1 τ + 1 τ 1 Instantiate ∀ j over ∃ i v + v + v 2 2 2 Might produce spurious counterexamples F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 19 / 24

  65. Acceleration for arrays Example v 1 τ + 1 τ 1 This is a Instantiate ∀ j over ∃ i Σ 0 2 -formula v + v + v 2 2 2 Might produce spurious counterexamples F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 19 / 24

  66. Acceleration for arrays Example v 1 τ + 1 τ 1 This is a Instantiate ∀ j over ∃ i Σ 0 2 -formula v + v + v 2 2 2   pc = l L ∧ y > 0 ∧ Might produce spurious counterexamples ( i ≤ j < i + y → j < L ∧ a [ j ] � = e ) ∧ ∃ x, y ∀ j.     0 ≤ x < i ∧ a [ x ] = e ∧ i + y ≥ L F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 19 / 24

  67. Acceleration for arrays Example v 1 τ + Instantiation 1 τ 1 Instantiate j over { x, y, i, i + y, . . . } pushes it back to Σ 0 1 v + v + v 2 2 2   pc = l L ∧ y > 0 ∧ Might produce spurious counterexamples ∃ x, y ∀ j. ( i ≤ j < i + y → j < L ∧ a [ j ] � = e ) ∧     0 ≤ x < i ∧ a [ x ] = e ∧ i + y ≥ L F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 19 / 24

  68. Acceleration for arrays Example v 1 τ + 1 τ 1 Instantiate ∀ j over ∃ i v + v + v + v 2 2 2 2 Might produce spurious counterexamples F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 19 / 24

  69. Acceleration for arrays Example v 1 τ + 1 τ 1 Instantiate ∀ j over ∃ i More instantiations (more precise) v + v + v + v 2 2 2 2 Might produce spurious counterexamples F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 19 / 24

  70. Acceleration for arrays Example v 1 τ + 1 τ 1 Instantiate ∀ j over ∃ i More instantiations (more precise) v + v + v + v 2 2 2 2 Less instantiations (less precise) Might produce spurious counterexamples F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 19 / 24

  71. Acceleration for arrays Example v 1 τ + 1 τ 1 Instantiate ∀ j over ∃ i v + v + v + v 2 2 2 2 Might produce spurious counterexamples F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 19 / 24

  72. Acceleration for arrays Ad-hoc refinement for monotonic abstraction ¬ P τ + J τ i i K + K I F. Alberti Definability of Accelerated Relations in a Theory of Arrays . . . 20 / 24

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