03 - Lecture 3: Languages and Regular Expressions Basic...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

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

Unformatted text preview: Lecture 3: Languages and Regular Expressions Basic concepts • Alphabet — a finite set of symbols, Σ. • word (or string ) — a finite sequence of symbols from an alphabet. Alphabet Words { a, b, . . . , z } man, abc, . . . { 0, 1 } 000, 010101, . . . { #, $, a, b, c } #cb$, $$$, . . . • | w | — length of a word w , i.e. the number of symbols in w . • e — the empty word containing no symbols, i.e. the word of zero length. • To avoid confusion, e should not be in any alphabet. 1 Languages • A language is a set of words defined over an alphabet Σ. Examples: 1. Set of all English words — a language over { a, b, . . . , z } . 2. { 01, 0101, 010101, . . . } — a language over { , 1 } . 3. { e } — a language over any alphabet. • ∅ — the empty language , i.e. the language contain- ing has no words. • Σ ∗ — the set of all words over the alphabet Σ. It is called the universal language. Any language L is a subset of Σ ∗ . • Note: ∅ = { e } . 2 Operations on words • Concatenation merges two given words to form a new word: e.g. abc 123 = abc 123 – Properties: ew = we = w ( uv ) w = u ( vw ) • Reversal reverses the order of all the symbols in a given w . w = a 1 ··· a n ⇒ w R = a n ··· a 1 – Inductive definition: (1) e R = e (2) ( au ) R = u R a , where a ∈ Σ , u ∈ Σ ∗ • Power concatenates n...
View Full Document

Page1 / 13

03 - Lecture 3: Languages and Regular Expressions Basic...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online