Antichains: A New Algorithm for Checking Universality of Finite - - PowerPoint PPT Presentation

antichains a new algorithm for checking universality of
SMART_READER_LITE
LIVE PREVIEW

Antichains: A New Algorithm for Checking Universality of Finite - - PowerPoint PPT Presentation

Antichains: A New Algorithm for Checking Universality of Finite Automata Laurent Doyen Universit e Libre de Bruxelles Joint work with Martin De Wulf, Tom Henzinger, Jean-Fran cois Raskin CAV, Seattle, 17th August, 2006 Outline of the


slide-1
SLIDE 1

Antichains: A New Algorithm for Checking Universality of Finite Automata Laurent Doyen Universit´ e Libre de Bruxelles Joint work with Martin De Wulf, Tom Henzinger, Jean-Fran¸ cois Raskin CAV, Seattle, 17th August, 2006

slide-2
SLIDE 2

Outline of the talk

  • Motivation
  • Universality - A Game Approach
  • Example
  • Experimental Results
  • Conclusion
slide-3
SLIDE 3

Finite State Automaton Finite automaton: A = Loc, ℓI, Σ, δ, F with δ : Loc × Σ → 2Loc (non-deterministic)

ℓ0 ℓ1 ℓ2 ℓ3 ℓ4

1 0, 1 1 1 0, 1

For w ∈ Σ∗, we have

  

w ∈ L(A) iff some path on w accepts. w ∈ L(A) iff all paths on w reject.

slide-4
SLIDE 4

Language Inclusion and Universality An implementation A of a program is correct with regard to its specification B if: L(A) ⊆ L(B) deterministic non-deterministic

slide-5
SLIDE 5

Language Inclusion and Universality L(A) ⊆ L(B) iff L(A ∩ Bc) is empty

  • Computing Bc: hard (via determinization)
  • Checking emptiness: easy

iff L(Ac ∪ B) is universal

  • Computing Ac: easy
  • Checking universality: hard
slide-6
SLIDE 6

Language Inclusion and Universality L(A) ⊆ L(B) iff L(A ∩ Bc) is empty

  • Computing Bc: hard (via determinization)
  • Checking emptiness: easy

iff L(Ac ∪ B) is universal

  • Computing Ac: easy
  • Checking universality: hard

not so hard in practice with antichains.

slide-7
SLIDE 7

Universality - Experimental results

dk.brics.automaton Antichains

Number of states Execution time (s)

4000 3500 3000 2500 2000 1500 1000 500 12 10 8 6 4 2

slide-8
SLIDE 8

Universality - Experimental results

Execution Time (s) Number of states

3000 3500 4000 2500 2000 12 10

1000 500 50 100 150 1500

dk.brics.automaton Antichains

slide-9
SLIDE 9

Universality - Exexution times (in milliseconds) Number of states 20 40 60 80 100 175 500 Determinization 23 50 141 309 583 2257

  • Antichains

1 2 2 3 5 14 76 Number of states 1000 1500 2000 2500 3000 3500 4000 Determinization

  • Antichains

400 973 1741 2886 5341 9063 13160

slide-10
SLIDE 10

Outline of the talk

  • Motivation
  • Universality - A Game Approach
  • Example
  • Experimental Results
  • Conclusion
slide-11
SLIDE 11

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The protagonist has to provide a finite word w such that no matter how the antagonist reads it using A, the automaton ends up in a rejecting location. = ⇒ This is a one-shot game.

slide-12
SLIDE 12

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The protagonist has to provide a finite word w such that no matter how the antagonist reads it using A, the automaton ends up in a rejecting location.

ℓ0 ℓ1 ℓ2 ℓ3 ℓ4

1 0, 1 1 1 0, 1

Example: Protagonist: w = 101 Antagonist: π = ℓ0

1

− → ℓ0 − → ℓ2

1

− → ℓ2 Antagonist wins the play since ℓ2 is accepting.

slide-13
SLIDE 13

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The protagonist has to provide a finite word w such that no matter how the antagonist reads it using A, the automaton ends up in a rejecting location. = ⇒ This is a one-shot game. Protagonist has a strategy to win this game iff A is not universal

