Reactive Synthesis Swen Jacobs <swen.jacobs@iaik.tugraz.at> - - PowerPoint PPT Presentation

reactive synthesis
SMART_READER_LITE
LIVE PREVIEW

Reactive Synthesis Swen Jacobs <swen.jacobs@iaik.tugraz.at> - - PowerPoint PPT Presentation

Reactive Synthesis Swen Jacobs <swen.jacobs@iaik.tugraz.at> VTSA 2013 Nancy, France 24.09.2013 u www.iaik.tugraz.at 2 Property Synthesis (You Will Never Code Again) VTSA 2013 Swen Jacobs Construct Correct Systems Automatically 3


slide-1
SLIDE 1

u www.iaik.tugraz.at

Reactive Synthesis

24.09.2013 Swen Jacobs <swen.jacobs@iaik.tugraz.at> VTSA 2013 Nancy, France

slide-2
SLIDE 2

Swen Jacobs VTSA 2013 2

Property Synthesis

(You Will Never Code Again)

slide-3
SLIDE 3

Swen Jacobs VTSA 2013 3

Construct Correct Systems

Requirements Specification Implementation Verification

Synthesis

Don’t do the same thing twice! Use synthesis!

Automatically

slide-4
SLIDE 4

Swen Jacobs VTSA 2013 4

Motivation

  • Coding is hard, want higher level of abstraction:
  • Bugs are:
  • very expensive, especially in security critical

applications and hardware

  • hard to kill: finding and fixing bugs takes 50%-80%
  • f design time

Machine code ⇒ Assembly ⇒ C ⇒ Java ⇒ Ruby? ⇒ … Silicon ⇒ Gates ⇒ RTL ⇒ Transactions? ⇒ …

slide-5
SLIDE 5

Swen Jacobs VTSA 2013 5

Our Focus

  • Reactive systems
  • Continuous interaction with environment
  • Correctness statements are temporal

(temporal logic, automata)

  • Ex: Operating systems, web browsers, circuits,

protocols

  • Finite State
  • Prototypical finite state reactive system: circuit
  • Not our focus: functions
  • One input, one output, non-termination is a bug
  • Correctness is input/output relation (Hoare logic)
slide-6
SLIDE 6

Swen Jacobs VTSA 2013 6

Other Application Areas

  • Program repair
  • Program sketching
  • Synthesis of synchronization skeletons
slide-7
SLIDE 7

Synthesis, Part I: Basics

Swen Jacobs VTSA 2013 7

  • Synthesis as a Game
  • General: LTL Synthesis
  • Time-Efficient: GR(1) Synthesis
  • Application: AMBA Bus Protocol
  • Space-Efficient: Bounded/Safraless Approaches
slide-8
SLIDE 8

Swen Jacobs VTSA 2013 8

Synthesis as a Game

slide-9
SLIDE 9

Swen Jacobs VTSA 2013 9

Synthesis as a Game

Given

  • Input and output signals
  • Specification of the behavior

Determine

  • Realizability: Is there a finite state system

that realizes the specification?

  • Synthesis: If system exists, construct it

Two player game

  • Environment: determines inputs (not controllable)
  • System: determines outputs (controllable)
  • Game: finite state graph, infinite plays
  • Winning condition for player System: formula φ

?

slide-10
SLIDE 10

Swen Jacobs VTSA 2013 10

Games

Two player graph-based, turn-based games with infinitary winning conditions

  • Antagonist controls 𝐽
  • Protagonist controls 𝑃
  • graph based:
  • Set of states 𝑅
  • Initial state 𝑟0
  • Transition function 𝜀: 𝑅 × 𝐽 × 𝑃 → 𝑅
  • turn based:
  • Start from 𝑟0
  • Antagonist selects 𝑗𝑙, protagonist selects 𝑝𝑙, proceed to 𝑟𝑙+1 = 𝜀(𝑗𝑙, 𝑝𝑙)
  • Ensuing play: 𝑟0 𝑗0 𝑝0 𝑟1 𝑗1 𝑝1 𝑟2 …
  • Winning condition: objective over F ⊆ 𝑅
  • Strategy: 𝑅 × 𝐽∗ → 𝑃
  • For every input sequence, strategy fixes a play
  • Winning strategy: strategy such that all resulting plays fulfill 

graph-based, turn-based with infinitary winning conditions Two player

slide-11
SLIDE 11

