verified decision procedures for equivalence of regular
play

Verified Decision Procedures for Equivalence of Regular Expressions - PowerPoint PPT Presentation

Verified Decision Procedures for Equivalence of Regular Expressions Tobias Nipkow & Dmitriy Traytel Fakult at f ur Informatik Technische Universit at M unchen Background Recent series of papers presenting such decision


  1. 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 }

  2. Instantiation of framework

  3. Instantiation of framework σ = α rexp set

  4. Instantiation of framework σ = α rexp set init ( r ) = { r }

  5. Instantiation of framework σ = α rexp set init ( r ) = { r } � δ x R = D x r r ∈ R

  6. Instantiation of framework σ = α rexp set init ( r ) = { r } � δ x R = D x r r ∈ R fin ( R ) = ∃ r ∈ R. ε ( r )

  7. 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

  8. Finiteness Theorem (Antimirov 1996) Starting from a regular expression r

  9. Finiteness Theorem (Antimirov 1996) Starting from a regular expression r at most | r | at + 1 regular expressions are reachable

  10. 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 .

  11. 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 =

  12. 1 The Unified Framework 2 Derivatives of Regular Expressions 3 Partial Derivatives of Regular Expressions 4 Marked regular expressions 5 Empirical Comparison

  13. History McNaughton & Yamada 1960, Glushkov 1961:

  14. History McNaughton & Yamada 1960, Glushkov 1961: • Translation of regular expression to N/DFA

  15. 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

  16. 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 }

  17. 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, α )

  18. 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

  19. Example: ( a · a + a · b ) ∗

  20. Example: ( a · a + a · b ) ∗ q 0

  21. Example: ( a · a + a · b ) ∗ a q 0 ( a · a + a · b ) ∗

  22. Example: ( a · a + a · b ) ∗ ( a · a + a · b ) ∗ a a q 0 ( a · a + a · b ) ∗

  23. Example: ( a · a + a · b ) ∗ ( a · a + a · b ) ∗ a a a q 0 ( a · a + a · b ) ∗

  24. Example: ( a · a + a · b ) ∗ ( a · a + a · b ) ∗ a a a q 0 ( a · a + a · b ) ∗ b ( a · a + a · b ) ∗

  25. Example: ( a · a + a · b ) ∗ ( a · a + a · b ) ∗ a a a q 0 ( a · a + a · b ) ∗ a b ( a · a + a · b ) ∗

  26. Instantiation of framework

  27. Instantiation of framework σ = bool × ( bool × α ) rexp

  28. Instantiation of framework σ = bool × ( bool × α ) rexp init ( r ) = ( True, map ( λa. ( False, a )) r )

  29. Instantiation of framework σ = bool × ( bool × α ) rexp init ( r ) = ( True, map ( λa. ( False, a )) r ) δ x ( m, r ) = ( False, read x ( follow m r ))

  30. 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 ) = . . .

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend