Symbols and Alphabets
Definition: Alphabet
An alphabet is a set whose elements we call symbols.
Expressions
Definition: Expression
Let be an alphabet.
An expression over is a tuple of symbols from .
Note: Strings
Expressions are also called strings.
NOTATION
Expressions are usually written by listing their symbols directly, instead of placing them between parentheses in a comma-separated list, as is usually the case with tuples. For example, the expression is written as .
The set of all expressions which can be formed using the alphabet is denoted by .
Definition: Concatenation
Let and be two expressions formed from the same alphabet.
The concatenation of to is the expression obtained by listing the symbols of first and then the symbols of .
NOTATION
Syntax
Definition: Well-Formed Formula
Let be a formal language.
A well-formed formula in is an expression in the alphabet which is considered valid under the syntax .
NOTE
The term “well-formed formula” is often abbreviated to “wff”.
INTUITION
Well-formed formulas can be thought of as expressions which are meaningful in the context of a given language. For example, the sentence “Yesterday, Harry went to the bar” is meaningful and can be considered a wff in English. In constrast, the sentence “Fall on the in chair sock” does not carry any meaning and is, therefore, not a wff in English.
Definition: Syntax
Let be an alphabet.
A syntax is a set of rules that specify which expressions in are considered well-formed formulas and how to generate new wffs from existing ones.
Formal Languages
Definition: Formal Language
A formal language is an ordered pair consisting of an alphabet and a syntax .
NOTATION
Formal languages are often denoted by with or without subscripts.