slide-14
SLIDE 14

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The game is turn-based:

  • Protagonist provides a word w one letter at a time;
  • Antagonist updates the state of A accordingly.
slide-15
SLIDE 15

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The game is turn-based:

  • Protagonist provides a word w one letter at a time;
  • Antagonist updates the state of A accordingly.

ℓ0 ℓ1 ℓ2 ℓ3 ℓ4

1 0, 1 1 1 0, 1

Example: Protagonist: w = 1 Antagonist: π = ℓ0

1

− → ℓ0

slide-16
SLIDE 16

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The game is turn-based:

  • Protagonist provides a word w one letter at a time;
  • Antagonist updates the state of A accordingly.

ℓ0 ℓ1 ℓ2 ℓ3 ℓ4

1 0, 1 1 1 0, 1

Example: Protagonist: w = 10 Antagonist: π = ℓ0

1

− → ℓ0 − → ℓ2

slide-17
SLIDE 17

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The game is turn-based:

  • Protagonist provides a word w one letter at a time;
  • Antagonist updates the state of A accordingly.

ℓ0 ℓ1 ℓ2 ℓ3 ℓ4

1 0, 1 1 1 0, 1

Example: Protagonist: w = 10 Antagonist: π = ?

1

− → ? − → ?

{ℓ0} {ℓ0} {ℓ1, ℓ2}

slide-18
SLIDE 18

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The game is turn-based:

  • Protagonist provides a word w one letter at a time;
  • Antagonist updates the state of A accordingly.

ℓ0 ℓ1 ℓ2 ℓ3 ℓ4

1 0, 1 1 1 0, 1

Example: Protagonist: w = 101 Antagonist: π = ?

1

− → ? − → ?

1

− → ℓ2 Antagonist wins the play since ℓ2 is accepting.

slide-19
SLIDE 19

Universality - A game approach Consider a game played by a protagonist and an antagonist The protagonist wants to establish that A is not universal. The game is turn-based:

  • Protagonist provides a word w one letter at a time;
  • Antagonist updates the state of A accordingly.

The protagonist cannot observe the state chosen by the antagonist. = ⇒ This is a blind game (or game of null information).

slide-20
SLIDE 20

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F.

slide-21
SLIDE 21

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games T

slide-22
SLIDE 22

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games − − − → ≡ − − − → − − − → ≡

1

− − − → T

slide-23
SLIDE 23

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games − − − → ≡ − − − → − − − → ≡

1

− − − → T

slide-24
SLIDE 24

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games − − − → ≡ − − − → − − − → ≡

1

− − − → T

slide-25
SLIDE 25

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games x0 = T

CPre(x0)

slide-26
SLIDE 26

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games T x1 = CPre(x0) ∪ x0

slide-27
SLIDE 27

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games T x1

CPre(x1)

slide-28
SLIDE 28

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games x2 = CPre(x1) ∪ x1

slide-29
SLIDE 29

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games xi−1 . . .

CPre(xi−1)

slide-30
SLIDE 30

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Checking universality of A is equivalent to solving a blind reachability game GT with target T = Loc\F. Recipe for solving classical reachability games Winning states W = µx.(CPre(x) ∪ T)

slide-31
SLIDE 31

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Universality of A is equivalent to a blind reachability game GT with target T = Loc\F . Recipe for solving classical reachability games

  • 1. Compute the set of states that are winning in one

move: CPre(T)

  • 2. Iterate CPre(·): compute W = µx.(CPre(x) ∪ T)
  • 3. Check whether ℓI ∈ W
slide-32
SLIDE 32

Universality - Controllable predecessor operator Let A = Loc, ℓI, Σ, δA, F.

  • CPre(·) should encode the blindness of the game:

“The knowledge of the protagonist is a set of states.”

  • CPre(T) contains all the set of states s such that:

there exists σ ∈ Σ such that: if protagonist plays σ from s, then the set T is reached no matter the antagonist’s move. ∃σ ∈ Σ · ∀ℓ ∈ s : δA(ℓ, σ) ⊆ T

  • postσ(s) ⊆ T
slide-33
SLIDE 33

