Skip to content

Encodings of context-free grammars

TheoremRenaming the nonterminals of a symbol twice#✓fully proved

For maps \(f : N_1 \to N_2\) and \(b : N_2 \to N_3\) and a grammar symbol \(s\) with terminals in \(T\) and nonterminals in \(N_1\), renaming the nonterminals of \(s\) by \(f\) and then by \(b\) gives the same symbol as renaming them by \(b \circ f\).

@[simp]
theorem mapSymbol_mapSymbol {N₁ N₂ N₃ : Type*} (f : N₁ → N₂) (b : N₂ → N₃) (s : Symbol T N₁) :
    mapSymbol b (mapSymbol f s) = mapSymbol (b ∘ f) s
Uses 1

TheoremGrammars with renamings in both directions generate the same language#✓fully proved

Let \(g\) and \(G\) be context-free grammars over the same terminals. Suppose there are maps \(f\) from the nonterminals of \(g\) to those of \(G\) and \(b\) from the nonterminals of \(G\) to those of \(g\) such that renaming the nonterminals of any production of \(g\) by \(f\) gives a production of \(G\), renaming the nonterminals of any production of \(G\) by \(b\) gives a production of \(g\), \(f\) sends the start nonterminal of \(g\) to that of \(G\), and \(b\) sends the start nonterminal of \(G\) to that of \(g\). Then \(g\) and \(G\) generate the same language. The renamings need not be inverse to each other.

theorem language_eq_of_maps {g G : ContextFreeGrammar T} (f : g.NT → G.NT) (b : G.NT → g.NT)
    (hf : ∀ r ∈ g.rules, mapRule f r ∈ G.rules) (hb : ∀ r ∈ G.rules, mapRule b r ∈ g.rules)
    (hfi : f g.initial = G.initial) (hbi : b G.initial = g.initial) :
    G.language = g.language
Uses 4 · Used by 1

StructureEncoded context-free grammars#✓fully proved

An encoded context-free grammar over a terminal type \(T\) consists of a start nonterminal, which is a natural number, and a list of productions. Each production is a pair of a left-hand side, a natural number, and a right-hand side, a list of elements of the disjoint union \(\mathbb{N} \sqcup T\), in which a number \(i\) from the left summand stands for nonterminal \(i\) and an element \(a\) of \(T\) for terminal \(a\).

Unlike a general context-free grammar, whose type of nonterminals is part of its data, an encoded grammar is a concrete object that computable functions can take and return.

structure EncodedCFG (T : Type*) where
  /-- The start nonterminal. -/
  start : ℕ
  /-- The productions. -/
  rules : List (ℕ × List (ℕ ⊕ T))
