Professional Documents
Culture Documents
Automata and Formal Languages
Automata and Formal Languages
net/publication/2833761
CITATIONS READS
12 2,316
1 author:
Dominique Perrin
Ecole Supérieure d'Ingénieur en Electronique et Electrotechnique - Paris
155 PUBLICATIONS 3,227 CITATIONS
SEE PROFILE
All content following this page was uploaded by Dominique Perrin on 16 October 2013.
Peter Wood
Motivation and
Background
Automata
Automata and Formal Languages Grammars
Regular
Expressions
Example of
Peter Wood Research
Conclusion
Department of Computer Science and Information Systems
Birkbeck, University of London
ptw@dcs.bbk.ac.uk
Automata and
Outline Formal
Languages
Peter Wood
Motivation and
Motivation and Background Background
Automata
Grammars
Automata
Regular
Expressions
Example of
Grammars Research
Conclusion
Regular Expressions
Example of Research
Conclusion
Automata and
Doing Research Formal
Languages
Peter Wood
Motivation and
Background
Automata
I analysing problems/languages Grammars
I computability/solvability/decidability Regular
Expressions
— is there an algorithm?
Example of
Research
I computational complexity
Conclusion
— is it practical?
I expressive power
— are there things that cannot be expressed?
I formal languages provide well-studied models
Automata and
Formal Languages Formal
Languages
Peter Wood
Motivation and
Background
I finite alphabet of symbols Σ Automata
— e.g., Σ = {0, 1} Grammars
Peter Wood
Motivation and
Background
I finite alphabet of symbols Σ Automata
— e.g., Σ = {0, 1} Grammars
Peter Wood
Motivation and
Background
I device (machine) for recognising (accepting) a Automata
language Grammars
Peter Wood
Motivation and
Background
Automata
Grammars
I finite state automaton Regular
I deterministic Expressions
I nondeterministic Example of
Research
I pushdown automaton Conclusion
I linear-bounded automaton
I Turing machine
Automata and
Example of a Finite State Automaton Formal
Languages
Peter Wood
Example of
Research
0 0 Conclusion
1
seven sodd
1
Automata and
Grammars Formal
Languages
Peter Wood
Motivation and
I grammars generate languages using: Background
Example of
U→V Research
Conclusion
where U and V are (loosely) strings over Σ ∪ N
I a string (sequence of terminals) w is generated by G
if there is a derivation of w using G, starting from the
starting nonterminal of G
I language generated by grammar G, denoted L(G), is
the set of strings which can be derived using G
Automata and
Grammar Example Formal
Languages
Peter Wood
I L1 (strings with an even number of 1’s) can be
Motivation and
generated by grammar with productions Background
Automata
S → Grammars
S → 0S Regular
Expressions
S → 1T Example of
Research
T → 0T Conclusion
T → 1S
Peter Wood
I L1 (strings with an even number of 1’s) can be
Motivation and
generated by grammar with productions Background
Automata
S → Grammars
S → 0S Regular
Expressions
S → 1T Example of
Research
T → 0T Conclusion
T → 1S
Peter Wood
Motivation and
Background
Automata
Grammars
I to specify syntax of programming languages Regular
Expressions
I in natural language understanding
Example of
I in pattern recognition Research
Conclusion
I to specify schemas (types) for tree-structured data,
e.g., XML
I ...
Automata and
Hierarchy of Grammars and Languages Formal
Languages
Peter Wood
Motivation and
Background
I restrictions on productions give different types of
Automata
grammars
Grammars
I regular (type 3) Regular
I context-free (type 2) Expressions
I context-sensitive (type 1) Example of
Research
I phrase-structure (type 0)
Conclusion
I for context-free, e.g., left side must be single
nonterminal
I no restrictions for phrase-structure
I language is of type i iff there is a grammar of type i
which generates it
Automata and
Examples of Language Hierarchy Formal
Languages
Peter Wood
Motivation and
Background
I varying expressive power Automata
phrase-structure Regular
Expressions
Example of
Research
Conclusion
Automata and
Examples of Language Hierarchy Formal
Languages
Peter Wood
Motivation and
Background
I varying expressive power Automata
phrase-structure Regular
Expressions
I L1 (strings over {0, 1} with an even number of 1’s) is Example of
Research
regular
Conclusion
Automata and
Examples of Language Hierarchy Formal
Languages
Peter Wood
Motivation and
Background
I varying expressive power Automata
phrase-structure Regular
Expressions
I L1 (strings over {0, 1} with an even number of 1’s) is Example of
Research
regular
Conclusion
I L2 = {0n 1n | n ≥ 0} is context-free, but not regular
Automata and
Examples of Language Hierarchy Formal
Languages
Peter Wood
Motivation and
Background
I varying expressive power Automata
phrase-structure Regular
Expressions
I L1 (strings over {0, 1} with an even number of 1’s) is Example of
Research
regular
Conclusion
I L2 = {0n 1n | n ≥ 0} is context-free, but not regular
I L3 = {ww | w ∈ {0, 1}∗ } is context-sensitive, but not
context-free
Automata and
Examples of Language Hierarchy Formal
Languages
Peter Wood
Motivation and
Background
I varying expressive power Automata
phrase-structure Regular
Expressions
I L1 (strings over {0, 1} with an even number of 1’s) is Example of
Research
regular
Conclusion
I L2 = {0n 1n | n ≥ 0} is context-free, but not regular
I L3 = {ww | w ∈ {0, 1}∗ } is context-sensitive, but not
context-free
I there exists a phrase-structure (recursive) language
which is not context-sensitive
Automata and
Complexity of Grammar Problems Formal
Languages
Peter Wood
Conclusion
I P: decidable in polynomial time
I PSPACE: decidable in polynomial space (and
complete for PSPACE: at least as hard as
NP-complete)
I U: undecidable
I so type of grammar has significant effect on
complexity
Automata and
Relationships between Languages and Formal
Languages
Automata Peter Wood
Motivation and
Background
Automata
Grammars
Regular
Expressions
Example of
A language is Research
Conclusion
regular finite-state
iff
context-free pushdown
accepted
context-sensitive linear-bounded
by
phrase-structure Turing machine
Automata and
Regular Expressions Formal
Languages
Peter Wood
Motivation and
Background
Automata
I algebraic notation for denoting regular languages Grammars
Regular
I use ◦ (concatenation), ∪ (union) and ∗ (closure) Expressions
operators Example of
Research
I L1 denoted by RE 0∗ ∪ (0∗ ◦1◦ 0∗ ◦1◦ 0∗ )∗ Conclusion
I given RE R, the set of strings it denotes is L(R)
I pattern matching in text
I query languages for XML or RDF
Automata and
Using Regular Expressions to Query Graphs Formal
Languages
Graphs (networks) are widely used for representing data Peter Wood
Regular
I semistructured data Expressions
Peter Wood
Motivation and
I (my PhD thesis!) Background
Automata
I usually regular expressions used for string search Grammars
I consider data represented by a directed graph of Regular
Expressions
labelled nodes and labelled edges
Example of
I regular expressions can express paths we are Research
Conclusion
interested in
I sequence of edge labels rather than sequence of
symbols (characters)
I a query using regular expression R can ask for all
nodes connected by a path whose concatenation of
edge labels is in L(R)
Automata and
Formal
Graph G (where nodes represent people and places): Languages
Peter Wood
Automata
Grammars
locatedIn Regular
Expressions
Example of
Research
bornIn
b CT Conclusion
livesIn
bornIn
c UK
Automata and
Formal
Languages
Peter Wood
Motivation and
Background
Regular expression Automata
Regular
asks for paths of edges between a person x and a place Expressions
Example of
y such that Research
I x is a citizenOf y , or Conclusion
I x is bornIn or livesIn y , or
I x is bornIn or livesIn a place that is locatedIn y
Automata and
Regular path query evaluation Formal
Languages
Peter Wood
Peter Wood
Automata
bornIn Grammars
Regular
Expressions
start s0 s1 locatedIn Example of
livesIn Research
Conclusion
citizenOf
sf
Automata and
Formal
Intersection of G and M Languages
Peter Wood
citizenOf
Motivation and
Background
Automata
a, s0 SA, s1 SA, sf
Grammars
Regular
Expressions
locatedIn Example of
Research
bornIn Conclusion
b, s0 CT , s1 CT , sf
livesIn
bornIn
c, s0 UK , s1 UK , sf
Automata and
Formal
Intersection of G and M Languages
Peter Wood
citizenOf
Motivation and
Background
Automata
a, s0 SA, s1 SA, sf
Grammars
Regular
Expressions
locatedIn Example of
Research
bornIn Conclusion
b, s0 CT , s1 CT , sf
livesIn
bornIn
c, s0 UK , s1 UK , sf
Automata and
Formal
Intersection of G and M Languages
Peter Wood
citizenOf
Motivation and
Background
Automata
a, s0 SA, s1 SA, sf
Grammars
Regular
Expressions
locatedIn Example of
Research
bornIn Conclusion
b, s0 CT , s1 CT , sf
livesIn
bornIn
c, s0 UK , s1 UK , sf
Automata and
Formal
Intersection of G and M Languages
Peter Wood
citizenOf
Motivation and
Background
Automata
a, s0 SA, s1 SA, sf
Grammars
Regular
Expressions
locatedIn Example of
Research
bornIn Conclusion
b, s0 CT , s1 CT , sf
livesIn
bornIn
c, s0 UK , s1 UK , sf
Automata and
Formal
Intersection of G and M Languages
Peter Wood
citizenOf
Motivation and
Background
Automata
a, s0 SA, s1 SA, sf
Grammars
Regular
Expressions
locatedIn Example of
Research
bornIn Conclusion
b, s0 CT , s1 CT , sf
livesIn
bornIn
c, s0 UK , s1 UK , sf
Automata and
Formal
Intersection of G and M Languages
Peter Wood
citizenOf
Motivation and
Background
Automata
a, s0 SA, s1 SA, sf
Grammars
Regular
Expressions
locatedIn Example of
Research
bornIn Conclusion
b, s0 CT , s1 CT , sf
livesIn
bornIn
c, s0 UK , s1 UK , sf
Automata and
Regular simple path queries Formal
Languages
Peter Wood
Conclusion
Automata and
Regular simple path queries Formal
Languages
Peter Wood
Peter Wood
c
a b
Automata and
Approaches to deal with this problem Formal
Languages
Peter Wood
Automata
Grammars
Regular
Expressions
Example of
Research
Conclusion
Automata and
Approaches to deal with this problem Formal
Languages
Peter Wood
Grammars
Regular
Expressions
Example of
Research
Conclusion
Automata and
Approaches to deal with this problem Formal
Languages
Peter Wood
Example of
Research
Conclusion
Automata and
Approaches to deal with this problem Formal
Languages
Peter Wood
abbreviations Conclusion
Automata and
Approaches to deal with this problem Formal
Languages
Peter Wood
abbreviations Conclusion
Peter Wood
abbreviations Conclusion
Peter Wood
Motivation and
Background
Automata
Grammars
I in general, may also run experiments to measure Regular
actual running times Expressions
Example of
Research
Conclusion
Automata and
Other approaches Formal
Languages
Peter Wood
Motivation and
Background
Automata
Grammars
I in general, may also run experiments to measure Regular
actual running times Expressions
Example of
I may also develop approximation algorithms Research
I can sometimes find a PTIME algorithm with a Conclusion
performance guarantee (e.g. for TSP, finds a tour at
most twice the optimal distance)
I other times this problem itself is NP-hard
Automata and
Conclusion Formal
Languages
Peter Wood
Motivation and
Background
I is my system/language more powerful than others? Automata
Grammars
I is my system/language more efficient than others?
Regular
I expressive power or computational complexity can Expressions
be studied by relating them to Example of
Research
I formal language theory: languages, grammars,
Conclusion
automata, . . .
I tradeoff between expressive power and
computational complexity
I consider restrictions of difficult problems or giving up
exact solutions
Automata and
References Formal
Languages
Peter Wood
Motivation and
I Aho, Hopcroft and Ullman, “The Design and Analysis Background
Grammars
I Garey and Johnson, “Computers and Intractability: A
Regular
Guide to the Theory of NP-Completeness,” W. H. Expressions
Freeman and Company, 1979 Example of
Research
I Lewis and Papadimitriou, “Elements of the Theory of Conclusion
Computation,” Prentice-Hall, 1981
I Mendelzon and Wood, “Finding Regular Simple
Paths in Graph Databases,” SIAM J. Computing, Vol.
24. No. 6, 1995, pp. 1235–1258
I Sipser, “Introduction to the Theory of Computation,”
PWS Publishing Company, 1997