Langlib

Langlib.Grammars.NonContracting.Definition

Non-Contracting Grammar Definitions #

This file defines non-contracting grammars as unrestricted grammars whose rules never decrease the length of the rewritten sentential form. It also contains the grammar-level translation machinery relating non-contracting grammars to context-sensitive grammars.

Overview #

A non-contracting grammar (also called monotone grammar) is an unrestricted grammar where every rule satisfies |output| ≥ |input|, i.e., the right-hand side is at least as long as the left-hand side.

The equivalence of these two formulations is a classical result in formal language theory. Every context-sensitive grammar is non-contracting (easy direction), and every non-contracting grammar can in principle be converted to an equivalent context-sensitive grammar (hard direction).

Main declarations #

References #

The equivalence is standard; see e.g. Hopcroft, Motwani, Ullman, "Introduction to Automata Theory, Languages, and Computation", Chapter 9.

Non-contracting grammars #

An unrestricted grammar is non-contracting (monotone) if for every rule, the output string is at least as long as the full input pattern input_L ++ [input_N] ++ input_R.

Equations
Instances For
    def is_noncontracting {T : Type} (L : Language T) :

    Predicate: a language is generated by some non-contracting grammar.

    Equations
    Instances For