Antimirov 1996 Idea: build some of ≡ into the data structure set : D : α → α rexp → α rexp set D x ( r + s ) = D x r ∪ D x s D x ( r · s ) = if ε ( r ) then D x r ⊙ s ∪ D x s else D x r ⊙ s . . . where { r 1 , . . . , r n } ⊙ s = { r 1 · s, . . . , r n · s }
Instantiation of framework
Instantiation of framework σ = α rexp set
Instantiation of framework σ = α rexp set init ( r ) = { r }
Instantiation of framework σ = α rexp set init ( r ) = { r } � δ x R = D x r r ∈ R
Instantiation of framework σ = α rexp set init ( r ) = { r } � δ x R = D x r r ∈ R fin ( R ) = ∃ r ∈ R. ε ( r )
Instantiation of framework σ = α rexp set init ( r ) = { r } � δ x R = D x r r ∈ R fin ( R ) = ∃ r ∈ R. ε ( r ) � L ( R ) = L ( r ) r ∈ R
Finiteness Theorem (Antimirov 1996) Starting from a regular expression r
Finiteness Theorem (Antimirov 1996) Starting from a regular expression r at most | r | at + 1 regular expressions are reachable
Finiteness Theorem (Antimirov 1996) Starting from a regular expression r at most | r | at + 1 regular expressions are reachable where | r | at is the number of occurrences of atoms in r .
Finiteness Theorem (Antimirov 1996) Starting from a regular expression r at most | r | at + 1 regular expressions are reachable where | r | at is the number of occurrences of atoms in r . ⇒ 2 | r | at +1 sets of regular expressions reachable =
1 The Unified Framework 2 Derivatives of Regular Expressions 3 Partial Derivatives of Regular Expressions 4 Marked regular expressions 5 Empirical Comparison
History McNaughton & Yamada 1960, Glushkov 1961:
History McNaughton & Yamada 1960, Glushkov 1961: • Translation of regular expression to N/DFA
History McNaughton & Yamada 1960, Glushkov 1961: • Translation of regular expression to N/DFA • Atoms in regular expression are indexed, eg a 1 · a 2 + a 3 · b 1
History McNaughton & Yamada 1960, Glushkov 1961: • Translation of regular expression to N/DFA • Atoms in regular expression are indexed, eg a 1 · a 2 + a 3 · b 1 • States are (sets of) indexed atoms, eg { a 1 , a 3 }
History McNaughton & Yamada 1960, Glushkov 1961: • Translation of regular expression to N/DFA • Atoms in regular expression are indexed, eg a 1 · a 2 + a 3 · b 1 • States are (sets of) indexed atoms, eg { a 1 , a 3 } Functional implementation by Fischer, Huch & Wilke [ICFP 2009]: • Replace sets of positions by marked regular expressions: Atom ( bool, α )
History McNaughton & Yamada 1960, Glushkov 1961: • Translation of regular expression to N/DFA • Atoms in regular expression are indexed, eg a 1 · a 2 + a 3 · b 1 • States are (sets of) indexed atoms, eg { a 1 , a 3 } Functional implementation by Fischer, Huch & Wilke [ICFP 2009]: • Replace sets of positions by marked regular expressions: Atom ( bool, α ) • Only matching, not ≡ , no proofs
Example: ( a · a + a · b ) ∗
Example: ( a · a + a · b ) ∗ q 0
Example: ( a · a + a · b ) ∗ a q 0 ( a · a + a · b ) ∗
Example: ( a · a + a · b ) ∗ ( a · a + a · b ) ∗ a a q 0 ( a · a + a · b ) ∗
Example: ( a · a + a · b ) ∗ ( a · a + a · b ) ∗ a a a q 0 ( a · a + a · b ) ∗
Example: ( a · a + a · b ) ∗ ( a · a + a · b ) ∗ a a a q 0 ( a · a + a · b ) ∗ b ( a · a + a · b ) ∗
Example: ( a · a + a · b ) ∗ ( a · a + a · b ) ∗ a a a q 0 ( a · a + a · b ) ∗ a b ( a · a + a · b ) ∗
Instantiation of framework
Instantiation of framework σ = bool × ( bool × α ) rexp
Instantiation of framework σ = bool × ( bool × α ) rexp init ( r ) = ( True, map ( λa. ( False, a )) r )
Instantiation of framework σ = bool × ( bool × α ) rexp init ( r ) = ( True, map ( λa. ( False, a )) r ) δ x ( m, r ) = ( False, read x ( follow m r ))
Instantiation of framework σ = bool × ( bool × α ) rexp init ( r ) = ( True, map ( λa. ( False, a )) r ) δ x ( m, r ) = ( False, read x ( follow m r )) fin ( m, r ) = . . . L ( m, r ) = . . .
Recommend
More recommend