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

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

Languages Chapter 2

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

View Full Document
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 .
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)

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

View Full Document
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 ( Σ *)?
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

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

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

## This note was uploaded on 03/02/2012 for the course C S 252 taught by Professor Dennisng during the Winter '12 term at BYU.

### 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
Ask a homework question - tutors are online