Universality - Controllable predecessor operator Let A = Loc, ℓI, Σ, δA, F. Consider the following controllable predecessor operator

  • ver sets of sets of locations. For q ⊆ 2Loc, let:

CPre(q) =

  • s | ∃s′ ∈ q · ∃σ ∈ Σ : postσ(s) ⊆ s′

So s ∈ CPre(q) if there is a set s′ ∈ q that is reached from any location in s, reading input letter σ. = ⇒ CPre encodes the blindness of the game.

slide-34
SLIDE 34

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Theorem: {ℓI} ∈ µx.(CPre(x) ∪ {T}) iff Protagonist has a strategy to win GT iff A is not universal Claim: For s1 ⊆ s2, if postσ(s2) ⊆ s′

  • s2∈CPre(·)

then postσ(s1) ⊆ s′

  • s1∈CPre(·)

Hence, we compute ⊆-downward-closed sets of state sets. Idea: Keep in CPre(x) only the maximal elements.

slide-35
SLIDE 35

Universality - A game approach Let A = Loc, ℓI, Σ, δA, F. Definition: For q ⊆ 2Loc, let:

CPre(q) = MaximalSets({s | ∃s′ ∈ q · ∃σ ∈ Σ : postσ(s) ⊆ s′})

=

  • {s | ∃s′ ∈ q · ∃σ ∈ Σ : postσ(s) ⊆ s′}
  • where ⌈q⌉ = {s ∈ q | ∄s′ ∈ q : s ⊂ s′} is an antichain of sets of

locations (containing only pairwise ⊆-incomparable elements).

slide-36
SLIDE 36

Outline of the talk

  • Motivation
  • Universality - A Game Approach
  • Example
  • Experimental Results
  • Conclusion
slide-37
SLIDE 37

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
slide-38
SLIDE 38

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ T

=

  • {4}0,
slide-39
SLIDE 39

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {4}0,1, {4, 5}1, {5}1, ∅
  • {6, 7}
slide-40
SLIDE 40

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {6, 7}, {4, 5}
slide-41
SLIDE 41

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {6, 7}, {4, 5}
  • x2 =

CPre(x1) ∪ {T}

=

  • {4, 5}, {2}0,
slide-42
SLIDE 42

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {6, 7}, {4, 5}
  • x2 =

CPre(x1) ∪ {T}

=

  • {4, 5}, {2}0,1, {2, 3}1, {3}1, ∅
  • {6, 7}
slide-43
SLIDE 43

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {6, 7}, {4, 5}
  • x2 =

CPre(x1) ∪ {T}

=

  • {6, 7}, {4, 5}, {2, 3}
slide-44
SLIDE 44

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {6, 7}, {4, 5}
  • x2 =

CPre(x1) ∪ {T}

=

  • {6, 7}, {4, 5}, {2, 3}
  • x3 =

CPre(x2) ∪ {T}

=

  • {4, 5}, {2, 3}, {1}1, ∅
  • {6, 7}
slide-45
SLIDE 45

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {6, 7}, {4, 5}
  • x2 =

CPre(x1) ∪ {T}

=

  • {6, 7}, {4, 5}, {2, 3}
  • x3 =

CPre(x2) ∪ {T}

=

  • {6, 7}, {4, 5}, {2, 3}, {1}
slide-46
SLIDE 46

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {6, 7}, {4, 5}
  • x2 =

CPre(x1) ∪ {T}

=

  • {6, 7}, {4, 5}, {2, 3}
  • x3 =

CPre(x2) ∪ {T}

=

  • {6, 7}, {4, 5}, {2, 3}, {1}
  • x4 =

CPre(x3) ∪ {T}

= x3

slide-47
SLIDE 47

Universality - Example A

1 2 3 4 5 6 7 8

0, 1 0, 1 1 , 1 0, 1 1 , 1 0, 1 1 0, 1

Protagonist has a strategy to win GT (e.g.: w = 111) ⇐ ⇒ A is not universal x0 = T =

  • {6, 7}
  • x1 =

CPre(x0) ∪ {T}

=

  • {6, 7}, {4, 5}
  • x2 =

CPre(x1) ∪ {T}

