A basic goal for linguistic theory is to use the most restricted possible formalism. This conflicts with the computational need to have flexible formalisms in case one needs them. Whatever one's stand on this issue, grammar complexity is defined by constraints on types of strings; these constraints are the rules of formal grammars.
A formal grammar is generally described as a structure containing a vocabulary and a set of rules for defining strings on the basis of the vocabulary.
More precisely:
The general assumptions are made that
,
and that
,
Formal grammars and languages are ordered with in a subset or implication relationship along a scale of restrictiveness:
Type 3
Type 2
Type 1
Type 0