Definition
Normal forms
For the grammar types
- Type-3:
, , where - Type-2:
, , where - Type-1:
, , , where - Type-0:
, , , where
For the types
From these normal forms, one immediately gets
Type 0
Definition
Link to originalGrammar
A grammar is defined as 4-tuple
, where
is the finite set of non-terminal symbols, is the finite set of terminal symbols, is the finite set of production rules (relation), and is the start symbol. Without further constraints,
is called unconstrained grammar or type-0 grammar and is the most general form of a grammar in the Chomsky hierarchy.
Type 1
Definition
Link to originalContext-Sensitive Grammar (Type-1)
A grammar
is called context-sensitive (Type-1) if every production rule in is context-sensitive. In words: a single non-terminal symbol may be replaced by a nonempty string, but only in its surrounding context.
Type 2
Definition
Link to originalContext-Free Grammar
A grammar
is called context-free if every production rule in is context-free. Equivalently: A language is called context-free there exists a pushdown automaton that accepts it.
Type 3
Definition
Link to originalRegular Grammar
A grammar
is called regular if every production rule is regular.