verification of one integer parameter recursive
play

Verification of One Integer Parameter Recursive Sequential - PowerPoint PPT Presentation

Verification of One Integer Parameter Recursive Sequential Procedures Ahmed Bouajjani Liafa - University of Paris 7 joint work with Peter Habermehl and Richard Mayr 1 Verification of Boolean Recursive Procedures Boolean Recursive Procedures


  1. Verification of One Integer Parameter Recursive Sequential Procedures Ahmed Bouajjani Liafa - University of Paris 7 joint work with Peter Habermehl and Richard Mayr 1

  2. Verification of Boolean Recursive Procedures Boolean Recursive Procedures − → Context-Free Processes Interprocedural data flow analysis and verification problems (safety properties) of recursive programs can be formulated as reachability analysis problems for context-free (or pushdown) processes: = ⇒ Computing sets of successors / predecessors of given sets of configurations. e.g., [Steffen and al., 96], [Esparza and Knop, 99] 2

  3. Verification of Boolean Recursive Procedures Boolean Recursive Procedures − → Context-Free Processes Interprocedural data flow analysis and verification problems (safety properties) of recursive programs can be formulated as reachability analysis problems for context-free (or pushdown) processes: = ⇒ Computing sets of successors / predecessors of given sets of configurations. e.g., [Steffen and al., 96], [Esparza and Knop, 99] Symbolic Reachability Analysis of Context-Free Processes Algorithms for symbolic reachability analysis and model-checking of pushdown systems • Sets of stack configurations are represented by means of finite-state automata. • Polynomial constructions of the post ∗ and pre ∗ images of given regular sets of configurations. e.g., [Bouajjani, Esparza, Maler, 97], [Finkel, Willems, Wolper, 97], [Esparza, Schwoon, 01] • Efficient tools have been developed based on these techniques (e.g., Edinburgh, Microsoft). 3

  4. Recursive Procedures with Integer Parameters Example: Fibonacci function F ( v ) = if n ≤ 1 then return 1 else return F ( v − 1) + F ( v − 2) Reachable configurations (stack contents) from F (5): F (5) F (4) F (3) F (3) F (2) F (3) F (2) F (1) F (2) F (3) F (1) F (0) F (1) F (2) F (3) F (0) F (1) F (2) F (3) F (1) F (2) F (3) F (2) F (3) F (1) F (0) F (3) F (0) F (3) F (3) F (2) F (1) F (1) F (0) F (1) F (0) F (1) F (1) ǫ 4

  5. Parametrized Context-Free Processes Integer Symbol Sequences (ISS) Finite sequences of the form: X 1 ( k 1 ) X 2 ( k 2 ) . . . X n ( k n ) where X i ∈ Γ and k i ∈ Z Z BPA( Z Z ) • Set ∆ of rewriting rules of the form: X ( v ) → X 1 ( e 1 ) X 2 ( e 2 ) . . . X n ( e n ) , P ( v ) where – e i is either k i or v + k i ( k i ∈ Z Z ), – P ( v ) is a Presburger predicate. • Prefix rewriting: Defines a transition relation = ⇒ ∆ on ISS. ∗ ∗ • post ∗ ⇒ ∆ α } , pre ∗ ∆ ( C ) = { α | ∃ β ∈ C. β = ∆ ( C ) = { α | ∃ β ∈ C. α = ⇒ ∆ β } . 5

  6. Example BPA( Z Z ) system for the Fibonacci function: F ( v ) → v ≤ 1 ǫ F ( v ) → F ( v − 1) F ( v − 2) v > 1 Post ∗ ( { F ( k ) | k ≥ 0 } ): F ( k ) F ( k − 1) F ( k − 2) F ( k − 2) F ( k − 3) F ( k − 2) F ( k − 3) F ( k − 4) F ( k − 3) F ( k − 2) F ( k − 4) F ( k − 5) F ( k − 4) F ( k − 3) F ( k − 2) · · · F ( k − 3) F ( k − 2) F ( k − 4) F ( k − 5) F ( k − 2) · · · F ( k − 5) F ( k − 2) F ( k − 6) F ( k − 7) F ( k − 2) F ( k − 7) F ( k − 8) F ( k − 7) F ( k − 2) · · · 6

  7. Z -input 1-Counter Automata Z • Input = Integer Symbol Sequence • Equality tests between the integer input and the counter value X ( c ) X (0) X (2) X (4) X (6) · · · c := c + 2 X (1) X (3) X (5) · · · guess ( c ) · · · X ( k ) X ( k + 2) · · · X ( k + 2 n ) · · · Figure 1: Example 7

  8. Recognizing Fibonacci Configurations F (5) guess ( c ) F ( c ) F (4) F (3) F ( c ) c := c − 1 F (3) F (2) F (3) F ( c ) c := c + 2 F (2) F (1) F (2) F (3) c := c + 2 F (1) F (0) F (3) c := c − 1 F ( c ) c := c + 2 Figure 2: Post ∗ ( { F ( k ) | k ≥ 0 } ) 8

  9. Main Results (1) Forward Reachability Analysis Let ∆ be a BPA( Z Z ) system, and let A be a Z Z -input 1-counter automaton. Z -input 1-counter automaton A ′ with L ( A ′ ) = post ∗ Then, a Z ∆ ( L ( A )) can be effectively constructed. 9

  10. Main Results (1) Forward Reachability Analysis Let ∆ be a BPA( Z Z ) system, and let A be a Z Z -input 1-counter automaton. Z -input 1-counter automaton A ′ with L ( A ′ ) = post ∗ Then, a Z ∆ ( L ( A )) can be effectively constructed. Backward Reachability Analysis • The membership problem (of an ISS) in pre ∗ ∆ ( L ( A )), where A is a Z Z -input 1-counter automaton, is undecidable. 10

  11. Main Results (1) Forward Reachability Analysis Let ∆ be a BPA( Z Z ) system, and let A be a Z Z -input 1-counter automaton. Z -input 1-counter automaton A ′ with L ( A ′ ) = post ∗ Then, a Z ∆ ( L ( A )) can be effectively constructed. Backward Reachability Analysis • The membership problem (of an ISS) in pre ∗ ∆ ( L ( A )), where A is a Z Z -input 1-counter automaton, is undecidable. • The set pre ∗ ∆ ( L ( A )), where A is a Z Z -input 1-counter automaton, is not recognizable by Z Z -input 1-counter automata. 11

  12. Main Results (1) Forward Reachability Analysis Let ∆ be a BPA( Z Z ) system, and let A be a Z Z -input 1-counter automaton. Z -input 1-counter automaton A ′ with L ( A ′ ) = post ∗ Then, a Z ∆ ( L ( A )) can be effectively constructed. Backward Reachability Analysis • The membership problem (of an ISS) in pre ∗ ∆ ( L ( A )), where A is a Z Z -input 1-counter automaton, is undecidable. • The set pre ∗ ∆ ( L ( A )), where A is a Z Z -input 1-counter automaton, is not recognizable by Z Z -input 1-counter automata. • Let ∆ be a BPA( Z Z ) system, and let R be a finite-state automaton. Z -input 1-counter automaton A with L ( A ) = pre ∗ Then, a Z ∆ ( L ( R ) ↑ ) can be effectively constructed. where, for any regular language L over Γ, L ↑ = { X 1 ( k 1 ) X 2 ( k 2 ) · · · X n ( k n ) | X 1 X 2 · · · X n ∈ L, and k 1 , . . . k 2 ∈ Z Z } 12

  13. Configuration Properties Pattern Constraints ϕ = � A 1 , . . . , A n , P � where A 1 , . . . , A n are finite automata over Γ, and P is an n -ary Presburger predicate. Semantics Let w be an ISS. Then, w | = � A 1 , . . . , A n , P � iff ∃ w 1 , . . . , w n ∈ ISS, ∃ X 1 , . . . , X n ∈ Γ, ∃ k 1 , . . . , k n ∈ Z Z , such that w = w 1 · X 1 ( k 1 ) · w 2 · X 2 ( k 2 ) · · · w n · X n ( k n ) and • ∀ i ∈ { 1 , . . . , n } , w i | Γ · X i ∈ L ( A i ), • P ( k 1 , . . . , k n ) is true. 13

  14. Reachability/Safety Properties Decide whether w | = EF ϕ i.e., ∃ w ′ . w ′ ∈ post ∗ ∆ ( w ) and w ′ | = ϕ . 14

  15. Reachability/Safety Properties Decide whether w | = EF ϕ i.e., ∃ w ′ . w ′ ∈ post ∗ ∆ ( w ) and w ′ | = ϕ . Examples • Can the procedure X be called with some parameter greater than 5 ? EF � X, Γ ∗ , v 1 ≥ 5 � • Can the execution stack contain two intances of the procedures X with same parameter ? EF � Γ ∗ X, Γ ∗ X, Γ ∗ , v 1 = v 2 � • The stack always contains an increasing sequences of X -parameters ¬ EF � Γ ∗ X, Γ ∗ X, Γ ∗ , v 1 ≥ v 2 � 15

  16. Main Results (2) Pattern Constraints Reachability Properties Theorem The problem w | = EF ϕ is decidable. 16

  17. Main Results (2) Pattern Constraints Reachability Properties Theorem The problem w | = EF ϕ is decidable. Reachable Parameter n -vectors What is the set of all possible parameter values for which X can be called ? 17

  18. Main Results (2) Pattern Constraints Reachability Properties Theorem The problem w | = EF ϕ is decidable. Reachable Parameter n -vectors What is the set of all possible parameter values for which X can be called ? { k | X ( k ) · w ′ ∈ post ∗ ∆ ( w ) } 18

  19. Main Results (2) Pattern Constraints Reachability Properties Theorem The problem w | = EF ϕ is decidable. Reachable Parameter n -vectors What is the set of all possible parameter values for which X can be called ? { k | X ( k ) · w ′ ∈ post ∗ ∆ ( w ) } Theorem Let ∆ be a BPA( Z Z ) system, let w be an initial configuration (ISS), and let ϕ be a pattern constraint. Then, the set Z n | ∃ w ′ = w 1 · X 1 ( k 1 ) · w 2 · X 2 ( k 2 ) · · · w n · X n ( k n ) ∈ post ∗ ∆ ( w ) . w ′ | { ( k 1 , . . . , k n ) ∈ Z = ϕ } is semilinear and effectively constructible. 19

  20. Outline • Z Z -input 1-Counter Automata, • Construction of the post ∗ image, • Reachability properties, • Conclusion. 20

  21. Z -input 1-Counter Automata Z Definition • Control states Q (including q 0 , accept, fail) • Counter c (with initial value 0) • Instructions – ( q : c := c + 1; goto q ′ ) – ( q : c := c − 1; goto q ′ ) – ( q : If c ≥ 0 then goto q ′ else goto q ′′ ). – ( q : If c = 0 then goto q ′ else goto q ′′ ). 21

  22. Z -input 1-Counter Automata Z Definition • Control states Q (including q 0 , accept, fail) • Counter c (with initial value) • Instructions – ( q : c := c + 1; goto q ′ ) – ( q : c := c − 1; goto q ′ ) – ( q : If c ≥ 0 then goto q ′ else goto q ′′ ). – ( q : If c = 0 then goto q ′ else goto q ′′ ). – ( q : Read input S ( i ) . If S = X and i = K then goto q ′ else goto q ′′ ). – ( q : Read input S ( i ) . If S = X and i = c then goto q ′ else goto q ′′ ). 22

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