Langlib

Langlib.Classes.DeterministicContextFree.Decidability.Membership

Computability of Membership for Deterministic Context-Free Languages #

Membership here is the joint problem specified by a grammar code and a word. Since the repository does not yet have an EncodedDPDA, we use raw EncodedCFG codes and the semantic promise that the grammar's language is deterministic context-free. The existing CYK algorithm is total on every encoded CFG, and therefore uniformly decides membership on the promised DCFL codes in particular.

Main results #

The semantic promise that a raw encoded context-free grammar presents a deterministic context-free language.

Equations
Instances For

    The valid raw encoded grammars present exactly the deterministic context-free languages. Validity is a semantic promise; it is not asserted to be decidable.

    Run the existing encoded-CFG membership checker as a partial Boolean evaluator. It is in fact total even when the DCFL promise does not hold.

    Equations
    Instances For

      The encoded-CFG membership evaluator is partial recursive jointly in the raw grammar code and the input word.

      A single evaluator decides membership from an encoded grammar and a word, under the promise that the encoded grammar presents a deterministic context-free language.

      The evaluator is actually total and correct for every raw EncodedCFG; the promise is used to restrict the presented language class to exactly the DCFLs.

      DCFL membership is uniformly computable from an encoded grammar and a word. Valid encoded CFGs present exactly the deterministic context-free languages, raw CFG membership is effective, and the joint CYK evaluator is total and correct (in fact on every raw CFG code).

      theorem dcf_membership_computable {T : Type} [Fintype T] [DecidableEq T] [Primcodable T] {L : Language T} (hL : is_DCF L) :
      ComputablePred fun (w : List T) => w L

      Membership in any fixed deterministic context-free language is a computable predicate. This is a corollary of the effective encoded-grammar membership algorithm, via DCFCF.