Constructions and membership for context-sensitive grammars and linear bounded automata. The Turing package and the translation layer build on its conversions.
Algorithms
CFG to LBA. Reduces the grammar to Chomsky normal form and builds an automaton that merges adjacent parse trees on its tape until one start tree remains. (cfgToLba, buildCfgLba)
PDA to LBA. Converts the machine to a grammar and then to an automaton. (pdaToLba, buildPdaLba)
Grammar to LBA. Runs the productions in reverse on a bounded tape window. A grammar of context-free shape takes the CFG route. (csgToLba)
LBA to grammar. Builds a grammar that simulates a bounded window cell by cell. A read-only deterministic machine goes through a two-way DFA and a right-linear grammar. (lbaToCsg)
Checked LBA normalization. Adds a fresh initial control and one accepting halt, keeps rejecting halts, and simulates visits to fixed markers on the adjacent input cell. The empty word is checked by a bounded configuration search. The entry construction keeps its existing route. (checkedLbaToCsg)
Kuroda normal form. Rewrites a grammar into productions of the forms A -> a, A -> B, A -> BC and AB -> CD. (kurodaForm)
Membership. Builds the automaton of the grammar and searches its configurations for an accepting path. (csgMembership)
Compilation and dumps. Compiles a grammar into the dense form and prints it, and prints a Kuroda form. (compileCsg, dumpCompiledCsg, dumpKurodaForm)
Frame explanation. Describes a construction frame in words. (explainContextSensitiveFrame)
Data structures
Compiled grammar. Numbers the variables and terminals densely and keeps each production in declaration order. (compileCsg)
Entry LBA. A machine checked to start at the left marker and never re-enter its start. (EntryLba, asEntryLba)
Kuroda grammar. A grammar branded as being in Kuroda normal form. (KurodaGrammar)
Compiled production. A production with dense symbol codes and its original identity. (CompiledProduction)
Conversion results and frames. The result of the automaton to grammar conversion and the retained steps of a construction. (LbaToCsgResult, ContextSensitiveFrame)
Decoders. Read frames, issues and targets back from plain data. (contextSensitiveFrameDecoder, contextSensitiveIssueDecoder, contextSensitiveTargetDecoder)
Enumerations. Name the closed sets of strings that the types and the wire data of the package use. (ContextSensitiveFrameKind, ContextSensitiveIssueCode)