A probabilistic Kleene Theorem Benjamin Monmege LSV, ENS Cachan, CNRS, France MOVEP 2012, Marseille Part of works published at ATVA’12 with Benedikt Bollig, Paul Gastin and Marc Zeitoun
Kleene’s Theorem a b b Finite State Automata 2 1 3 a a a same expressivity Regular Expressions E ::= a | E+E | E · E | E *
Motivations • Theoretically: relate denotational and computational models • Practically: easier to write specifications using regular expressions vs. easier to check properties (emptiness, inclusion...) with automata • Goal: translate expressions to automata, as efficiently as possible
Kleene’s Theorem a a b b b b Finite State Automata 2 2 1 1 3 3 a a a a a a same expressivity Regular Expressions E ::= a | E+E | E · E | E *
Kleene’s Theorem a, 1 a, 1 2 2 b, 1 b, 1 b, 1 b, 1 d e 1 1 2 2 t 1 1 h g Finite State Automata 2 2 i e 2 2 1 1 3 3 W a, 1 a, 1 a, 1 a, 1 6 6 3 3 a, 1 a, 1 2 2 same expressivity Regular Expressions E ::= a | E+E | E · E | E *
Kleene’s Theorem a, 1 a, 1 b, 1 b, 1 b, 1 b, 1 d e 1 1 t h g Finite State Automata i 2 2 1 1 3 3 e W a, 1 a, 1 a, 1 a, 1 6 6 3 3 a, 1 a, 1 2 2 same expressivity Regular Expressions E ::= a | E+E | E · E | E *
Kleene’s Theorem a, 1 a, 1 b, 1 b, 1 b, 1 b, 1 d e 1 1 t h g Finite State Automata i 2 2 1 1 3 3 e W a, 1 a, 1 a, 1 a, 1 6 6 3 3 a, 1 a, 1 2 2 Σ * → ℝ same expressivity Regular Expressions E ::= a | E+E | E · E | E *
Kleene’s Theorem a, 1 a, 1 b, 1 b, 1 b, 1 b, 1 d e 1 1 t h g Finite State Automata i 2 2 1 1 3 3 e W a, 1 a, 1 a, 1 a, 1 6 6 3 3 a, 1 a, 1 2 2 Σ * → ℝ a a b same expressivity two runs: 1 → 2 → 1 → 3 of weight 1/6x1x1x1=1/6 and 1 → 1 → 1 → 3 of weight 1/2x1/2x1x1=1/4 Regular Expressions E ::= a | E+E | E · E | E *
Kleene’s Theorem a, 1 a, 1 b, 1 b, 1 b, 1 b, 1 d e 1 1 t h g Finite State Automata i 2 2 1 1 3 3 e W a, 1 a, 1 a, 1 a, 1 6 6 3 3 a, 1 a, 1 2 2 Σ * → ℝ a a b same expressivity two runs: 1 → 2 → 1 → 3 of weight 1/6x1x1x1=1/6 and 1 → 1 → 1 → 3 of weight 1/2x1/2x1x1=1/4 hence, a a b recognized with weight 1/6+1/4=5/12 Regular Expressions E ::= a | E+E | E · E | E *
Kleene’s Theorem a, 1 a, 1 b, 1 b, 1 b, 1 b, 1 d e 1 1 t h g Finite State Automata i 2 2 1 1 3 3 e W a, 1 a, 1 a, 1 a, 1 6 6 3 3 a, 1 a, 1 2 2 Σ * → ℝ a a b same expressivity two runs: 1 → 2 → 1 → 3 of weight 1/6x1x1x1=1/6 and 1 → 1 → 1 → 3 of weight 1/2x1/2x1x1=1/4 hence, a a b recognized with weight 1/6+1/4=5/12 d e t h g Regular Expressions i e W r e p o E ::= a | E+E | E · E | E * p | r p E
r e g r e b n Kleene’s Theorem e z t ü h c S a, 1 a, 1 b, 1 b, 1 b, 1 b, 1 d e 1 1 t h g Finite State Automata i 2 2 1 1 3 3 e W a, 1 a, 1 a, 1 a, 1 6 6 3 3 a, 1 a, 1 2 2 Σ * → ℝ a a b same expressivity two runs: 1 → 2 → 1 → 3 of weight 1/6x1x1x1=1/6 and 1 → 1 → 1 → 3 of weight 1/2x1/2x1x1=1/4 hence, a a b recognized with weight 1/6+1/4=5/12 d e t h g Regular Expressions i e W r e p o E ::= a | E+E | E · E | E * p | r p E [1] S. Kleene (1956). Representation of events in nerve nets and finite automata. [2] M.-P . Schützenberger (1961). On the Definition of a Family of Automata. Information and Control. For an overview about Weighted Automata, see, e.g., Handbook of Weighted Automata. Editors: Manfred Droste, Werner Kuich, and Heiko Vogler. EATCS Monographs in Theoretical Computer Science. Springer, 2009.
Probabilistic case? a, 1 b, 1 b, 1 1 2 1 3 a, 1 a, 1 6 3 a, 1 2 A = ( Q, ι , Acc , P ) P : Q × Σ × Q → [0 , 1] X P ( q , a , q 0 ) ≤ 1 for all ( q , a ) ∈ Q × A Acc ( q ) + q 0 2 Q
Probabilistic case? a, 1 c i t s i l i b b, 1 b, 1 a b o r P 1 a e t v a i m t c o a 2 1 3 e t u R A e t i n i a, 1 a, 1 F 6 3 a, 1 2 A = ( Q, ι , Acc , P ) P : Q × Σ × Q → [0 , 1] X P ( q , a , q 0 ) ≤ 1 for all ( q , a ) ∈ Q × A Acc ( q ) + q 0 2 Q
Probabilistic case? a, 1 c i t s i l i b b, 1 b, 1 a b o r P 1 a e t v a i m t c o a 2 1 3 e t u R A e t i n i a, 1 a, 1 F 6 3 a, 1 2 A = ( Q, ι , Acc , P ) Applying Schützenberger’s Theorem P : Q × Σ × Q → [0 , 1] over these special Weighted Automata, X P ( q , a , q 0 ) ≤ 1 for all ( q , a ) ∈ Q × A Acc ( q ) + we obtain regular expressions (proper) q 0 2 Q ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b )
What kind of expressions? a, 1 b, 1 b, 1 1 2 1 3 a, 1 a, 1 6 3 a, 1 2
What kind of expressions? ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) a, 1 b, 1 b, 1 1 2 1 3 a, 1 a, 1 6 3 a, 1 2
What kind of expressions? ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) a, 1 b, 1 b, 1 1 2 1 3 a, 1 a, 1 6 3 a, 1 2
What kind of expressions? ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( a + b ) a, 1 b, 1 b, 1 1 2 1 3 a, 1 a, 1 6 3 a, 1 2
What kind of expressions? ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( a + b ) a, 1 b, 1 b, 1 1 2 1 3 a, 1 a, 1 6 3 a, 1 2
What kind of expressions? ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( a + b ) ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + 1 2 b ) a, 1 b, 1 b, 1 1 2 1 3 a, 1 a, 1 6 3 a, 1 2
What kind of expressions? ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( a + b ) ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + 1 2 b ) a, 1 b, 1 b, 1 1 2 1 3 a, 1 a, 1 6 3 a, 1 2
What kind of expressions? ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( a + b ) ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + 1 2 b ) Searching for a natural fragment a, 1 of weighted regular expressions b, 1 b, 1 1 representing probabilistic behaviors 2 1 3 a, 1 a, 1 6 3 a, 1 2
Constructing Probabilistic Expressions How to iterate? a, 1 b, 1 1 2 5 a, 1 6 a, 1 1 2 1 3 a, 1 3 b, 1 1 4
Constructing Probabilistic Expressions How to iterate? a, 1 b, 1 1 2 5 a, 1 6 a, 1 1 2 1 3 a, 1 3 b, 1 1 4 6 a ( a + b ) + 1 1 2 a + ( 1 3 a + b )
Constructing Probabilistic Expressions How to iterate? a, 1 b, 1 1 2 5 a, 1 6 a, 1 1 2 1 3 a, 1 3 b, 1 1 4 6 a ( a + b ) + 1 1 2 a + ( 1 3 a + b )
Constructing Probabilistic Expressions How to iterate? a, 1 b, 1 1 � 1 � ∗ 6 a ( a + b ) + 1 2 a + ( 1 3 a + b ) 2 5 a, 1 a, 1 6 1 b, 1 a, 1 a, 1 1 3 2 1 2 b, 1 1 3 a, 1 6 a, 1 a, 1 3 2 b, 1 1 4 6 a ( a + b ) + 1 1 2 a + ( 1 3 a + b )
Constructing Probabilistic Expressions How to iterate? a, 1 b, 1 1 � 1 � ∗ 6 a ( a + b ) + 1 2 a + ( 1 3 a + b ) 2 5 a, 1 a, 1 6 1 b, 1 a, 1 a, 1 1 3 2 1 2 b, 1 1 3 a, 1 6 a, 1 a, 1 3 2 b, 1 1 Not a valid Probabilistic 4 Automaton anymore (acceptance condition 6 a ( a + b ) + 1 1 2 a + ( 1 3 a + b ) not fulfilled)
Constructing Probabilistic Expressions How to iterate? a, 1 b, 1 1 2 5 a, 1 6 a, 1 1 2 1 3 a, 1 3 b, 1 1 4 6 a ( a + b ) + 1 1 2 a + ( 1 3 a + b )
Constructing Probabilistic Expressions How to iterate? a, 1 b, 1 1 2 5 a, 1 6 a, 1 1 2 1 3 a, 1 3 b, 1 1 4 6 a ( a + b ) + 1 1 2 a + ( 1 3 a + b )
Constructing Probabilistic Expressions How to iterate? a, 1 ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) b, 1 1 2 5 a, 1 a, 1 6 b, 1 b, 1 1 a, 1 1 2 1 3 2 1 3 a, 1 a, 1 6 3 a, 1 2 a, 1 3 b, 1 1 4 6 a ( a + b ) + 1 1 2 a + ( 1 3 a + b )
Constructing Probabilistic Expressions How to iterate? a, 1 ( 1 6 a ( a + b ) + 1 2 a ) ∗ ( 1 3 a + b ) b, 1 1 2 5 a, 1 a, 1 6 b, 1 b, 1 1 a, 1 1 2 1 3 2 1 3 a, 1 a, 1 6 3 a, 1 2 a, 1 3 Keep some branch for b, 1 1 4 termination of the Probabilistic Automaton 6 a ( a + b ) + 1 1 2 a + ( 1 3 a + b )
Probabilistic Expressions
Probabilistic Expressions • a ∈ A and p ∈ [0, 1 ] are PREs
Probabilistic Expressions E • a a ∈ A and p ∈ [0, 1 ] are PREs • if (E a ) a ∈ A are PREs, then ∑ a ∈ A a · E a is a PRE F b
Probabilistic Expressions E • a a ∈ A and p ∈ [0, 1 ] are PREs • if (E a ) a ∈ A are PREs, then ∑ a ∈ A a · E a is a PRE F b • E if E and F are PREs, then p · E + ( 1 - p ) · F is a PRE p F 1 − p
Probabilistic Expressions E • a a ∈ A and p ∈ [0, 1 ] are PREs • if (E a ) a ∈ A are PREs, then ∑ a ∈ A a · E a is a PRE F b • E if E and F are PREs, then p · E + ( 1 - p ) · F is a PRE p • if E and F are PREs, then E · F is a PRE F 1 − p
Probabilistic Expressions E • a a ∈ A and p ∈ [0, 1 ] are PREs • if (E a ) a ∈ A are PREs, then ∑ a ∈ A a · E a is a PRE F b • E if E and F are PREs, then p · E + ( 1 - p ) · F is a PRE p • if E and F are PREs, then E · F is a PRE E • F if E+F is a PRE, then E * · F is a PRE 1 − p F
Probabilistic Expressions E • a a ∈ A and p ∈ [0, 1 ] are PREs • if (E a ) a ∈ A are PREs, then ∑ a ∈ A a · E a is a PRE F b • E if E and F are PREs, then p · E + ( 1 - p ) · F is a PRE p • if E and F are PREs, then E · F is a PRE E • F if E+F is a PRE, then E * · F is a PRE 1 − p F ( a · E) * · b · F ( p · E) * · ( 1 - p ) · F
Recommend
More recommend