Used by 127
Used byThe substitution grammar · Main production of the substitution grammar · Productions of the substitution grammar · Substituting the symbols of a grammar · Context-free languages are closed under substitution by context-free languages · Intended languages of the substitution grammar · Indexed CYK recognizer for encoded grammars · Correctness of indexed CYK on encoded grammars · Cubic cost bound for indexed CYK on encoded grammars · Removing empty productions from an encoded grammar · Computable removal of empty productions agrees with the classical one · Terminal-free productions yield only the empty word · The reduced grammar has no empty and no unit productions · Removing empty productions drops only the empty word · The reduced grammar generates the language minus the empty word · Productions of the computable removal of empty productions · Computed deletions agree with nullable deletions · The nullable nonterminals are computed · Productions of the encoded unit elimination · Unit reachability is computed · Productions without terminals of an encoded grammar · Nonterminals of an encoded grammar · Computed nullable nonterminals of an encoded grammar · Reduction is primitive recursive · Reduction of an encoded grammar · Unit elimination for encoded grammars · The encoded unit elimination denotes the unit-eliminated grammar · Nonterminals reachable by unit productions in an encoded grammar · One round of unit reachability · Yields of the empty word need only terminal-free productions · Yields in the terminal-free subgrammar are yields of the grammar · The grammar generates the language of the expression · Soundness of the grammar of a regular expression · The equivalence test is primitive recursive · Emptiness of regular expressions is decidable · Inclusion of a regular language in a DFA language is decidable · Membership for regular expressions is decidable · The grammar of an encoded regular expression · Completeness of the grammar of an encoded regular expression · Items found for a grammar and a DFA · Candidate items for a grammar and a DFA · Sound items for a grammar and a DFA · One round of the item search against a DFA · The intersection-emptiness test for a grammar and a DFA · Correctness of the intersection-emptiness test · Completeness of the start states in a DFA · The inclusion test for a grammar and a DFA · Correctness of the inclusion test · Emptiness of the intersection of a context-free and a regular language is decidable · Inclusion of a context-free language in a regular language is decidable · Emptiness of context-free grammars is computable · Soundness of the productive-nonterminal iteration · Context-free pumping down below twice the pumping bound · Items found by the membership procedure · The generating nonterminals are closed under one more round · Generating nonterminals · The infiniteness test · Correctness of the infiniteness test · Long words make a context-free language infinite · The emptiness test for context-free grammars · Correctness of the emptiness test · Candidate items for membership · Right-hand side length bound · The membership test for context-free grammars · Correctness of the membership test · Completeness of the start positions · One round of the membership procedure · Letters of generated words occur in the productions · Pumping bound of an encoded grammar · Pumping lemma for encoded grammars · Sound items · Completeness of the generating-nonterminal computation · The terminals of an encoded grammar · Emptiness of context-free grammars is decidable · Infiniteness of context-free languages is decidable · Membership for context-free grammars is decidable · Encoded grammars as pairs · A language is context-free exactly when an encoded grammar generates it · Language of an encoded grammar · Encoded grammars generate context-free languages · The encoding of a grammar generates the same language · Encoding of a context-free grammar · Grammar denoted by an encoding · The ambiguity grammar of a PCP instance · Leftmost derivations in the ambiguity grammar · The productions of \(A\) and \(B\) in the ambiguity grammar · The leftmost derivation along an index sequence · Leftmost derivations from the start symbol along an index sequence · PCP many-one reduces to ambiguity of context-free grammars · The ambiguity grammar is primitive recursive · The construction of derivations · The analysis of derivations · PCP many-one reduces to nonemptiness of the intersection of two context-free languages · The language of a side grammar · The side grammar of a PCP instance · Regularity of context-free languages is undecidable · Every production of the regularity grammar is sound for its intended languages · The language of the regularity grammar · Universality many-one reduces to regularity of context-free languages · Shifted right-hand sides denote images of words of \(g\) · Shifted right-hand sides generate the images of words · Productions of the regularity grammar preserve generated languages · Grammar of the reduction from universality to regularity · Languages assigned to the nonterminals of the regularity grammar · Shifted derivations in the regularity grammar · A grammar is universal iff its regularity grammar generates a regular language · Grammar of all words · Membership in the first grammar of a pair is computable · Whether two context-free languages are disjoint is undecidable · Whether a context-free grammar is ambiguous is undecidable · Equivalence of context-free grammars is undecidable · Inclusion of context-free languages is undecidable · Whether two context-free languages intersect is undecidable · Whether a context-free grammar generates every word is undecidable · Disjointness of context-free languages is not recognizable · Equivalence of context-free grammars is not recognizable · Inclusion of context-free languages is not recognizable · Universality of context-free grammars is not recognizable · Equivalence of context-free grammars is co-recognizable · Inclusion of context-free languages is co-recognizable · Universality of context-free grammars is co-recognizable · The overlap problem for context-free grammars is recognizable · The intended languages form a valuation of the universality grammar · The language of the universality grammar · The complement of PCP many-one reduces to universality of context-free grammars · Every mismatched word is derivable from the mismatch nonterminal · The universality grammar

DefinitionDecoding a grammar symbol#✓fully proved

Decoding sends an element of the disjoint union \(\mathbb{N} \sqcup T\) to a grammar symbol with terminals \(T\) and nonterminals \(\mathbb{N}\): a natural number \(i\) from the left summand goes to the nonterminal \(i\), and an element \(a\) of \(T\) from the right summand goes to the terminal \(a\).

def decodeSymbol : ℕ ⊕ T → Symbol T ℕ
  | .inl i => .nonterminal i
  | .inr a => .terminal a
