RE Closure Under Reversal #
This file proves closure of recursively enumerable languages under reversal.
The key construction reversal_grammar reverses each rule of an unrestricted grammar.
The central result grammar_language_reversal_grammar shows that the language of the
reversed grammar equals the reversal of the original language. This fact is then reused
by the context-free and context-sensitive reversal proofs, avoiding duplicated derivation
arguments.
Main declarations #
reversal_grule— reverse a single unrestricted rulereversal_grammar— reverse every rule of an unrestricted grammargrammar_language_reversal_grammar— language of reversed grammar = reversed languageRE_of_reverse_RE
Reverse a single unrestricted rule by swapping and reversing the left/right context and reversing the output string.
Equations
Instances For
Reverse every rule of an unrestricted grammar.
Equations
- reversal_grammar g = { nt := g.nt, initial := g.initial, rules := List.map reversal_grule g.rules }
Instances For
The language of the reversed grammar is exactly the reversal of the original language.
This is the key lemma that is reused by the context-free and context-sensitive reversal closure proofs, so that the derivation-reversal argument need only be given once.
The class of recursively enumerable languages is closed under reversal.