0% found this document useful (0 votes)
160 views6 pages

Regular Expressions & Fsas

- Regular expressions can be represented as finite state automata (FSA), which can be either deterministic (DFSA) or non-deterministic (NFSA). Any NFSA can be converted to an equivalent DFSA. - An FSA represents a regular language using states, transitions between states based on input symbols, a start state, and accepting/final states. - FSAs can be implemented using transition tables or search algorithms like depth-first or breadth-first search to process input strings. Regular languages have properties of closure under operations and are equivalent to languages recognized by FSAs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
160 views6 pages

Regular Expressions & Fsas

- Regular expressions can be represented as finite state automata (FSA), which can be either deterministic (DFSA) or non-deterministic (NFSA). Any NFSA can be converted to an equivalent DFSA. - An FSA represents a regular language using states, transitions between states based on input symbols, a start state, and accepting/final states. - FSAs can be implemented using transition tables or search algorithms like depth-first or breadth-first search to process input strings. Regular languages have properties of closure under operations and are equivalent to languages recognized by FSAs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 6

Regular Expressions & FSAs

• Any regular expression can be realized as


a finite state automaton (FSA)
• There are two kinds of FSAs
– Deterministic (DFSAs)
– Non-deterministic (NFSAs)
• Any NFSA can be converted into a corresponding DFSA.
• A FSA (a regular expression) represents a regular language.

Regular Expressions

Finite Automata Regular Languages


BİL711 Natural Language Processing 1
A DFSA and A NFSA

a b
a a,b
0 1 0 1

b b

A NFSA: a*(a|b)b*
A DFSA : a | b+

BİL711 Natural Language Processing 2


Formal Definition of Finite-State Automata
• FSA is Q x  x q0 x F x 

• Q: a finite set of N states q0, q1, … qN


• : a finite input alphabet of symbols
• q0: the start state
• F: the set of final states -- F is a subset of Q
• (q,i): transition function
– DFSA : There is exactly one arc leaving a state q with a symbol a.
There is no arc with the empty string.
– NFSA : There can be more than one arc leaving a state q with a symbol a.
There can be arcs with empty string.

BİL711 Natural Language Processing 3


Transition Tables for FSAs
a b a b €
1 2 3 1 1,2 2 *
2 * * 2 * 2 *

3 * 3

A NFSA
A DFSA

• We can use transition tables to show FSAs.

BİL711 Natural Language Processing 4


Implementation of FSAs
• To implement DFSA is simpler.
• To implement NFSAs, we need a search algorithm.
– Depth-first – be careful about infinite loops
– Breadth-first
Search Space
a b
1,aaab
a,b
1 2
2,aab 1,aab
fail
2,ab 1,ab
Tape: aaab fai
l 2,b 1,b

2,- 2,-
success success
BİL711 Natural Language Processing 5
Regular Languages

• Operations on regular languages and FSAs:


– concatenation, closure, union
• Properties of regular languages
– closed under concatenation, union, disjunction, intersection, difference,
complementation, reversal, closure.
• Equivalent to finite-state automata.

BİL711 Natural Language Processing 6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy