Ch2 - Chapter 2 Languages Languages s Defn. A language is a...

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

View Full Document Right Arrow Icon
Languages Chapter 2
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Languages Defn . A language is a set of strings over an alphabet . A more restricted definition requires some forms of restrictions on the strings, i.e., strings that satisfy certain properties Defn . The syntax of a language restricts the set of strings that satisfy certain properties .
Background image of page 2
3 Languages Defn . A string over an alphabet X , denoted Σ , is a finite sequence of elements from X , which are indivisible objects e.g., English words in English The set of strings over an alphabet is defined recursively (as given below)
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Languages Defn. 2.1.1. Let Σ be an alphabet. Σ *, the set of strings over Σ , is defined recursively as follows: (i) Basis : λ Σ *, the null string (ii) Recursion : w Σ *, a Σ wa Σ * (iii) Closure : w Σ * is obtained by step (i) and a finite # of step (ii) The length of a string w is denoted length(w) Q: If Σ contains n elements, how many possible strings over Σ are of length k ( Σ *)?
Background image of page 4
5 Language s Example : Given Σ = { a , b }, Σ * includes λ , a , b, aa, ab, ba, bb, aaa , … Defn 2.1.2. A language over an alphabet Σ is a subset of Σ *. Defn 2.1.3. Concatenation , is the fundamental binary operation in the generation of strings, which is associative , but not commutative , is defined as i. Basis: If length ( v ) = 0, then v = λ and uv = u ii. Recursion: Let v be a string with length (v) = n (> 0). Then v = wa , for string w with length n -1 and a Σ , and uv = ( uw ) a
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Languages Example : Let α = ab , β = cd , and γ = e α ( βγ ) = ( αβ ) γ , but αβ βα , Exponents are used to abbreviate the concatenation of a
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

Ch2 - Chapter 2 Languages Languages s Defn. A language is a...

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

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