Winning Conditions

Swen Jacobs VTSA 2013 11

  • Reachability: want to reach a state in F ⊆ 𝑅
  • Safety: want to stay in F ⊆ 𝑅
  • Büchi: want to visit F ⊆ 𝑅 infinitely often
  • Co-Büchi: want to visit F ⊆ 𝑅 only finitely often
  • others exist… (later)
slide-12
SLIDE 12

Swen Jacobs VTSA 2013 12

Example

𝒋𝒐𝒒𝒗𝒖 𝒄𝒗𝒖𝒖𝒑𝒐 𝒑𝒗𝒖𝒒𝒗𝒖 𝒅𝒑𝒈𝒈𝒇𝒇 𝐇(𝒄𝒗𝒖𝒖𝒑𝒐  𝐆 𝒅𝒑𝒈𝒈𝒇𝒇)

¬𝑑 𝑐 ∧ ¬𝑑 ¬𝑐 ∨ 𝑑

1 𝑟0 𝑟1

𝑑

Possible strategy: serve coffee iff automaton is in state 𝑟1 In this case, LTL game reduces to Büchi game

LTL game Büchi game

red moves first green moves second green’s objective: visit 𝑟0 infinitely often

slide-13
SLIDE 13

Example: Alternative Representation

Swen Jacobs VTSA 2013 13

¬𝑐 𝑑 ¬𝑑 𝑐 𝑑 ¬𝑑

¬𝑑 𝑐 ∧ ¬𝑑 ¬𝑐 ∨ 𝑑

1 𝑟0 𝑟1

𝑑

  • compact
  • looks like automaton
  • rder of moves (input, output)
  • nly implicit
  • explicit order of moves
  • need more states
slide-14
SLIDE 14

Swen Jacobs VTSA 2013 14

Symbolic Computation: Fixpoints

A B C D

0/-,1/0

0/1,1/0 1/1 0/0,1/1 Find all states from which system can force visit to goal state (= winning region / attractor) + a strategy Label on edges:

  • Environment input
  • System output

dash (–) means don‘t care

0/- 1/-

A

0/0,1/1

0/- 1/-

Winning region B

0/-,1/0

0/1,1/0 1/1

C A

0/0,1/1

0/- 1/-

D D C

0/-,1/0

0/1,1/0 1/1

B

slide-15
SLIDE 15

Swen Jacobs VTSA 2013 15

Computing Büchi Games

𝑮𝒑𝒔𝒅𝒇𝟐(𝑮) = set of states from which system can force visit to 𝑇 in one step 𝑮𝒑𝒔𝒅𝒇𝟐 𝑮 = 𝒓 ∈ 𝑹 ∀𝑗 ∈ 𝐽 ∃𝑝 ∈ 𝑃: 𝜀 𝑟, 𝑗, 𝑝 ∈ 𝐺 }

¬𝑐 𝑑 ¬𝑑 𝑐 𝑑 ¬𝑑

slide-16
SLIDE 16

Swen Jacobs VTSA 2013 16

Computing Büchi Games

𝑮𝒑𝒔𝒅𝒇𝟐(𝑮) = set of states from which system can force visit to 𝐺 in one step 𝑮𝒑𝒔𝒅𝒇∗ 𝑮 = set of states from which system can force visit to 𝐺 in any number of steps (least fixpoint of applying 𝐺𝑝𝑠𝑑𝑓1 to 𝐺) 𝑺𝒇𝒅𝒗𝒔(𝑮) = set of states from which system can repeatedly force visit to 𝐺 in any number of steps (nested fixpoint operation)

¬𝑐 𝑑 ¬𝑑 𝑐 𝑑 ¬𝑑

slide-17
SLIDE 17

Swen Jacobs VTSA 2013 17

Computing Büchi Games

Winning region is 𝑮𝒑𝒔𝒅𝒇∗ 𝑮 for reachability game, 𝑺𝒇𝒅𝒗𝒔 𝑮 for Büchi game. (Safety defined with dual 𝐺𝑝𝑠𝑑𝑓 operator for environment) For reachability, safety and Büchi games, memoryless strategies are sufficient, i.e., strategies 𝑅 × 𝐽 → 𝑃

¬𝑐 𝑑 ¬𝑑 𝑐 𝑑 ¬𝑑

slide-18
SLIDE 18

Swen Jacobs VTSA 2013 18

