PLC Flashcards
Alphabet Notation
Σ denotes a generic alphabet.
a,b,c,d stand for the letters.
Empty string is ϵ.
Set of all strings over Σ is Σ*, this always includes the empty string.
For the strings x and y, xy is the result of concatenating them, can be done exponentially too.
Arity of a symbol?
How many arguments it takes.
Arity 0 is nullary
Arity 1 is unary
Arity 2 is binary
if a set of symbols is given alongside their arities, they are said to be ranked.
Parts of a concrete syntax?
A set of production rules (a.k.a productions, or rules). Each with a head (LHS) and tail (RHS).
Each head consists of a single non-terminal symbol. A rule with a head X is called an X-rule.
The RHS consists of a combination of non-terminal and terminal symbols.
One of the non-terminal symbols is designated as the starting symbol.
Regex Syntax
Syntax of Semantic Rules?
The hypotheses/premises are placed on top of the line, with the conclusion underneath. The side condition is placed to the right hand side.
If the premises are valid, and the conditions are true, then you can deduce the conclusion is valid.
An instantiation of a rule is when the variables are replaced with specific instances of the correct type.
What are the 5 components of a finite automata?
- A collection of states Q
- A finite alphabet Sigma
- A transition function sigma of type Q X Sigma -> Q
- An initial state q0 which is an element of Q
- A collection of accepting states F which is a subset of Q
What is the language of a finite automata?
L(M) = The set of all strings accepted by M
What is the shared trait between Regular Expressions and Finite Automata?
Both express the same set of languages (regular languages)
Pumping Lemma Definition
For any regular language:
There is a natural number p such that for any word of length at least p, the word can be split into three parts u,v,w such that:
- v is not empty
- |uv| <= p
- for any integer i u(v^i)w is in the language
What is the state of an arithmetic expression?
A mapping of variable values to values in Z.
How do you denote a state function?
[x->v]sigma maps x to v in the state sigma.
If the variable x is not defined in the state sigma, what is sigma(x)?
0, by convention
What is A⁻ & A
The set of simple (no variables) arithmetic expressions in While, the set of all arithmetic expressions in While
What is ℬ and B.
ℬ is the set of boolean expressions. B is a variable that represents a specific boolean expression.
What is 𝒮 and S.
𝒮 is the set of statements. S represents a specific statement.