re - REGULAR EXPRESSIONS DEFINITION A regular expression...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: REGULAR EXPRESSIONS DEFINITION A regular expression over alphabet Σ is defined inductively by: DEFINITION A regular expression over alphabet Σ is defined inductively by: Basis: DEFINITION A regular expression over alphabet Σ is defined inductively by: Basis: • ∅ is a regular expression denoting the language {}. DEFINITION A regular expression over alphabet Σ is defined inductively by: Basis: • ∅ is a regular expression denoting the language {}. • ￿ is a regular expression denoting the language {￿}. DEFINITION A regular expression over alphabet Σ is defined inductively by: Basis: • ∅ is a regular expression denoting the language {}. • ￿ is a regular expression denoting the language {￿}. • a is a regular expression denoting the language {a}. DEFINITION A regular expression over alphabet Σ is defined inductively by: Basis: • ∅ is a regular expression denoting the language {}. • ￿ is a regular expression denoting the language {￿}. • a is a regular expression denoting the language {a}. Induction Step: DEFINITION A regular expression over alphabet Σ is defined inductively by: Basis: • ∅ is a regular expression denoting the language {}. • ￿ is a regular expression denoting the language {￿}. • a is a regular expression denoting the language {a}. Induction Step: • if r, s are regular expressions denoting languages R, S then: – r + s is a regular expression denoting R ∪ S . – rs is a regular expression denoting RS . – r∗ is a regular expression denoting R∗ . EXAMPLES L(r) = language denoted by regular expression r EXAMPLES L(r) = language denoted by regular expression r (0 + 1)∗ EXAMPLES L(r) = language denoted by regular expression r (0 + 1)∗ ∅0 EXAMPLES L(r) = language denoted by regular expression r (0 + 1)∗ ∅0 0∗ + (0∗ 10∗ 10∗ 10∗ )∗ EXAMPLES L(r) = language denoted by regular expression r (0 + 1)∗ ∅0 0∗ + (0∗ 10∗ 10∗ 10∗ )∗ (0 + ￿)(1 + 10)∗ EXAMPLES L(r) = language denoted by regular expression r (0 + 1)∗ ∅0 0∗ + (0∗ 10∗ 10∗ 10∗ )∗ (0 + ￿)(1 + 10)∗ (1 + 01)∗ (0 + ￿) REGULAR EXPRESSIONS VS REGULAR LANGUAGES Theorem. Regular languages = {L : ∃r s.t. L = L(r)}. no e s! te ad e R th pr e of o om fr th USEFUL EQUALITIES USEFUL EQUALITIES r￿ = r USEFUL EQUALITIES r￿ = r r∅ = ∅ USEFUL EQUALITIES r￿ = r r∅ = ∅ r+s=s+r USEFUL EQUALITIES r￿ = r r∅ = ∅ r+s=s+r (r + s) + t = r + (s + t) USEFUL EQUALITIES r￿ = r r∅ = ∅ r+s=s+r (r + s) + t = r + (s + t) r(s + t) = rs + rt USEFUL EQUALITIES r￿ = r r∅ = ∅ r+s=s+r (r + s) + t = r + (s + t) r(s + t) = rs + rt (rs)t = r(st) USEFUL EQUALITIES r￿ = r r∅ = ∅ r+s=s+r (r + s) + t = r + (s + t) r(s + t) = rs + rt (rs)t = r(st) (r ) = r ∗∗ ∗ ...
View Full Document

This note was uploaded on 04/11/2010 for the course CSC CSC236 taught by Professor Farzanazadeh during the Spring '10 term at University of Toronto- Toronto.

Ask a homework question - tutors are online