SLIDE 8 CSC 473 Automata, Grammars & Languages 9/29/10 Lecture 03 8
C SC 473 Automata, Grammars & Languages 22
Regular Operations & Regular Expressions
- The regular operations on languages are:
union (∪), concatenation (⋅ ) and Kleene star (*).
- So called because the class of regular languages are
closed under them—i.e., applying these operators to regular languages results in a regular language. (We will prove these closure results later.)
- In fact, these three operations (∪, ⋅ ,*) actually characterize
what it means to be a regular language: any regular language can be built up from alphabet symbols and a finite number of these regular operations.
- This motivates the notion of regular expression: a
sequence of symbols, like an arithmetic expression, that defines a regular language using regular ops.
C SC 473 Automata, Grammars & Languages 23
Regular Expressions
- A syntax for describing sets of strings (languages)
Terse Eliminates fussy “{ }” Reminiscent of arithmetic expressions Obeys some useful “algebra”, e.g., (E*F*)* = (E+F)*
- Syntax for regular expressions over Σ,+, ⋅ ,*,(,)
E → (E+E) ( text uses ∪ not +; some authors use |) → (EE)
(usually suppress the ⋅ in E ⋅ E)
→ (E*) → ε (some authors use λ ) → ∅ → a for each a in Σ
- suppress (,) where possible: (a+b)*a not ( ( (a + b)* ) ⋅ a )
C SC 473 Automata, Grammars & Languages 24
Regular Expressions (contʼd)
- Meaning rules for the syntax
- The meaning (denotation) of an expression, L(E), is a set
- f strings (a language)
- Rules
expression E language L(E) ∅ a {a} ε {ε} (E+F) L(E)∪L(F) (EF) L(E)⋅L(F) (E*) L(E)*
{} =