Compositional Algorithms for Succinct Safety Games Romain Brenguier, Guillermo A. P´ erez, Jean-Franc ¸ois Raskin, Ocan Sankur SYNT’15
Reactive Synthesis for circuits AbsSynthe https://github.com/gaperez64/AbsSynthe Specification: G( ¬ ( o 1 ∧ o 2 )) ∧ G( i 1 → X o 3 ) i 1 i 2 i 3 i 4 i 5 i 1 i 2 i 3 i 4 i 5 Contr. ℓ 1 ℓ 2 ℓ 3 ℓ 1 ℓ 2 ℓ 3 o 1 o 2 o 3 o 4 o 5 o 1 o 2 o 3 o 4 o 5 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 2 / 17
Succinct Safety Games Safety game: � Stat , Act u , Act c , δ, U� Succinct representation: Stat = { 0 , 1 } L , Act u = { 0 , 1 } X u , Act c = { 0 , 1 } X c , δ and U are given by And-Inverter Graphs (AIG) → standard file format for sequential synchronous circuits → used in model checking and synthesis competitions ℓ ′ 1 a 1 a 2 ℓ 1 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 3 / 17
Succinct Safety Games Safety game: � Stat , Act u , Act c , δ, U� Succinct representation: Stat = { 0 , 1 } L , Act u = { 0 , 1 } X u , Act c = { 0 , 1 } X c , δ and U are given by And-Inverter Graphs (AIG) → standard file format for sequential synchronous circuits → used in model checking and synthesis competitions ℓ ′ 1 ∧ ¬ ∧ ∧ a 1 a 2 ℓ 1 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 3 / 17
The classical algorithm: attractor computation For the safety game � Stat , Act u , Act c , δ, U� : 1 uncontrollable predecessors: states where environment can force S in 1 step: UPRE( S ) = { s | ∃ a u , ∀ a c , δ ( s , a u , a c ) ∈ S } 2 Compute the least fixpoint of UPRE starting from the error states U . → if s 0 ∈ Stat \ UPRE ∗ ( U ), controller has a winning strategy U s 0 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 4 / 17
The classical algorithm: attractor computation For the safety game � Stat , Act u , Act c , δ, U� : 1 uncontrollable predecessors: states where environment can force S in 1 step: UPRE( S ) = { s | ∃ a u , ∀ a c , δ ( s , a u , a c ) ∈ S } 2 Compute the least fixpoint of UPRE starting from the error states U . → if s 0 ∈ Stat \ UPRE ∗ ( U ), controller has a winning strategy U UPRE 1 ( U ) s 0 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 4 / 17
The classical algorithm: attractor computation For the safety game � Stat , Act u , Act c , δ, U� : 1 uncontrollable predecessors: states where environment can force S in 1 step: UPRE( S ) = { s | ∃ a u , ∀ a c , δ ( s , a u , a c ) ∈ S } 2 Compute the least fixpoint of UPRE starting from the error states U . → if s 0 ∈ Stat \ UPRE ∗ ( U ), controller has a winning strategy ( ( ( U UPRE 1 ( U ) s 0 UPRE 2 ( U ) UPRE ∗ ( U ) Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 4 / 17
Implementation with BDDs We use Binary Decision Diagrams (BDDs): data structure to represent Boolean functions efficient Boolean operations ( ∧ , ∨ , ∀ , ∃ ,. . . ) and equality test 2 basic approaches: 1 Compute a transition relation ℓ ′ ⇔ f ℓ ( L , X u , X c ) � T ( L , X u , X c , L ′ ) = ℓ ∈ L and then set UPRE( S ) = ∃ X u , ∀ X c , ∃ L ′ . T ( L , X u , X c , L ′ ) ∧ S ( L ′ ). (solved approximately 150 out of 530 benchmarks from last year’s competition) 2 Keep a partitioned transition relation, and substitute f ℓ for each ℓ in S UPRE( S ) = ∃ X u , ∀ X c : S ( L ′ )[ ℓ ′ ← f ℓ ( X u , X c , L )] ℓ ∈ L . (solved approximately 500 benchmarks in 500 seconds) Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 5 / 17
Idea of the decomposition Often: specifications are big conjunctions of smaller specifications Example from amba2b9 assign sys safe err = sys safe err0 | sys safe err1 | sys safe err2 | ...| sys safe err19; assign o err = ∼ env safe err & ∼ env safe err happened & (sys safe err | fair err); o err can be rewritten: ( ∼ env safe err & ∼ env safe err happened & fair err ) | φ 0 | ...| φ 19 where φ i = ∼ env safe err & ∼ env safe err happened & sys safe err i we define a game G i for each formula φ i to win the “big” game, we must win each “small” game G i Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 6 / 17
Decomposition of AIGs We must recover the structure of the specifications from the AIG Explore the graph until encountering a negation This corresponds to a disjunction, and it can be distributed over err err err ∧ ∨ ∧ ∨ ∧ ∧ a 2 ∧ ℓ 1 a 1 a 2 a 1 a 2 ℓ 1 ℓ 1 a 1 a 2 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 7 / 17
Decomposition of AIGs We must recover the structure of the specifications from the AIG Explore the graph until encountering a negation This corresponds to a disjunction, and it can be distributed over err err err ∧ ∨ ∧ ∨ ∧ ∧ a 2 ∧ ℓ 1 a 1 a 2 a 1 a 2 ℓ 1 ℓ 1 a 1 a 2 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 7 / 17
Decomposition of AIGs We must recover the structure of the specifications from the AIG Explore the graph until encountering a negation This corresponds to a disjunction, and it can be distributed over err err err ∧ ∨ ∧ ∨ ∧ ∧ a 2 ∧ ℓ 1 a 1 a 2 a 1 a 2 ℓ 1 ℓ 1 a 1 a 2 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 7 / 17
Subgames We obtain a decomposition err = e 1 ∨ e 2 ∨ · · · ∨ e n If formula e i does not depend on all latches, solving the game for e i can be more efficient Cone of influence cone ( e i ): set of variables on which e i depends (directly or indirectly) → can be over-approximated efficiently by exploring the AIG We consider the game G i where the error function is given by e i and we only consider variables in cone ( e i ) Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 8 / 17
Compositional algorithm 1: Global aggregation Compute the winning region of each subgame If the intersection does not contain the initial state, then there is no controller Otherwise compute the fixpoint starting from the intersection U 1 s 0 U 2 U 3 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 9 / 17
Compositional algorithm 1: Global aggregation Compute the winning region of each subgame If the intersection does not contain the initial state, then there is no controller Otherwise compute the fixpoint starting from the intersection U 1 UPRE ∗ ( U 1 ) s 0 U 2 U 3 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 9 / 17
Compositional algorithm 1: Global aggregation Compute the winning region of each subgame If the intersection does not contain the initial state, then there is no controller Otherwise compute the fixpoint starting from the intersection U 1 UPRE ∗ ( U 1 ) s 0 U 2 UPRE ∗ ( U 2 ) U 3 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 9 / 17
Compositional algorithm 1: Global aggregation Compute the winning region of each subgame If the intersection does not contain the initial state, then there is no controller Otherwise compute the fixpoint starting from the intersection U 1 UPRE ∗ ( U 1 ) s 0 U 2 UPRE ∗ ( U 2 ) U 3 UPRE ∗ ( U 3 ) Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 9 / 17
Compositional algorithm 1: Global aggregation Compute the winning region of each subgame If the intersection does not contain the initial state, then there is no controller Otherwise compute the fixpoint starting from the intersection U 1 UPRE ∗ ( U 1 ) s 0 U 2 UPRE ∗ ( U 2 ) UPRE ∗ ( � i UPRE ∗ ( U i )) U 3 UPRE ∗ ( U 3 ) Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 9 / 17
Matrix multiplication benchmarks � � � � � � u ′ u ′ u 1 , 1 u 1 , 2 c 1 , 1 c 1 , 2 1 , 1 1 , 2 err ≡ · � = u ′ u ′ u 2 , 1 u 2 , 2 c 2 , 1 c 2 , 2 2 , 1 2 , 2 y -axis: time limit (in seconds), f x -axis: number of benchmarks that are solvable within the time limit Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 10 / 17
Washing system benchmarks push 1 fill 1 Tank 1 Tank 2 Tank 3 Tank 4 empty 1 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 11 / 17
Compositional algorithm 2: Incremental aggregation While there are several subgames: join two of them and solve the new sub-game that is obtained U 1 s 0 U 2 U 3 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 12 / 17
Compositional algorithm 2: Incremental aggregation While there are several subgames: join two of them and solve the new sub-game that is obtained U 1 UPRE ∗ ( U 1 ) s 0 U 2 U 3 Brenguier, P´ erez, Raskin, Sankur (ULB) Compositional Algo. for Succ. Safety Games SYNT’15 12 / 17
Recommend
More recommend