Formal Language Classification #
Framework-agnostic classification of formal languages by generative capacity. This is the single canonical definition used throughout the library — phenomenon data files, theory modules, and study files all import this type rather than defining their own.
The four levels reflect the Chomsky hierarchy as relevant to natural language: regular (FSA), context-free (CFG), mildly context-sensitive (CCG, TAG, etc.), and context-sensitive (CSG).
Classification of formal languages by generative capacity.
regular: generated by finite-state automata / regular grammarscontextFree: generated by context-free grammars (CFGs)mildlyContextSensitive: beyond CFG but polynomially parsable (CCG, TAG)contextSensitive: full context-sensitive grammar power
- regular : FormalLanguageType
- contextFree : FormalLanguageType
- mildlyContextSensitive : FormalLanguageType
- contextSensitive : FormalLanguageType
Instances For
Equations
- Core.instBEqFormalLanguageType.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Numeric encoding for the Chomsky hierarchy ordering.
Equations
Instances For
Equations
- Core.instLTFormalLanguageType = { lt := fun (a b : Core.FormalLanguageType) => a.toNat < b.toNat }
Equations
- Core.instLEFormalLanguageType = { le := fun (a b : Core.FormalLanguageType) => a.toNat ≤ b.toNat }
Equations
Equations
The proper inclusion chain: regular ⊂ CF ⊂ MCS ⊂ CS.