Lecture 4+5 Flashcards
What is an alphabet and what is a string?
An alphabet is any finite set. The alphabet is typically denoted Σ(sigma). A string is any finite sequence of symbols produced from an alphabet. A string could be denoted f : n → Σ.
What are some special symbols to do with strings
Σ* the set of all strings over an alphabet, λ, the empty string.
What is the fundamental string operation and how can strings be made easily?
Concatenation, in which case one string is added to the end of another. A string can be easily made using recursion.
What is a language? What is a common proof technique for these?
A language is the subset of all the possible strings over an alphabet. A common proof technique would be induction.
What is a regular expression and what type of language is it?
a regular expression is a type of regular language with the rules that:
start with the languages:empty alphabet, empty string and then one language for each symbol in the alphabet.
New languages are then formed with the rules:
L ∪ K (union)
• LK = {xy|x ∈ L, y ∈ K} (concatenation)
• L∗concatenation of 0 or more elements of L. Or: λ ∈ L∗
, and if w ∈ L∗ and u ∈ L, then wu ∈ L∗
.
What is a rule?
an expression in the form A -> w where A is a nonterminal value which will be replaced with w(a set of possible strings) when A appears in a sequence.
What is a context free grammar?
Some set of rules over a fixed set of non terminal and terminal symbols. Must come with a single distinguished nonterminal symbol called the start symbol
What is a derivation tree?
A way of visualising context free grammars, the start symbol S is the root of the tree and the terminal symbols chosen become the children of the node. The tree can be read from left to right.
What is a regular grammar?
A regular grammar is a context free grammar in which every rule is one of three forms: A-> a, A -> aB, A -> λ.
Any context free grammar that follows these rules will be a regular language.