Used by 39
Used byCharged rule decoding agrees with the decoded grammar · Exact cost of grammar rule decoding · Charged decoding of encoded grammar symbols · Charged symbol decoding agrees with canonical decoding · Exact cost of grammar symbol decoding · Terminal-free productions yield only the empty word · Productions of the computable removal of empty productions · Computed deletions agree with nullable deletions · Productions of the encoded unit elimination · Unit reachability is computed · Yields of the empty word need only terminal-free productions · Yields in the terminal-free subgrammar are yields of the grammar · A production of a node only produces words of its language · Completeness of the grammar of an encoded regular expression · Correctness of the intersection-emptiness test · Completeness of the start states in a DFA · Soundness of the productive-nonterminal iteration · Correctness of the membership test · Completeness of the start positions · Letters of generated words occur in the productions · Pumping lemma for encoded grammars · Completeness of the generating-nonterminal computation · Decoding a production · The encoding of a grammar generates the same language · Leftmost derivations from \(A\) and \(B\) follow an index sequence · The leftmost derivation along an index sequence · The construction of derivations · The analysis of derivations · Every production of the regularity grammar is sound for its intended languages · The language of the regularity grammar · Shifted right-hand sides denote images of words of \(g\) · Shifted right-hand sides generate the images of words · Equivalence of context-free grammars is undecidable · Inclusion of context-free languages is undecidable · Equivalence of context-free grammars is not recognizable · Inclusion of context-free languages is not recognizable · The intended languages form a valuation of the universality grammar · The language of the universality grammar · Every mismatched word is derivable from the mismatch nonterminal

DefinitionEncoding a grammar symbol#✓fully proved

Encoding sends a grammar symbol with terminals \(T\) and nonterminals \(\mathbb{N}\) to an element of the disjoint union \(\mathbb{N} \sqcup T\): the terminal \(a\) goes to \(a\) in the right summand \(T\), and the nonterminal \(i\) goes to \(i\) in the left summand \(\mathbb{N}\).

def encodeSymbol : Symbol T ℕ → ℕ ⊕ T
  | .terminal a => .inr a
  | .nonterminal i => .inl i
Used by 4

DefinitionDecoding a production#✓fully proved

Decoding a pair \((A, s)\) of a natural number \(A\) and a list \(s\) of elements of the disjoint union \(\mathbb{N} \sqcup T\) gives the production, with terminals \(T\) and nonterminals \(\mathbb{N}\), whose left-hand side is the nonterminal \(A\) and whose right-hand side is \(s\) with each entry decoded as a symbol: a number \(i\) from the left summand becomes the nonterminal \(i\) and an element \(a\) of \(T\) becomes the terminal \(a\).

def decodeRule (e : ℕ × List (ℕ ⊕ T)) : ContextFreeRule T ℕ :=
  ⟨e.1, e.2.map decodeSymbol⟩
Uses 1 · Used by 43
Used byContext-free languages are closed under substitution by context-free languages · Charged rule decoding agrees with the decoded grammar · Exact cost of grammar rule decoding · Correctness of indexed CYK on encoded grammars · Cubic cost bound for indexed CYK on encoded grammars · Computable removal of empty productions agrees with the classical one · Terminal-free productions yield only the empty word · Productions of the computable removal of empty productions · Productions of the encoded unit elimination · Unit reachability is computed · The encoded unit elimination denotes the unit-eliminated grammar · Yields of the empty word need only terminal-free productions · Yields in the terminal-free subgrammar are yields of the grammar · Soundness of the grammar of a regular expression · Completeness of the grammar of an encoded regular expression · Correctness of the intersection-emptiness test · Completeness of the start states in a DFA · Soundness of the productive-nonterminal iteration · Correctness of the membership test · Completeness of the start positions · Letters of generated words occur in the productions · Pumping lemma for encoded grammars · Completeness of the generating-nonterminal computation · The encoding of a grammar generates the same language · Grammar denoted by an encoding · The canonical rule sequence along an index sequence · Leftmost derivations in the ambiguity grammar · The productions of \(A\) and \(B\) in the ambiguity grammar · Leftmost derivations from \(A\) and \(B\) follow an index sequence · The leftmost derivation along an index sequence · Leftmost derivations from the start symbol along an index sequence · The construction of derivations · The analysis of derivations · Every production of the regularity grammar is sound for its intended languages · Productions of the regularity grammar preserve generated languages · Shifted derivations in the regularity grammar · Equivalence of context-free grammars is undecidable · Inclusion of context-free languages is undecidable · Equivalence of context-free grammars is not recognizable · Inclusion of context-free languages is not recognizable · The intended languages form a valuation of the universality grammar · The language of the universality grammar · Every mismatched word is derivable from the mismatch nonterminal

DefinitionEncoding a production#✓fully proved