FourSteps to Synthesis

  • 1. Specify
  • LTL, Büchi automata,…
  • 2. Obtain a game
  • 3. Solve the game
  • 4. Construct circuit
slide-19
SLIDE 19

Swen Jacobs VTSA 2013 19

LTL Synthesis

slide-20
SLIDE 20

Swen Jacobs VTSA 2013 20

LTL Synthesis

LTL Synthesis [PnueliRosner89] 1. Specify

  • Formula 𝜒 in LTL

2. Obtain a game

  • Convert 𝜒 to nondeterministic

Büchi automaton 𝐵 (exponential blowup)

  • Convert 𝐵 to deterministic

Rabin or Parity automaton (=game) (exponential blowup)

3. Solve the game

  • parity games can be solved

in polynomial time

4. Construct Circuit

slide-21
SLIDE 21

Swen Jacobs VTSA 2013 21

Arbiter: From LTL to Büchi

Input: 𝑠

1, 𝑠 2 (requests)

Output: 𝑕1, 𝑕2 (grants) Specification: 𝐇 𝑠

1 → 𝐆 𝑕1

𝐇 𝑠

2 → 𝐆 𝑕2

𝐇¬ 𝑕1 ∧ 𝑕2 Arbiter

𝑠

1, 𝑠 2

𝑕1, 𝑕2

1. Specify 2. Obtain a game 3. Solve the game 4. Construct circuit

slide-22
SLIDE 22

Swen Jacobs VTSA 2013 22

Obtaining a game

  • From LTL to Büchi automata
  • Not in detail in this tutorial – see [VardiWolper86]
  • From Büchi automata to games
  • Non-determinism is bad
  • Advanced acceptance conditions

1. Specify 2. Obtain a game 3. Solve the game 4. Construct circuit

slide-23
SLIDE 23

Swen Jacobs VTSA 2013 23

Arbiter: From LTL to Büchi

Input: 𝑠

1, 𝑠 2 (requests)

Output: 𝑕1, 𝑕2 (grants) Specification: 𝐇 𝑠

1 → 𝐆 𝑕1

𝐇 𝑠

2 → 𝐆 𝑕2

𝐇¬ 𝑕1 ∧ 𝑕2 Arbiter

𝑠

1, 𝑠 2

𝑕1, 𝑕2

1. Specify 2. Obtain a game 3. Solve the game 4. Construct circuit

slide-24
SLIDE 24

Swen Jacobs VTSA 2013 24

Nondeterminism is bad

input button, water

  • utput coffee

𝐇𝐆 𝒙𝒃𝒖𝒇𝒔  𝐇 𝒄𝒗𝒖𝒖𝒑𝒐  𝐆 𝒅𝒑𝒈𝒈𝒇𝒇 ∧ 𝐇(𝒙𝒃𝒖𝒇𝒔  𝒅𝒑𝒈𝒈𝒇𝒇)

¬𝑥 ∧ ¬𝑑 𝑐 ∧ ¬𝑑 ¬𝑐 ∨ 𝑑 ∧ 𝑥

1 1

¬𝑑 𝑑 ∧ 𝑥

1 1 LTL game Büchi game

No winning strategy because of nondeterminism, even though LTL game is won

won? won?

Note: not complete!

slide-25
SLIDE 25

Advanced Acceptance Conditions

Swen Jacobs VTSA 2013 25

  • Rabin: defined by 𝐹1, 𝐺

1 , … , 𝐹𝑜, 𝐺 𝑜

, with 𝐹𝑗, 𝐺𝑗 ⊆ 𝑅. System wins if there exists an 𝒋 such that 𝐹𝑗 is visited finitely often and 𝐺𝑗 is visited infinitely often.

  • Streett: like Rabin, but System wins if for all 𝒋, if 𝐺𝑗

is visited infinitely often, then 𝐹𝑗 must be visited infinitely often. (negation of Rabin)

  • Parity: every state is assigned a priority from ℕ.

System wins if minimum priority of all states visited infinitely often is even.

slide-26
SLIDE 26

Swen Jacobs VTSA 2013 26

LTL Synthesis

1. Specify

  • Formula 𝜒 in LTL, size 𝑜

2. Obtain a game

  • Convert 𝜒 to a nondeterministic Büchi Automaton 𝐵,

size 2𝑜

  • Determinize 𝐵 to a deterministic Parity automaton

(=game), size 22𝑜