=

  • {6, 7}, {4, 5}, {2, 3}
  • x3 =

CPre(x2) ∪ {T}

=

  • {6, 7}, {4, 5}, {2, 3}, {1}
  • x4 =

CPre(x3) ∪ {T}

= x3

slide-48
SLIDE 48

Universality - Example We have explored/constructed

{1} {2, 3} {4, 5} {6, 7}

1 1 1

instead of

{1} {3} {2} {2, 3} {5} {4} {4, 5} {6, 7}

1 1 1 1 0, 1 1 1 0, 1 1

slide-49
SLIDE 49

Universality - Determinization

{1} {2} {1, 3} {4, 5} {5} {2, 5} {1, 3, 5} {6, 7} {7, 8} {7} {4, 5, 7} {5, 7, 8} {2, 5, 7} {1, 3, 5, 7, 8}

1 1 1 1 1 1 1

slide-50
SLIDE 50

Outline of the talk

  • Motivation
  • Universality - A Game Approach
  • Example
  • Experimental Results
  • Conclusion
slide-51
SLIDE 51

Universality - Experimental results (1)

  • We compare our algorithm Antichains with the best(1)

known algorithm dk.brics.automaton by Anders Møller.

(1) According to ”D. Tabakov, M. Y. Vardi. Experimental Eval- uation of Classical Automata Constructions. LPAR 2005”.

  • We use a randomized model to generate the instances

(automata of 175 locations). Two parameters: – Transition density: r ≥ 0 – Density of accepting states: 0 ≤ f ≤ 1

slide-52
SLIDE 52

Universality - Experimental results (2)

Time dk.brics.automaton Time Antichains

Density of Final States (f) Transition Density (r) 200 160 120 80 40 0.8 0.6 0.4 0.2 4 3.5 3 2.5 2 1.5 1 0.5 200 160 120 80 40

Each sample point: 100 automata with |Loc| = 175, Σ = {0, 1}.

slide-53
SLIDE 53

Universality - Experimental results (3)

dk.brics.automaton Antichains

Number of states Execution time (s)

4000 3500 3000 2500 2000 1500 1000 500 12 10 8 6 4 2

  • Transition density: r = 2.
  • Density of accepting states: f = 1.
slide-54
SLIDE 54

Determinization - Average Number of sets (100 instances) # states 20 40 60 80 100 120 140 160 All instances 71 176 415 713 1120 1404 1750 2084

  • Univ. inst.

116 388 826 1563 2364 2805 3850 4758 ¬Univ. inst. 11 28 64 98 61 162 32 67 Antichains - Average Number of sets (same 100 instances) # states 20 40 60 80 100 120 140 160 All instances 3 4 6 7 9 9 9 12

  • Univ. inst.

3 6 7 9 12 13 14 19 ¬Univ. inst. 3 3 4 6 6 6 5 7

slide-55
SLIDE 55

Outline of the talk

  • Motivation
  • Universality - A Game Approach
  • Example
  • Experimental Results
  • Conclusion
slide-56
SLIDE 56

Beyond Universality

  • Universality (L(A) = Σ∗): antichains over 2LocA.

CPre(q) =

  • {s | ∃s′ ∈ q · ∃σ ∈ Σ : postσ(s) ⊆ s′}
  • Language inclusion (L(A) ⊆ L(B)): antichains over

LocA × 2LocB. CPre(q) =

  • {(ℓ, s) | ∃(ℓ′, s′) ∈ q · ∃σ ∈ Σ : ℓ′ ∈ δA(ℓ, σ)

∧ postB

σ (s) ⊆ s′}

  • Emptiness of AFA (L(A) = ∅): antichains over 2LocA.

CPre(q) =

  • {s | ∃s′ ∈ q · ∃σ ∈ Σ · ∀ℓ ∈ s : s′ |

= δ(ℓ, σ)}

slide-57
SLIDE 57

Conclusion and perspectives The antichains algorithms apply to:

  • Universality of FSA,
  • Language inclusion of FSA,
  • Emptiness of finite alternating automata.
  • . . . and soon to automata over infinite words (B¨

uchi)? (work in progress)

slide-58
SLIDE 58

Thank you Questions ???