Encoding a production with terminals \(T\) and nonterminals \(\mathbb{N}\) gives the pair \((A, s)\) where \(A \in \mathbb{N}\) is its left-hand side and \(s\) is its right-hand side with each symbol encoded as an element of the disjoint union \(\mathbb{N} \sqcup T\): the terminal \(a\) becomes \(a\) in the right summand and the nonterminal \(i\) becomes \(i\) in the left summand.

def encodeRule (r : ContextFreeRule T ℕ) : ℕ × List (ℕ ⊕ T) :=
  (r.input, r.output.map encodeSymbol)
Uses 1 · Used by 3
19 fully proved

Semantics

AbbreviationGrammar denoted by an encoding#✓fully proved

For an encoded context-free grammar \(g\) over \(T\), the context-free grammar over \(T\) whose nonterminals are the natural numbers, whose initial nonterminal is the start nonterminal of \(g\), and whose productions are the decodings of the encoded productions of \(g\): an encoded production \((i, u)\) becomes the production rewriting the nonterminal \(i\) to the word obtained from \(u\) by reading each entry \(\mathrm{inl}\, j\) as the nonterminal \(j\) and each entry \(\mathrm{inr}\, a\) as the terminal \(a\).

abbrev toCFG (g : EncodedCFG T) : ContextFreeGrammar T where
  NT := ℕ
  initial := g.start
  rules := (g.rules.map decodeRule).toFinset
Uses 2 · Used by 59
Used byProductions of the substitution grammar · Context-free languages are closed under substitution by context-free languages · Intended languages of the substitution grammar · Correctness of indexed CYK on encoded grammars · Computable removal of empty productions agrees with the classical one · Terminal-free productions yield only the empty word · The reduced grammar has no empty and no unit productions · Removing empty productions drops only the empty word · The reduced grammar generates the language minus the empty word · Productions of the computable removal of empty productions · Computed deletions agree with nullable deletions · The nullable nonterminals are computed · Productions of the encoded unit elimination · Unit reachability is computed · The encoded unit elimination denotes the unit-eliminated grammar · Yields of the empty word need only terminal-free productions · Yields in the terminal-free subgrammar are yields of the grammar · The grammar generates the language of the expression · Soundness of the grammar of a regular expression · Completeness of the grammar of an encoded regular expression · Sound items for a grammar and a DFA · Correctness of the intersection-emptiness test · Completeness of the start states in a DFA · Soundness of the productive-nonterminal iteration · Correctness of the emptiness test · Correctness of the membership test · Completeness of the start positions · Letters of generated words occur in the productions · Pumping lemma for encoded grammars · Sound items · Completeness of the generating-nonterminal computation · Language of an encoded grammar · Encoded grammars generate context-free languages · The encoding of a grammar generates the same language · Leftmost derivations in the ambiguity grammar · The productions of \(A\) and \(B\) in the ambiguity grammar · Leftmost derivations from \(A\) and \(B\) follow an index sequence · The ambiguity grammar of \(P\) is ambiguous exactly when \(P\) has a solution · The leftmost derivation along an index sequence · Leftmost derivations from the start symbol along an index sequence · PCP many-one reduces to ambiguity of context-free grammars · The construction of derivations · The analysis of derivations · The language of a side grammar · Every production of the regularity grammar is sound for its intended languages · The language of the regularity grammar · Shifted right-hand sides denote images of words of \(g\) · Shifted right-hand sides generate the images of words · Productions of the regularity grammar preserve generated languages · Languages assigned to the nonterminals of the regularity grammar · Shifted derivations in the regularity grammar · Whether a context-free grammar is ambiguous is undecidable · Equivalence of context-free grammars is undecidable · Inclusion of context-free languages is undecidable · Equivalence of context-free grammars is not recognizable · Inclusion of context-free languages is not recognizable · The intended languages form a valuation of the universality grammar · The language of the universality grammar · Every mismatched word is derivable from the mismatch nonterminal

DefinitionLanguage of an encoded grammar#✓fully proved

The language of an encoded context-free grammar \(g\) over \(T\) is the language generated by the context-free grammar that \(g\) denotes, whose nonterminals are the natural numbers, whose initial nonterminal is the start nonterminal of \(g\) and whose productions are the decoded productions of \(g\).

def language (g : EncodedCFG T) : Language T :=
  g.toCFG.language
