Chapter 2 (and 1) review

Grammar

A derivation is a sequence of substitions to obtain a string. If there is more than one derivation for any string, the grammer is ambiguous. In a leftmost derivation, the leftmost remaining variable is always removed.

The ambiguous grammar

Could 1×2+3 be 5? See pages 105 to 108, particularly 107.

Determinate vs Nondeterminate

A determinate machine has exactly one next action. A nondeterminate machine can have zero or more next actions, and magically do them all. That’s because it moves through sets of possible states.

Any nondeterminate finite automaton can be converted to a determinate finate automation. The is not the case for the pushdown autotomaton.

The ε transistion

From page 48 of the textbook regarding finite state machines:

If a state with a ε symbol on an exiting arrow is encountered, … [w]ithout reading any input, the machine splits into multiple copies, one following each of the exiting ε-labeled arrow and one staying at the current state.

From page 113 of the textbook regarding pushdown automaton:

… the current state, next input symbol read, and top symbol on the stack determine the next move of the pushdown automaton. Either symbol can be ε, causing the machine to move without reading a symbol from the input or without reading a symbol from the stack.

Remember that both finite state machines and pushdown automaton can be nondeterminate (having more than one “next” action). However nondeterminism only increases the “power” of the pushdown automaton.

By the way, for finite state automata ε-closure can be used to eliminate the ε transistion. This does not work for pushdown automata.

Pumping lemmas

Regular languages

if L is a regular language
  there exists p > 0 such that
    for every s ∈ L
      there exists x, y, and z such that
        s = xyz
        |xy| ≤ p
	|y| > 0
        for every i ≥ 0
          xyiz ∈ A

Context free languages

if L is a context free language
  there exists p > 0 such that
    for every s ∈ L
      there exists u, v, x, y, and z such that
        s = uvxyz
        |vxy| ≤ p
        |v| > 0 or |y| > 0
        for every i ≥ 0
          uvixyiz ∈ A

Regular languages

Showing a language is regular

Showing a language is not regular

Context free languages

Showing a language is context free

Showing a language is not context free