the abstract domain of segmented ranking functions
play

The Abstract Domain of Segmented Ranking Functions Caterina Urban - PowerPoint PPT Presentation

The Abstract Domain of Segmented Ranking Functions Caterina Urban D epartement dInformatique Ecole Normale Sup erieure SAS 2013 Seattle, USA Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination


  1. The Abstract Domain of Segmented Ranking Functions Caterina Urban D´ epartement d’Informatique ´ Ecole Normale Sup´ erieure SAS 2013 Seattle, USA

  2. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work Introduction liveness properties ⇒ “something good eventually happens” termination ranking functions 1 functions that strictly decrease at each program step . . . . . . and that are bounded from below idea : computation of ranking functions by abstract interpretation 2 family of parameterized abstract domains for program termination piecewise-defined ranking functions backward invariance analysis sufficient conditions for termination instance based on intervals and affine functions 1 Floyd - Assigning Meanings to Programs (1967) 2 Cousot&Cousot - An Abstract Interpretation Framework for Termination (POPL 2012) 2 / 22

  3. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work Introduction liveness properties ⇒ “something good eventually happens” termination ranking functions 1 functions that strictly decrease at each program step . . . . . . and that are bounded from below idea : computation of ranking functions by abstract interpretation 2 family of parameterized abstract domains for program termination piecewise-defined ranking functions backward invariance analysis sufficient conditions for termination instance based on intervals and affine functions 1 Floyd - Assigning Meanings to Programs (1967) 2 Cousot&Cousot - An Abstract Interpretation Framework for Termination (POPL 2012) 2 / 22

  4. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work Introduction liveness properties ⇒ “something good eventually happens” termination ranking functions 1 functions that strictly decrease at each program step . . . . . . and that are bounded from below idea : computation of ranking functions by abstract interpretation 2 family of parameterized abstract domains for program termination piecewise-defined ranking functions backward invariance analysis sufficient conditions for termination instance based on intervals and affine functions 1 Floyd - Assigning Meanings to Programs (1967) 2 Cousot&Cousot - An Abstract Interpretation Framework for Termination (POPL 2012) 2 / 22

  5. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work Our Contribution liveness properties ⇒ “something good eventually happens” termination ranking functions 1 functions that strictly decrease at each program step . . . . . . and that are bounded from below idea : computation of ranking functions by abstract interpretation 2 family of parameterized abstract domains for program termination piecewise-defined ranking functions backward invariance analysis sufficient conditions for termination instance based on intervals and affine functions 1 Floyd - Assigning Meanings to Programs (1967) 2 Cousot&Cousot - An Abstract Interpretation Framework for Termination (POPL 2012) 2 / 22

  6. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work Our Contribution liveness properties ⇒ “something good eventually happens” termination ranking functions 1 functions that strictly decrease at each program step . . . . . . and that are bounded from below idea : computation of ranking functions by abstract interpretation 2 family of parameterized abstract domains for program termination piecewise-defined ranking functions backward invariance analysis sufficient conditions for termination instance based on intervals and affine functions 1 Floyd - Assigning Meanings to Programs (1967) 2 Cousot&Cousot - An Abstract Interpretation Framework for Termination (POPL 2012) 2 / 22

  7. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work Example 1 x < 0 int : x x := − 2 x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 3 / 22

  8. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work Example 1 x < 0 int : x x := − 2 x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 the program terminates but there exists no linear ranking function! 3 / 22

  9. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work Example 1 x < 0 int : x x := − 2 x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 we map each point to a function of x giving an upper bound on the steps before termination 3 / 22

  10. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work ⊥ Example 1 x < 0 int : x x := − 2 x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 ⊥ we map each point to a function of x giving ⊥ an upper bound on the steps before termination 3 / 22

  11. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work ⊥ Example 1 x < 0 int : x x := − 2 x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 ⊥ we map each point to a function of x giving we start at the end an upper bound on the with 0 steps steps before termination before termination x 0 3 / 22

  12. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work we take into account x < 0 and we have now 1 step to termination x 0 Example 1 x < 0 int : x x := − 2 x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 ⊥ we map each point to a function of x giving an upper bound on the steps before termination x 0 3 / 22

  13. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work x 0 we consider the assignment Example and we are now at 1 2 steps to termination x < 0 int : x x := − 2x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 we map each point x to a function of x giving 6 an upper bound on the steps before termination x 0 3 / 22

  14. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work = ⊔ x x x 0 6 0 6 Example we consider x ≥ 0 1 and we do the join x < 0 int : x x := − 2 x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 we map each point x to a function of x giving 6 an upper bound on the steps before termination x 0 3 / 22

  15. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work = ⊔ x x x 0 2 6 0 2 6 Example 1 x < 0 int : x x := − 2x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 we map each point x to a function of x giving 2 6 an upper bound on the steps before termination x 0 3 / 22

  16. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work = ⊔ x x x 0 2 4 6 0 2 4 6 Example 1 x < 0 int : x x := − 2x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 we map each point x to a function of x giving 2 4 6 an upper bound on the steps before termination x 0 3 / 22

  17. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work = ⊔ x x x 0 2 4 6 0 2 4 6 Example 1 x < 0 int : x x := − 2x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 we map each point x to a function of x giving 2 4 6 an upper bound on the steps before termination x 0 3 / 22

  18. Introduction Concrete Semantics Our Contribution An Abstract Domain for Termination Conclusion and Future Work x we are able to find a 0 2 4 6 piecewise-defined ranking Example function for the program! 1 x < 0 int : x x := − 2 x + 10 x ≥ 0 while 1 ( x ≥ 0) do 2 x := − 2 x + 10 2 3 od 3 we map each point x to a function of x giving 2 4 6 an upper bound on the steps before termination x 0 3 / 22

  19. Concrete Semantics

  20. Introduction Concrete Semantics Trace Semantics An Abstract Domain for Termination Termination Semantics Conclusion and Future Work program P �→ trace semantics β τ final states finite traces Σ + infinite traces Σ ∞ Σ states τ transition relation 5 / 22

  21. Introduction Concrete Semantics Trace Semantics An Abstract Domain for Termination Termination Semantics Conclusion and Future Work v τ ∈ Σ �→ O v τ � lfp φ τ � 0 if s ∈ β τ φ τ ( v ) � λ s . sup { v ( s ′ ) + 1 | � s , s ′ � ∈ τ } if s ∈ � pre(dom( v )) Example Theorem (Soundness and Completeness) v τ is sound and complete to prove the termination of programs Cousot&Cousot - An Abstract Interpretation Framework for Termination (POPL 2012) 6 / 22

  22. Introduction Concrete Semantics Trace Semantics An Abstract Domain for Termination Termination Semantics Conclusion and Future Work v τ ∈ Σ �→ O v τ � lfp φ τ � 0 if s ∈ β τ φ τ ( v ) � λ s . sup { v ( s ′ ) + 1 | � s , s ′ � ∈ τ } if s ∈ � pre(dom( v )) Example 0 0 Theorem (Soundness and Completeness) v τ is sound and complete to prove the termination of programs Cousot&Cousot - An Abstract Interpretation Framework for Termination (POPL 2012) 6 / 22

Recommend


More recommend