Uses 2 · Used by 57
Used byContext-free languages are closed under substitution by context-free languages · Correctness of indexed CYK on encoded grammars · Removing empty productions drops only the empty word · The reduced grammar generates the language minus the empty word · The nullable nonterminals are computed · The equivalence test is correct · The grammar generates the language of the expression · Emptiness of regular expressions is decidable · Inclusion of a regular language in a DFA language is decidable · Membership for regular expressions is decidable · Correctness of the intersection-emptiness test · Correctness of the inclusion test · Emptiness of the intersection of a context-free and a regular language is decidable · Inclusion of a context-free language in a regular language is decidable · Emptiness of context-free grammars is computable · Context-free pumping down below twice the pumping bound · Correctness of the infiniteness test · Long words make a context-free language infinite · Correctness of the emptiness test · Correctness of the membership test · Letters of generated words occur in the productions · Pumping lemma for encoded grammars · Completeness of the generating-nonterminal computation · Emptiness of context-free grammars is decidable · Infiniteness of context-free languages is decidable · Membership for context-free grammars is decidable · A language is context-free exactly when an encoded grammar generates it · Encoded grammars generate context-free languages · The encoding of a grammar generates the same language · Correctness of the Boolean atom checker · The ambiguity grammar of \(P\) is ambiguous exactly when \(P\) has a solution · PCP many-one reduces to nonemptiness of the intersection of two context-free languages · The language of a side grammar · A PCP instance is solvable exactly when its top and bottom grammars share a word · Regularity of context-free languages is undecidable · Every production of the regularity grammar is sound for its intended languages · The language of the regularity grammar · Universality many-one reduces to regularity of context-free languages · Languages assigned to the nonterminals of the regularity grammar · A grammar is universal iff its regularity grammar generates a regular language · Membership in the first grammar of a pair is computable · Whether two context-free languages are disjoint is undecidable · Equivalence of context-free grammars is undecidable · Inclusion of context-free languages is undecidable · Whether two context-free languages intersect is undecidable · Whether a context-free grammar generates every word is undecidable · Disjointness of context-free languages is not recognizable · Equivalence of context-free grammars is not recognizable · Inclusion of context-free languages is not recognizable · Universality of context-free grammars is not recognizable · Equivalence of context-free grammars is co-recognizable · Inclusion of context-free languages is co-recognizable · Universality of context-free grammars is co-recognizable · The overlap problem for context-free grammars is recognizable · The universality grammar generates every word exactly when PCP has no solution · The language of the universality grammar · The complement of PCP many-one reduces to universality of context-free grammars

TheoremEncoded grammars generate context-free languages#✓fully proved

The language of an encoded grammar is context-free.

theorem language_isContextFree (g : EncodedCFG T) : g.language.IsContextFree
Uses 3 · Used by 1

Numbering

DefinitionNonterminal of a symbol#✓fully proved

The partial map from grammar symbols with terminals in \(T\) and nonterminals in \(N\) to \(N\) that sends a nonterminal \(A\) to \(A\) and has no value on terminals.

def ntOf {N : Type*} : Symbol T N → Option N
  | .terminal _ => none
  | .nonterminal A => some A
Used by 3

DefinitionList of nonterminals mentioned by a grammar#✓fully proved

For a context-free grammar \(G\), the list consisting of the initial nonterminal of \(G\) followed, for each production of \(G\) in turn (in some fixed order of its finite set of productions), by the left-hand side of the production and then the nonterminals of its right-hand side in order. Nonterminals may occur more than once.

noncomputable def usedNT (G : ContextFreeGrammar T) : List G.NT :=
  G.initial :: G.rules.toList.flatMap fun r => r.input :: r.output.filterMap ntOf
Uses 1 · Used by 4

DefinitionNumbering of nonterminals#✓fully proved

For a context-free grammar \(G\), the number of a nonterminal \(A\) of \(G\) is the position, counting from \(0\), of the first occurrence of \(A\) in the list of nonterminals that \(G\) mentions (its initial nonterminal first); if \(A\) does not occur in that list, its number is the length of the list.

noncomputable def ntIndex (G : ContextFreeGrammar T) (A : G.NT) : ℕ :=
  (usedNT G).idxOf A
Uses 1 · Used by 3

DefinitionNonterminal with a given number#✓fully proved

For a context-free grammar \(G\) and a natural number \(n\), the nonterminal of \(G\) with number \(n\) is the entry at position \(n\), counting from \(0\), of the list of nonterminals that \(G\) mentions (its initial nonterminal first); if the list has no entry at position \(n\), it is the initial nonterminal of \(G\).

noncomputable def ntOfIndex (G : ContextFreeGrammar T) (n : ℕ) : G.NT :=
  (usedNT G).getD n G.initial