3. Solve the parity game, time 22𝑜 Will not consider this approach in detail. It is complex and not very scalable.

slide-27
SLIDE 27

Swen Jacobs VTSA 2013 27

LTL Synthesis – Alternative Approaches

Synthesis problem can also be solved by

  • decomposing 𝜒, simplifying each part, then composing

[SohailSomenzi09, MorgensternSchneider10] (not in this tutorial)

  • Limiting size of solution, incrementally increasing bound

[ScheweFinkbeiner07,FiliotJinRaskin11, Ehlers12] (Later!)

  • Considering efficiently decidable fragments (Now!)
slide-28
SLIDE 28

Swen Jacobs VTSA 2013 28

GR(1) Synthesis

slide-29
SLIDE 29

Swen Jacobs VTSA 2013 29

Avoiding Complexity: GR(1) Games

LTL Synthesis [PnueliRosner89] 1. Specify

  • Formula 𝜒 in Linear Temporal

Logic

2. Obtain a game

  • Convert 𝜒 to a

nondeterministic Büchi Automaton 𝐵 (exponential blowup)

  • Determinize 𝐵 to a

deterministic Rabin or Parity automaton (=game) (exponential blowup)

3. Solve the game

  • equals solving a parity game,

can be done in polynomial time

4. Construct Circuit GR(1) Synthesis [PitermanPnueliSa’ar06] 1. Specify

  • Sets of deterministic Büchi

automata, for environment and system

2. Specification = game

  • no work

3. Solve the game

  • A GR(1) game

4. Construct Circuit

slide-30
SLIDE 30

Swen Jacobs VTSA 2013 30

Avoiding Complexity: GR(1) Specs

1. Specification:

  • Set of 𝑛 deterministic Büchi automata for assumptions: 𝐵1 … 𝐵𝑛
  • Set of 𝑜 deterministic Büchi automata for guarantees: 𝐻1 … 𝐻𝑜

Both encoded symbolically

2. Specification = Game 3. Solve the game 4. Determine circuit from winning strategy (…) Advantages of this setting:

  • We do not need one automaton for full spec
  • We do not need to determinize
  • Symbolic formulation

But: not all LTL properties can be expressed this way(!)

slide-31
SLIDE 31

Swen Jacobs VTSA 2013 31 Obtaining a GR(1) Specification

Symbolic: Introduce 𝑦 as variable for state space initial 𝑗𝐵 = ¬𝑦 transition relation 𝑈𝐵 = ¬𝑦 ∧ (¬𝑠 ∨ 𝑕)  𝑦’ ¬𝑦 ∧ 𝑠 ∧ ¬𝑕  𝑦’ 𝑦 ∧ ¬𝑕  𝑦’ 𝑦 ∧ 𝑕  𝑦’ fairness 𝐺𝐵: 𝐇𝐆 𝑡𝑢𝑏𝑢𝑓’

1

𝑠 ∧ ¬𝑕 𝑕

¬𝑠 ∨ 𝑕

¬𝑕

Example: G(r  F g)

slide-32
SLIDE 32

Swen Jacobs VTSA 2013 32

  • Gen. Reactivity(1):

𝑗 𝐇𝐆 𝐵𝑗 → 𝑘 𝐇𝐆 𝐻

𝑘

To solve: compute nested fixpoints of states from which system can force visit to 𝐻j if environment satisfies assumptions 𝐵𝑗 Direct symbolic implementation. Complexity: 𝑃 𝑅 2 ⋅ 𝑈 ⋅ 𝑛 ⋅ 𝑜

[KestenPitermanPnueli05,PitermanPnueliSa’ar06]

Computing a GR1 Game

G0

  • 𝐵𝑛
  • 𝐵1
  • 𝐵2
  • 𝐵1
  • 𝐵2

… G1

  • 𝐵𝑛

  • 𝐻0
  • 𝐻1
slide-33
SLIDE 33

Swen Jacobs VTSA 2013 33

GR(1) A1  …  Am  G1  …  Gn 1-pair Streett 

Solve using Jurdzinki’s algorithm in 𝑃 𝑅 ⋅ 𝑈 time

[d’AlfaroFaella09]

better because 𝑛, 𝑜 << 𝑅

Alternative: Reduce GR(1) to Streett

reduction

counting construction blowup: O(m) counting construction blowup:O(n) [PPS06] Streett reduction algorithm

time