Uses 1 · Used by 2

TheoremNumbering the nonterminals of a production and back recovers it#✓fully proved

Let \(G\) be a context-free grammar over \(T\) and \(r\) a production of \(G\). Replacing each nonterminal \(A\) of \(r\) by its number, the position, counting from \(0\), of the first occurrence of \(A\) in the list of nonterminals that \(G\) mentions, and then replacing each number \(n\) by the nonterminal of \(G\) with number \(n\) (the entry at position \(n\) of that list, or the initial nonterminal of \(G\) if the list has no such entry) gives \(r\) again.

theorem mapRule_ntOfIndex_ntIndex {G : ContextFreeGrammar T} {r : ContextFreeRule T G.NT}
    (hr : r ∈ G.rules) : mapRule (ntOfIndex G) (mapRule (ntIndex G) r) = r
Uses 6 · Used by 1

Encoding

DefinitionEncoding of a context-free grammar#✓fully proved

For a context-free grammar \(G\) over \(T\), the encoded grammar whose start nonterminal is the number of the initial nonterminal of \(G\) and whose productions are the productions of \(G\), listed in some fixed order, with every nonterminal \(A\) replaced by its number, the position, counting from \(0\), of the first occurrence of \(A\) in the list of nonterminals that \(G\) mentions (its initial nonterminal first).

noncomputable def ofCFG (G : ContextFreeGrammar T) : EncodedCFG T :=
  ⟨ntIndex G G.initial, G.rules.toList.map fun r => encodeRule (mapRule (ntIndex G) r)⟩
Uses 4 · Used by 2

TheoremThe encoding of a grammar generates the same language#✓fully proved

The encoding of a grammar generates the same language.

theorem language_ofCFG (G : ContextFreeGrammar T) : (ofCFG G).language = G.language
Uses 15 · Used by 1

TheoremA language is context-free exactly when an encoded grammar generates it#✓fully proved

A language is context-free exactly when an encoded grammar generates it.

theorem isContextFree_iff {L : Language T} :
    L.IsContextFree ↔ ∃ g : EncodedCFG T, g.language = L
Uses 5 · Used by 1

Encoding as pairs

DefinitionEncoded grammars as pairs#✓fully proved

Sending an encoded grammar over \(T\) to the pair of its start nonterminal and its list of productions is a bijection from encoded grammars over \(T\) onto pairs \((s, R)\) of a natural number \(s\) and a list \(R\) of pairs of a natural number and a list of elements of the disjoint union \(\mathbb{N} \sqcup T\).

def equivProd : EncodedCFG T ≃ ℕ × List (ℕ × List (ℕ ⊕ T)) where
  toFun g := (g.start, g.rules)
  invFun p := ⟨p.1, p.2⟩
  left_inv _ := rfl
  right_inv _ := rfl
Uses 1 · Used by 32
Used byReduction is primitive recursive · The equivalence test is primitive recursive · Emptiness of regular expressions is decidable · Inclusion of a regular language in a DFA language is decidable · Membership for regular expressions is decidable · Emptiness of the intersection of a context-free and a regular language is decidable · Inclusion of a context-free language in a regular language is decidable · Emptiness of context-free grammars is computable · Emptiness of context-free grammars is decidable · Infiniteness of context-free languages is decidable · Membership for context-free grammars is decidable · PCP many-one reduces to ambiguity of context-free grammars · The ambiguity grammar is primitive recursive · PCP many-one reduces to nonemptiness of the intersection of two context-free languages · Regularity of context-free languages is undecidable · Universality many-one reduces to regularity of context-free languages · Membership in the first grammar of a pair is computable · Whether two context-free languages are disjoint is undecidable · Whether a context-free grammar is ambiguous is undecidable · Equivalence of context-free grammars is undecidable · Inclusion of context-free languages is undecidable · Whether two context-free languages intersect is undecidable · Whether a context-free grammar generates every word is undecidable · Disjointness of context-free languages is not recognizable · Equivalence of context-free grammars is not recognizable · Inclusion of context-free languages is not recognizable · Universality of context-free grammars is not recognizable · Equivalence of context-free grammars is co-recognizable · Inclusion of context-free languages is co-recognizable · Universality of context-free grammars is co-recognizable · The overlap problem for context-free grammars is recognizable · The complement of PCP many-one reduces to universality of context-free grammars

The dependency explorer needs JavaScript and its graph data.

Download the complete graph data.