𝑃 𝑅 2 ⋅ 𝑈 ⋅𝑛 ⋅𝑜 𝑃 𝑅 ⋅ 𝑈 ⋅ 𝑛 ⋅ 𝑜 2

A G

Note: counting construction on G introduces memory of size n

slide-34
SLIDE 34

Swen Jacobs VTSA 2013 34

Avoiding Complexity: GR(1) Games

LTL Synthesis [PnueliRosner89] 1. Specify

  • Formula 𝜒 in Linear Temporal

Logic

2. Obtain a game

  • Convert 𝜒 to a

nondeterministic Büchi Automaton 𝐵 (exponential blowup)

  • Determinize 𝐵 to a

deterministic Rabin or Parity automaton (=game) (exponential blowup)

3. Solve the game

  • equals solving a parity game,

can be done in polynomial time

4. Construct Circuit GR(1) Synthesis [PitermanPnueliSa’ar06] 1. Specify

  • Sets of deterministic Büchi

automata, for environment and system

2. Specification = game

  • no work

3. Solve the game

  • A GR(1) game

4. Construct Circuit

slide-35
SLIDE 35

Swen Jacobs VTSA 2013 35

Selecting One Implementation

Specification = Set of sequential circuits Strategy = Set of combinational circuits One combinational circuit

GR(1) Synthesis (fix memory elements) Construction of circuit Less freedom Fewer circuits More complexity

slide-36
SLIDE 36

Swen Jacobs VTSA 2013 36 Constructing Circuit

|inputs|

FFs |outputs| FFs

Comb. Logic

sequential inputs sequential

  • utputs

|vars| FFs

combinational inputs I combinational outputs O

  • Spec is given in terms of sequential inputs and outputs
  • Flipflops keep track of state of specification automata (state space of game)
  • Strategy is relation between combinational inputs and combinational outputs:

R  I X O

  • A circuit is a function f: I  O
slide-37
SLIDE 37

Swen Jacobs VTSA 2013 37

From BDD to Circuit

Relation Solving Given: Strategy R: I x O Find: function f: I  O such that if f(i) = o then (i,o)  R or o. (i,o)  R Multiple possibilities lead to wildly different sizes in circuits

1

slide-38
SLIDE 38

Strategy Minimization/Determinization

Swen Jacobs VTSA 2013 38

Challenges:

  • Find simple function (small number of gates)
  • Strategy relations are huge
  • Encoded symbolically (e.g. BDD)
  • Symbolic algorithms
  • Efficiency

Different approaches based on BDD manipulation and/or learning.

slide-39
SLIDE 39

Swen Jacobs VTSA 2013 39

(Synthesizing) The AMBA Bus Protocol

slide-40
SLIDE 40

Swen Jacobs VTSA 2013 40 AMBA Bus

  • Industrial standard
  • ARM’s AMBA AHB bus
  • High performance on-chip bus
  • Data, address, and control signals (pipelined)
  • Arbiter part of bus (determines control signals)
  • Up to 16 masters and 16 clients

AMBA AHB Master 0 Master 1 Master 15 Client 0 Client 1 Client 15

... ...

Arbiter

slide-41
SLIDE 41

Swen Jacobs VTSA 2013 41

AMBA Bus

  • Master initiates transfer. Signals:
  • HBUSREQi
  • Master i wants the bus
  • HLOCKi
  • Master i wants an uninterruptible access
  • HBURST
  • This access has length 1/4/incr
  • address & data lines
  • The arbiter decides access
  • HGRANTi
  • Next transfer for master i
  • HMASTER[..]
  • Currently active master
  • HMASTLOCK
  • Current access is uninterruptible
  • The clients synchronize the transfer
  • HREADY
  • Ready for next transfer
  • Sequence for master
  • Ask; wait for grant; wait for hready; state transfer type & start transfer
slide-42
SLIDE 42

Swen Jacobs VTSA 2013 42

AMBA Arbiter

  • Specification
  • 3 Assumptions, 12 Guarantees.
  • Example:

“When a locked unspecified length burst starts, new access does not start until current master (i) releases bus by lowering HBUSREQi.”

i G( HMASTLOCK  HBURST=INCR  HMASTER=i  START →

X(¬START U ¬HBUSREQi) )

slide-43
SLIDE 43

Swen Jacobs VTSA 2013 43

Formulation of Spec Matters

Assumption that master must eventually release locked bus

i: G((HMASTLOCK  HBURST=INCR  HMASTER=i)  F HBUSREQ[i])

can also be written as

G((HMASTLOCK  HBURST=INCR)  F HBUSREQ[HMASTER])

(We know that bus master does not change) Now, instead of n automata with n fairness constraints, we have one!

slide-44
SLIDE 44

Swen Jacobs VTSA 2013 44

New Spec

200 400 600 800 1000 1200 1400 1 2 3 4 5 6 7 8 9 10 KS cofactors new spec manual

#masters Circuit size

slide-45
SLIDE 45

Swen Jacobs VTSA 2013 45

AMBA Case Study: Results

  • Expressibility of GR(1) is sufficient
  • Deciding realizability is fast
  • Specification is short and easy to understand
  • Synthesis works!
slide-46
SLIDE 46

Swen Jacobs VTSA 2013 46

Challenges: Specification

  • Informal specs often ambiguous (AMBA spec is)
  • you also have this problem when writing Verilog code
  • Is specifying really easier than coding?
  • GR(1) is a very special case, interesting things may

not be (easily) expressible

slide-47
SLIDE 47

Swen Jacobs VTSA 2013 47

Challenges: Size

  • Circuits are LARGE, size depends on parameter

(# masters)

  • Much bigger increase than necessary

(see manual implementation)

  • Smarter circuit generation needed
  • Size depends strongly on formulation of

specification

slide-48
SLIDE 48

Swen Jacobs VTSA 2013 48

Bounded (Safraless) Approaches

slide-49
SLIDE 49

Reactive Systems, More Formally

Swen Jacobs VTSA 2013 49

3 views on synthesis:

  • synthesize a strategy for a game – depends on

game graph

  • synthesize a circuit – special form, good for bit-level

symbolic reasoning

  • synthesize a labelled transition system – this is

close to the “automata” point of view

slide-50
SLIDE 50

Labelled Transition Systems

Swen Jacobs VTSA 2013 50

A labelled transition system (LTS) 𝑇 with inputs 𝐽 and

  • utputs 𝑃 is a tuple (𝑈, 𝑢0, 𝜐, 𝑝) with
  • 𝑈 a set of states
  • 𝑢0 an initial state
  • 𝜐: 𝑈 × 𝔺𝐽 → 𝑈 a transition function
  • 𝑝: 𝑈 → 𝔺𝑃 a (state) labelling function
slide-51
SLIDE 51

Bounded (Safraless) Approaches

Swen Jacobs VTSA 2013 51

Avoid determinisation step by alternative approach:

  • 1. reduce synthesis problem to emptiness check of

universal coBüchi tree automaton

slide-52
SLIDE 52

Universal Co-Büchi Tree Automaton (UCT)

Swen Jacobs VTSA 2013 52

Universal: takes all possible transitions at once, i.e., can be in multiple states at the same time Co-Büchi: no state in 𝐺 may be visited inf. often Tree Automaton: reads trees instead of words Space of executions of an LTS is a tree: branches labeled with inputs, nodes with outputs.

slide-53
SLIDE 53

Bounded (Safraless) Approaches

Swen Jacobs VTSA 2013 53

Avoid determinisation step by alternative approach:

  • 1. reduce synthesis problem to emptiness check of

universal coBüchi tree automaton

  • 2. reduce emptiness check to checking acceptance of

trees/systems of bounded size. For bounded size, problem can be encoded as decidable SMT constraints [ScheweFinkbeiner07] (alternative: [FiliotJinRaskin11])

slide-54
SLIDE 54

Bounded Synthesis [ScheweFinkbeiner07]

Swen Jacobs VTSA 2013 54

  • 1. Translate LTL specification into UCT
  • 2. Generate SMT constraints equivalent to

realizability of spec (in system of size 𝑙)

  • 3. Solve constraints for increasing 𝑙,
  • btain system (if one exists)
slide-55
SLIDE 55

Bounded Synthesis: Construct UCT

Swen Jacobs VTSA 2013 55

Specification Automaton

∧1≤𝑗≤2 𝐇(𝑠

𝑗 → 𝐆𝑕𝑗)

𝐇¬ 𝑕1 ∧ 𝑕2

slide-56
SLIDE 56

Bounded Synthesis: Acceptance of UCT

Swen Jacobs VTSA 2013 56

System Automaton 𝑕1𝑕2 𝑕1𝑕2 𝑕1𝑕2 𝑠

1

𝑠2 𝑠

1𝑠2

𝑠

1𝑠 2

𝑠

1

𝑠2 𝑠

1𝑠2

𝑠

1𝑠 2 ∨

𝑠

1𝑠 2

(implicit self-loops in remaining cases)

slide-57
SLIDE 57

Bounded Synthesis: SMT Constraints

Swen Jacobs VTSA 2013 57

Idea: Annotate states of system with

  • predicates 𝜇𝑟

𝔺: 𝑈 → 𝔺, representing reachable states

  • f the automaton, i.e.,

𝜇𝑟

𝔺 𝑢 is true if partial run of system that ends in 𝑢 can

lead to automaton state that includes 𝑟

  • counting functions 𝜇𝑟

#: 𝑈 → ℕ, representing

maximum number of visits to rejecting states in any partial run of the system that ends in 𝑢

slide-58
SLIDE 58

Bounded Synthesis: Annotations

Swen Jacobs VTSA 2013 58

Annotation Automaton 𝜇1

𝔺 𝑢0

𝜇1

# 𝑢0 = 0

∀𝐽 ∀𝑢: 𝜇1

𝔺 𝑢

→ 𝜇1

𝔺 𝜐 𝑢, 𝐽

∧ 𝜇1

# 𝜐 𝑢, 𝐽

≥ 𝜇1

# 𝑢

∀𝐽 ∀𝑢: 𝜇1

𝔺 𝑢 ∧ 𝑠 1 ∈ 𝐽

→ 𝜇2

𝔺 𝜐 𝑢, 𝐽

∧ 𝜇2

# 𝜐 𝑢, 𝐽

> 𝜇1

# 𝑢

… …

For given system 𝑇 and UCT 𝐵, satisfying annotation exists iff 𝐵 accepts 𝑇.

slide-59
SLIDE 59

Bounded Synthesis: Solving

Swen Jacobs VTSA 2013 59

  • For given system, such SMT constraints are

decidable and solved automatically

  • If we let transition function and output function of

system be unknown/uninterpreted, we can use SMT solver for synthesis

  • In this case, need to restrict size of system

(s.t. quantifiers can be finitely instantiated)

  • Very mature SMT solvers can be used out-of-the-box
slide-60
SLIDE 60

Bounded Synthesis: Wrap-up

Swen Jacobs VTSA 2013 60

Bounded synthesis

  • solves the synthesis problem by smart encoding

into SMT constraints

  • finds the smallest implementation

(wrt. # states in LTS, or other metrics)

  • does not scale very well

(without additional optimizations)

slide-61
SLIDE 61

End of Synthesis, Part I: Basics

Swen Jacobs VTSA 2013 61

  • Synthesis as a Game
  • General: LTL Synthesis
  • Time-Efficient: GR(1) Synthesis
  • Application: AMBA Bus Protocol
  • Space-Efficient: Bounded/Safraless Approaches
slide-62
SLIDE 62

Bibliography

Swen Jacobs VTSA 2013 62

[PnueliRosner89] A. Pnueli, R. Rosner: On the Synthesis of a Reactive Module. POPL 89. [SohailSomenzi09] S. Sohail, F. Somenzi: Safety First: A Two-Stage Algorithm for LTL

  • Games. FMCAD 09.

[MorgensternSchneider10] A. Morgenstern, K. Schneider: Exploiting the Temporal Logic Hierarchy and the Non-Confluence Property for Efficient LTL Synthesis. GANDALF 10. [ScheweFinkbeiner07] S. Schewe, B. Finkbeiner: Bounded Synthesis. ATVA 07. [FiliotJinRaskin11] E. Filiot, N. Jin, J.F. Raskin: Antichains and compositional algorithms for LTL synthesis. FMSD 11. [Ehlers12] R. Ehlers: Symbolic Bounded Synthesis. FMSD 12. [VardiWolper86] M. Vardi, P. Wolper: Automata-theoretic techniques for modal logics of

  • programs. JCSS 86.

[KestenPitermanPnueli05] Y. Kesten, N. Piterman, A. Pnueli: Bridging the Gap between Fair Simulation and Trace Inclusion. I&C 05. [PitermanPnueliSa’ar06] N. Piterman, A. Pnueli, Y. Sa'ar: Synthesis of Reactive(1)

  • Designs. VMCAI 06.