165
Relating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition urgen Koslowski Department of Theoretical Computer Science Technical University Braunschweig CT 2011, Vancouver, July 22 (last updated 2011-06-18) http://www.iti.cs.tu-bs.de/˜koslowj/RESEARCH urgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 1 / 25

Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Relating Chomsky Normal Form and Greibach NormalForm by Exponential Transposition

Jurgen Koslowski

Department of Theoretical Computer ScienceTechnical University Braunschweig

CT 2011, Vancouver, July 22(last updated 2011-06-18)

http://www.iti.cs.tu-bs.de/ koslowj/RESEARCH

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 1 / 25

Page 2: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Overview

Overview

. We will look at familiar concepts

− context-free grammars (CFG’s) initially,− push-down automata (PDA’s) later on

from a slightly different angle.

. This angle was initially suggested by work of Walters [1988], but canbe exploited further.

. At issue is the use of node-labeled trees in the theory of formallanguages.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 2 / 25

Page 3: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Overview

Overview

. We will look at familiar concepts

− context-free grammars (CFG’s) initially,− push-down automata (PDA’s) later on

from a slightly different angle.

. This angle was initially suggested by work of Walters [1988], but canbe exploited further.

. At issue is the use of node-labeled trees in the theory of formallanguages.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 2 / 25

Page 4: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Overview

Overview

. We will look at familiar concepts

− context-free grammars (CFG’s) initially,

− push-down automata (PDA’s) later on

from a slightly different angle.

. This angle was initially suggested by work of Walters [1988], but canbe exploited further.

. At issue is the use of node-labeled trees in the theory of formallanguages.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 2 / 25

Page 5: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Overview

Overview

. We will look at familiar concepts

− context-free grammars (CFG’s) initially,− push-down automata (PDA’s) later on

from a slightly different angle.

. This angle was initially suggested by work of Walters [1988], but canbe exploited further.

. At issue is the use of node-labeled trees in the theory of formallanguages.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 2 / 25

Page 6: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Overview

Overview

. We will look at familiar concepts

− context-free grammars (CFG’s) initially,− push-down automata (PDA’s) later on

from a slightly different angle.

. This angle was initially suggested by work of Walters [1988], but canbe exploited further.

. At issue is the use of node-labeled trees in the theory of formallanguages.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 2 / 25

Page 7: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Overview

Overview

. We will look at familiar concepts

− context-free grammars (CFG’s) initially,− push-down automata (PDA’s) later on

from a slightly different angle.

. This angle was initially suggested by work of Walters [1988], but canbe exploited further.

. At issue is the use of node-labeled trees in the theory of formallanguages.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 2 / 25

Page 8: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Overview

Overview

. We will look at familiar concepts

− context-free grammars (CFG’s) initially,− push-down automata (PDA’s) later on

from a slightly different angle.

. This angle was initially suggested by work of Walters [1988], but canbe exploited further.

. At issue is the use of node-labeled trees in the theory of formallanguages.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 2 / 25

Page 9: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

History: the man took the book

In his 1956 article “Three models for the description of language” (IRETransactions on Information Theory (2): 113–124) Noam Chomskypublished the first derivation tree as figure (22) with labeled nodes

Sentence

VP

NP

bookthe

Verb

took

NP

manthe

it shows the equivalence of two grammar-derivations displayed earlier (figure (21));

it conveys the same phrase structure of“the man took the book” as the initiallyemployed block diagram (figure (17)).

Other such trees are used later to show the existence of non-equivalentderivations for certain sentences. However, they are employed just to aidvisualization, not as an object of study in their own right.

Note the distinction between leaves and (capitalized) inner nodes.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 3 / 25

Page 10: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

History: the man took the book

In his 1956 article “Three models for the description of language” (IRETransactions on Information Theory (2): 113–124) Noam Chomskypublished the first derivation tree as figure (22) with labeled nodes

Sentence

VP

NP

bookthe

Verb

took

NP

manthe

it shows the equivalence of two grammar-derivations displayed earlier (figure (21));

it conveys the same phrase structure of“the man took the book” as the initiallyemployed block diagram (figure (17)).

Other such trees are used later to show the existence of non-equivalentderivations for certain sentences. However, they are employed just to aidvisualization, not as an object of study in their own right.

Note the distinction between leaves and (capitalized) inner nodes.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 3 / 25

Page 11: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

History: the man took the book

In his 1956 article “Three models for the description of language” (IRETransactions on Information Theory (2): 113–124) Noam Chomskypublished the first derivation tree as figure (22) with labeled nodes

Sentence

VP

NP

bookthe

Verb

took

NP

manthe

it shows the equivalence of two grammar-derivations displayed earlier (figure (21));

it conveys the same phrase structure of“the man took the book” as the initiallyemployed block diagram (figure (17)).

Other such trees are used later to show the existence of non-equivalentderivations for certain sentences. However, they are employed just to aidvisualization, not as an object of study in their own right.

Note the distinction between leaves and (capitalized) inner nodes.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 3 / 25

Page 12: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

History: the man took the book

In his 1956 article “Three models for the description of language” (IRETransactions on Information Theory (2): 113–124) Noam Chomskypublished the first derivation tree as figure (22) with labeled nodes

Sentence

VP

NP

bookthe

Verb

took

NP

manthe

it shows the equivalence of two grammar-derivations displayed earlier (figure (21));

it conveys the same phrase structure of“the man took the book” as the initiallyemployed block diagram (figure (17)).

Other such trees are used later to show the existence of non-equivalentderivations for certain sentences. However, they are employed just to aidvisualization, not as an object of study in their own right.

Note the distinction between leaves and (capitalized) inner nodes.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 3 / 25

Page 13: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

History: the man took the book

In his 1956 article “Three models for the description of language” (IRETransactions on Information Theory (2): 113–124) Noam Chomskypublished the first derivation tree as figure (22) with labeled nodes

Sentence

VP

NP

bookthe

Verb

took

NP

manthe

it shows the equivalence of two grammar-derivations displayed earlier (figure (21));

it conveys the same phrase structure of“the man took the book” as the initiallyemployed block diagram (figure (17)).

Other such trees are used later to show the existence of non-equivalentderivations for certain sentences. However, they are employed just to aidvisualization, not as an object of study in their own right.

Note the distinction between leaves and (capitalized) inner nodes.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 3 / 25

Page 14: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

History: the man took the book

In his 1956 article “Three models for the description of language” (IRETransactions on Information Theory (2): 113–124) Noam Chomskypublished the first derivation tree as figure (22) with labeled nodes

Sentence

VP

NP

bookthe

Verb

took

NP

manthe

it shows the equivalence of two grammar-derivations displayed earlier (figure (21));

it conveys the same phrase structure of“the man took the book” as the initiallyemployed block diagram (figure (17)).

Other such trees are used later to show the existence of non-equivalentderivations for certain sentences.

However, they are employed just to aidvisualization, not as an object of study in their own right.

Note the distinction between leaves and (capitalized) inner nodes.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 3 / 25

Page 15: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

History: the man took the book

In his 1956 article “Three models for the description of language” (IRETransactions on Information Theory (2): 113–124) Noam Chomskypublished the first derivation tree as figure (22) with labeled nodes

Sentence

VP

NP

bookthe

Verb

took

NP

manthe

it shows the equivalence of two grammar-derivations displayed earlier (figure (21));

it conveys the same phrase structure of“the man took the book” as the initiallyemployed block diagram (figure (17)).

Other such trees are used later to show the existence of non-equivalentderivations for certain sentences. However, they are employed just to aidvisualization, not as an object of study in their own right.

Note the distinction between leaves and (capitalized) inner nodes.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 3 / 25

Page 16: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

History: the man took the book

In his 1956 article “Three models for the description of language” (IRETransactions on Information Theory (2): 113–124) Noam Chomskypublished the first derivation tree as figure (22) with labeled nodes

Sentence

VP

NP

bookthe

Verb

took

NP

manthe

it shows the equivalence of two grammar-derivations displayed earlier (figure (21));

it conveys the same phrase structure of“the man took the book” as the initiallyemployed block diagram (figure (17)).

Other such trees are used later to show the existence of non-equivalentderivations for certain sentences. However, they are employed just to aidvisualization, not as an object of study in their own right.

Note the distinction between leaves and (capitalized) inner nodes.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 3 / 25

Page 17: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

On the finite vocabulary (= alphabet) VP of his phrase-structuregrammar (= semi-Thue rewriting system F + axioms), Chomsky remarks

In every interesting case there will be a terminal vocabulary VT ( VT ⊆ VP ) that

exactly characterizes the terminal strings, in the sense that every terminal string

is a string in VT and no symbol of VT is rewritten in any of the rules of F .

Chomsky’s work inspired John Backus of the Algol 58 project in 1959 todevelop most of the prevailing BNF-type presentation of CFG’s:

the alphabet is partitioned into “terminals” and “nonterminals”;

one nonterminal serves as axiom (rather than a finite set of words).

This was fine-tuned by Peter Naur for the Revised Report on ALGOL 60,who also coined the name “Backus Normal Form”. In 1964 Donald Knuthobserved that this was not a normal form in any sense and suggested theterm “Backus-Naur Form”, saving the acronym.

Node-labeled trees in the 1960’s also formed the basis for the new field oftree grammars/automata/languages, see Thatcher’s survey of 1973.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 4 / 25

Page 18: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

On the finite vocabulary (= alphabet) VP of his phrase-structuregrammar (= semi-Thue rewriting system F + axioms), Chomsky remarks

In every interesting case there will be a terminal vocabulary VT ( VT ⊆ VP ) that

exactly characterizes the terminal strings, in the sense that every terminal string

is a string in VT and no symbol of VT is rewritten in any of the rules of F .

Chomsky’s work inspired John Backus of the Algol 58 project in 1959 todevelop most of the prevailing BNF-type presentation of CFG’s:

the alphabet is partitioned into “terminals” and “nonterminals”;

one nonterminal serves as axiom (rather than a finite set of words).

This was fine-tuned by Peter Naur for the Revised Report on ALGOL 60,who also coined the name “Backus Normal Form”. In 1964 Donald Knuthobserved that this was not a normal form in any sense and suggested theterm “Backus-Naur Form”, saving the acronym.

Node-labeled trees in the 1960’s also formed the basis for the new field oftree grammars/automata/languages, see Thatcher’s survey of 1973.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 4 / 25

Page 19: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

On the finite vocabulary (= alphabet) VP of his phrase-structuregrammar (= semi-Thue rewriting system F + axioms), Chomsky remarks

In every interesting case there will be a terminal vocabulary VT ( VT ⊆ VP ) that

exactly characterizes the terminal strings, in the sense that every terminal string

is a string in VT and no symbol of VT is rewritten in any of the rules of F .

Chomsky’s work inspired John Backus of the Algol 58 project in 1959 todevelop most of the prevailing BNF-type presentation of CFG’s:

the alphabet is partitioned into “terminals” and “nonterminals”;

one nonterminal serves as axiom (rather than a finite set of words).

This was fine-tuned by Peter Naur for the Revised Report on ALGOL 60,who also coined the name “Backus Normal Form”. In 1964 Donald Knuthobserved that this was not a normal form in any sense and suggested theterm “Backus-Naur Form”, saving the acronym.

Node-labeled trees in the 1960’s also formed the basis for the new field oftree grammars/automata/languages, see Thatcher’s survey of 1973.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 4 / 25

Page 20: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

On the finite vocabulary (= alphabet) VP of his phrase-structuregrammar (= semi-Thue rewriting system F + axioms), Chomsky remarks

In every interesting case there will be a terminal vocabulary VT ( VT ⊆ VP ) that

exactly characterizes the terminal strings, in the sense that every terminal string

is a string in VT and no symbol of VT is rewritten in any of the rules of F .

Chomsky’s work inspired John Backus of the Algol 58 project in 1959 todevelop most of the prevailing BNF-type presentation of CFG’s:

the alphabet is partitioned into “terminals” and “nonterminals”;

one nonterminal serves as axiom (rather than a finite set of words).

This was fine-tuned by Peter Naur for the Revised Report on ALGOL 60,who also coined the name “Backus Normal Form”. In 1964 Donald Knuthobserved that this was not a normal form in any sense and suggested theterm “Backus-Naur Form”, saving the acronym.

Node-labeled trees in the 1960’s also formed the basis for the new field oftree grammars/automata/languages, see Thatcher’s survey of 1973.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 4 / 25

Page 21: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

On the finite vocabulary (= alphabet) VP of his phrase-structuregrammar (= semi-Thue rewriting system F + axioms), Chomsky remarks

In every interesting case there will be a terminal vocabulary VT ( VT ⊆ VP ) that

exactly characterizes the terminal strings, in the sense that every terminal string

is a string in VT and no symbol of VT is rewritten in any of the rules of F .

Chomsky’s work inspired John Backus of the Algol 58 project in 1959 todevelop most of the prevailing BNF-type presentation of CFG’s:

the alphabet is partitioned into “terminals” and “nonterminals”;

one nonterminal serves as axiom (rather than a finite set of words).

This was fine-tuned by Peter Naur for the Revised Report on ALGOL 60,who also coined the name “Backus Normal Form”. In 1964 Donald Knuthobserved that this was not a normal form in any sense and suggested theterm “Backus-Naur Form”, saving the acronym.

Node-labeled trees in the 1960’s also formed the basis for the new field oftree grammars/automata/languages, see Thatcher’s survey of 1973.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 4 / 25

Page 22: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

On the finite vocabulary (= alphabet) VP of his phrase-structuregrammar (= semi-Thue rewriting system F + axioms), Chomsky remarks

In every interesting case there will be a terminal vocabulary VT ( VT ⊆ VP ) that

exactly characterizes the terminal strings, in the sense that every terminal string

is a string in VT and no symbol of VT is rewritten in any of the rules of F .

Chomsky’s work inspired John Backus of the Algol 58 project in 1959 todevelop most of the prevailing BNF-type presentation of CFG’s:

the alphabet is partitioned into “terminals” and “nonterminals”;

one nonterminal serves as axiom (rather than a finite set of words).

This was fine-tuned by Peter Naur for the Revised Report on ALGOL 60,who also coined the name “Backus Normal Form”.

In 1964 Donald Knuthobserved that this was not a normal form in any sense and suggested theterm “Backus-Naur Form”, saving the acronym.

Node-labeled trees in the 1960’s also formed the basis for the new field oftree grammars/automata/languages, see Thatcher’s survey of 1973.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 4 / 25

Page 23: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

On the finite vocabulary (= alphabet) VP of his phrase-structuregrammar (= semi-Thue rewriting system F + axioms), Chomsky remarks

In every interesting case there will be a terminal vocabulary VT ( VT ⊆ VP ) that

exactly characterizes the terminal strings, in the sense that every terminal string

is a string in VT and no symbol of VT is rewritten in any of the rules of F .

Chomsky’s work inspired John Backus of the Algol 58 project in 1959 todevelop most of the prevailing BNF-type presentation of CFG’s:

the alphabet is partitioned into “terminals” and “nonterminals”;

one nonterminal serves as axiom (rather than a finite set of words).

This was fine-tuned by Peter Naur for the Revised Report on ALGOL 60,who also coined the name “Backus Normal Form”. In 1964 Donald Knuthobserved that this was not a normal form in any sense and suggested theterm “Backus-Naur Form”, saving the acronym.

Node-labeled trees in the 1960’s also formed the basis for the new field oftree grammars/automata/languages, see Thatcher’s survey of 1973.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 4 / 25

Page 24: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

History: the man took the book

On the finite vocabulary (= alphabet) VP of his phrase-structuregrammar (= semi-Thue rewriting system F + axioms), Chomsky remarks

In every interesting case there will be a terminal vocabulary VT ( VT ⊆ VP ) that

exactly characterizes the terminal strings, in the sense that every terminal string

is a string in VT and no symbol of VT is rewritten in any of the rules of F .

Chomsky’s work inspired John Backus of the Algol 58 project in 1959 todevelop most of the prevailing BNF-type presentation of CFG’s:

the alphabet is partitioned into “terminals” and “nonterminals”;

one nonterminal serves as axiom (rather than a finite set of words).

This was fine-tuned by Peter Naur for the Revised Report on ALGOL 60,who also coined the name “Backus Normal Form”. In 1964 Donald Knuthobserved that this was not a normal form in any sense and suggested theterm “Backus-Naur Form”, saving the acronym.

Node-labeled trees in the 1960’s also formed the basis for the new field oftree grammars/automata/languages, see Thatcher’s survey of 1973.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 4 / 25

Page 25: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Background on grammars and normal forms

Definition

A context-free grammar G = 〈N,T, S , 〉 consists of disjoint finite setsN of nonterminals and T of terminals, an axiom S ∈ N , and a finiterelation N (T + N)∗ of so-called productions.

G is said to be in

. weak Chomsky normal form (wCNF), if N (T + N∗);

. Chomsky normal form (CNF), if N(T + N2

)+ {ε};

. Greibach normal form (GNF), if N (T ×N∗) + {ε};

with the technical provision for CNF and GNF that Y ε implies Y = S ,and in this case S must not appear on the right side of other productions.

The derivation relation (N + T)∗ (N + T)∗ consists of all pairs〈αY β, αωβ〉 with Y ω and α, β ∈ (N + T)∗ .

The words w ∈ T∗ with S ∗ w constitute the language generated by G ,where ∗ is the reflexive transitive hull of .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 5 / 25

Page 26: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Background on grammars and normal forms

Definition

A context-free grammar G = 〈N,T, S , 〉 consists of disjoint finite setsN of nonterminals and T of terminals, an axiom S ∈ N , and a finiterelation N (T + N)∗ of so-called productions. G is said to be in

. weak Chomsky normal form (wCNF), if N (T + N∗);

. Chomsky normal form (CNF), if N(T + N2

)+ {ε};

. Greibach normal form (GNF), if N (T ×N∗) + {ε};with the technical provision for CNF and GNF that Y ε implies Y = S ,and in this case S must not appear on the right side of other productions.

The derivation relation (N + T)∗ (N + T)∗ consists of all pairs〈αY β, αωβ〉 with Y ω and α, β ∈ (N + T)∗ .

The words w ∈ T∗ with S ∗ w constitute the language generated by G ,where ∗ is the reflexive transitive hull of .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 5 / 25

Page 27: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Background on grammars and normal forms

Definition

A context-free grammar G = 〈N,T, S , 〉 consists of disjoint finite setsN of nonterminals and T of terminals, an axiom S ∈ N , and a finiterelation N (T + N)∗ of so-called productions. G is said to be in

. weak Chomsky normal form (wCNF), if N (T + N∗);

. Chomsky normal form (CNF), if N(T + N2

)+ {ε};

. Greibach normal form (GNF), if N (T ×N∗) + {ε};with the technical provision for CNF and GNF that Y ε implies Y = S ,and in this case S must not appear on the right side of other productions.

The derivation relation (N + T)∗ (N + T)∗ consists of all pairs〈αY β, αωβ〉 with Y ω and α, β ∈ (N + T)∗ .

The words w ∈ T∗ with S ∗ w constitute the language generated by G ,where ∗ is the reflexive transitive hull of .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 5 / 25

Page 28: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Background on grammars and normal forms

Definition

A context-free grammar G = 〈N,T, S , 〉 consists of disjoint finite setsN of nonterminals and T of terminals, an axiom S ∈ N , and a finiterelation N (T + N)∗ of so-called productions. G is said to be in

. weak Chomsky normal form (wCNF), if N (T + N∗);

. Chomsky normal form (CNF), if N(T + N2

)+ {ε};

. Greibach normal form (GNF), if N (T ×N∗) + {ε};with the technical provision for CNF and GNF that Y ε implies Y = S ,and in this case S must not appear on the right side of other productions.

The derivation relation (N + T)∗ (N + T)∗ consists of all pairs〈αY β, αωβ〉 with Y ω and α, β ∈ (N + T)∗ .

The words w ∈ T∗ with S ∗ w constitute the language generated by G ,where ∗ is the reflexive transitive hull of .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 5 / 25

Page 29: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Background on grammars and normal forms

Definition

A context-free grammar G = 〈N,T, S , 〉 consists of disjoint finite setsN of nonterminals and T of terminals, an axiom S ∈ N , and a finiterelation N (T + N)∗ of so-called productions. G is said to be in

. weak Chomsky normal form (wCNF), if N (T + N∗);

. Chomsky normal form (CNF), if N(T + N2

)+ {ε};

. Greibach normal form (GNF), if N (T ×N∗) + {ε};

with the technical provision for CNF and GNF that Y ε implies Y = S ,and in this case S must not appear on the right side of other productions.

The derivation relation (N + T)∗ (N + T)∗ consists of all pairs〈αY β, αωβ〉 with Y ω and α, β ∈ (N + T)∗ .

The words w ∈ T∗ with S ∗ w constitute the language generated by G ,where ∗ is the reflexive transitive hull of .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 5 / 25

Page 30: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Background on grammars and normal forms

Definition

A context-free grammar G = 〈N,T, S , 〉 consists of disjoint finite setsN of nonterminals and T of terminals, an axiom S ∈ N , and a finiterelation N (T + N)∗ of so-called productions. G is said to be in

. weak Chomsky normal form (wCNF), if N (T + N∗);

. Chomsky normal form (CNF), if N(T + N2

)+ {ε};

. Greibach normal form (GNF), if N (T ×N∗) + {ε};with the technical provision for CNF and GNF that Y ε implies Y = S ,and in this case S must not appear on the right side of other productions.

The derivation relation (N + T)∗ (N + T)∗ consists of all pairs〈αY β, αωβ〉 with Y ω and α, β ∈ (N + T)∗ .

The words w ∈ T∗ with S ∗ w constitute the language generated by G ,where ∗ is the reflexive transitive hull of .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 5 / 25

Page 31: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Background on grammars and normal forms

Definition

A context-free grammar G = 〈N,T, S , 〉 consists of disjoint finite setsN of nonterminals and T of terminals, an axiom S ∈ N , and a finiterelation N (T + N)∗ of so-called productions. G is said to be in

. weak Chomsky normal form (wCNF), if N (T + N∗);

. Chomsky normal form (CNF), if N(T + N2

)+ {ε};

. Greibach normal form (GNF), if N (T ×N∗) + {ε};with the technical provision for CNF and GNF that Y ε implies Y = S ,and in this case S must not appear on the right side of other productions.

The derivation relation (N + T)∗ (N + T)∗ consists of all pairs〈αY β, αωβ〉 with Y ω and α, β ∈ (N + T)∗ .

The words w ∈ T∗ with S ∗ w constitute the language generated by G ,where ∗ is the reflexive transitive hull of .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 5 / 25

Page 32: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Background on grammars and normal forms

Definition

A context-free grammar G = 〈N,T, S , 〉 consists of disjoint finite setsN of nonterminals and T of terminals, an axiom S ∈ N , and a finiterelation N (T + N)∗ of so-called productions. G is said to be in

. weak Chomsky normal form (wCNF), if N (T + N∗);

. Chomsky normal form (CNF), if N(T + N2

)+ {ε};

. Greibach normal form (GNF), if N (T ×N∗) + {ε};with the technical provision for CNF and GNF that Y ε implies Y = S ,and in this case S must not appear on the right side of other productions.

The derivation relation (N + T)∗ (N + T)∗ consists of all pairs〈αY β, αωβ〉 with Y ω and α, β ∈ (N + T)∗ .

The words w ∈ T∗ with S ∗ w constitute the language generated by G ,where ∗ is the reflexive transitive hull of .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 5 / 25

Page 33: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Traditional tree descriptions of normal-form productions:

Y

X n−1. . .X 1X 0

resp.Y

a

(weak Chomsky)

Y

X 1X 0

resp.S

ε

resp.Y

a

(Chomsky)

Y

X n−1. . .X 1X 0a

resp.S

ε

(Greibach)

Strictly speaking, the tree for S ε is not correct; it should be just a leafwith nonterminal S . However, this is hard to distinguish from cases,where the derivation is not yet finished.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 6 / 25

Page 34: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Traditional tree descriptions of normal-form productions:

Y

X n−1. . .X 1X 0

resp.Y

a

(weak Chomsky)

Y

X 1X 0

resp.S

ε

resp.Y

a

(Chomsky)

Y

X n−1. . .X 1X 0a

resp.S

ε

(Greibach)

Strictly speaking, the tree for S ε is not correct; it should be just a leafwith nonterminal S . However, this is hard to distinguish from cases,where the derivation is not yet finished.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 6 / 25

Page 35: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Traditional tree descriptions of normal-form productions:

Y

X n−1. . .X 1X 0

resp.Y

a

(weak Chomsky)

Y

X 1X 0

resp.S

ε

resp.Y

a

(Chomsky)

Y

X n−1. . .X 1X 0a

resp.S

ε

(Greibach)

Strictly speaking, the tree for S ε is not correct; it should be just a leafwith nonterminal S . However, this is hard to distinguish from cases,where the derivation is not yet finished.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 6 / 25

Page 36: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Grammars and normal forms

Traditional tree descriptions of normal-form productions:

Y

X n−1. . .X 1X 0

resp.Y

a

(weak Chomsky)

Y

X 1X 0

resp.S

ε

resp.Y

a

(Chomsky)

Y

X n−1. . .X 1X 0a

resp.S

ε

(Greibach)

Strictly speaking, the tree for S ε is not correct; it should be just a leafwith nonterminal S . However, this is hard to distinguish from cases,where the derivation is not yet finished.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 6 / 25

Page 37: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid?

No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 38: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No!

First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 39: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 40: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 41: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows.

If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 42: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 43: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 44: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 45: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 46: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Alternatives?

Is it really necessary to lump terminals and nonterminals together into theset V := T + N on which to form the free monoid? No! First recall

Definition (Multigraphs)

Let D be the free category on the graph with object set N + {∗} withn + 1 arrows di , i < n , and c from n to ∗ , n ∈ N . The category ofmultigraphs now is the functor-category mgph := [Dop, set ] .

For Dop G set call the elements of G∗ and of Gn , n ∈ N , objects,resp., multiarrows. If f ∈ Gn satisfies fdi = Xi , i < n , and fc = Y ,besides the notation Y ϕ X0X1 . . .Xn−1 we also use the circuit diagram

ϕ

Y

X0 X1 . . . Xn−1

Nodes correspond multiarrows;

“wires” correspond to objects;

the direction is from top to bottom.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 7 / 25

Page 47: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Definition (Bob Walters, 1988)

For a set T consider the multigraph T〈0〉 with one object M , defaultmultiarrows M µn Mn, n ∈ N , and multiarrows M a M0, a ∈ T .

A CFG a la Walters over T is a faithful multigraph morphism G γT〈0〉

with G finite, together with a distinguished object G -object S .

Comparison with a traditional CFG in wCNF shows that

objects of G correspond to nonterminals;

the 0-ary multiarrows M a M0 correspond to terminals, whileM µ0 M0 corresponds to the empty word ε ;

the γ -assignments of T〈0〉 -multiarrows to G -multiarrowscorrespond to productions.

Faithfulness prevents multiple copies of productions from occurring.

To describe the language generated by γ as directly as possible, we take adifferent approach from that of Walters.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 8 / 25

Page 48: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Definition (Bob Walters, 1988)

For a set T consider the multigraph T〈0〉 with one object M , defaultmultiarrows M µn Mn, n ∈ N , and multiarrows M a M0, a ∈ T .

A CFG a la Walters over T is a faithful multigraph morphism G γT〈0〉

with G finite,

together with a distinguished object G -object S .

Comparison with a traditional CFG in wCNF shows that

objects of G correspond to nonterminals;

the 0-ary multiarrows M a M0 correspond to terminals, whileM µ0 M0 corresponds to the empty word ε ;

the γ -assignments of T〈0〉 -multiarrows to G -multiarrowscorrespond to productions.

Faithfulness prevents multiple copies of productions from occurring.

To describe the language generated by γ as directly as possible, we take adifferent approach from that of Walters.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 8 / 25

Page 49: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Definition (Bob Walters, 1988)

For a set T consider the multigraph T〈0〉 with one object M , defaultmultiarrows M µn Mn, n ∈ N , and multiarrows M a M0, a ∈ T .

A CFG a la Walters over T is a faithful multigraph morphism G γT〈0〉

with G finite, together with a distinguished object G -object S .

Comparison with a traditional CFG in wCNF shows that

objects of G correspond to nonterminals;

the 0-ary multiarrows M a M0 correspond to terminals, whileM µ0 M0 corresponds to the empty word ε ;

the γ -assignments of T〈0〉 -multiarrows to G -multiarrowscorrespond to productions.

Faithfulness prevents multiple copies of productions from occurring.

To describe the language generated by γ as directly as possible, we take adifferent approach from that of Walters.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 8 / 25

Page 50: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Definition (Bob Walters, 1988)

For a set T consider the multigraph T〈0〉 with one object M , defaultmultiarrows M µn Mn, n ∈ N , and multiarrows M a M0, a ∈ T .

A CFG a la Walters over T is a faithful multigraph morphism G γT〈0〉

with G finite, together with a distinguished object G -object S .

Comparison with a traditional CFG in wCNF shows that

objects of G correspond to nonterminals;

the 0-ary multiarrows M a M0 correspond to terminals, whileM µ0 M0 corresponds to the empty word ε ;

the γ -assignments of T〈0〉 -multiarrows to G -multiarrowscorrespond to productions.

Faithfulness prevents multiple copies of productions from occurring.

To describe the language generated by γ as directly as possible, we take adifferent approach from that of Walters.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 8 / 25

Page 51: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Definition (Bob Walters, 1988)

For a set T consider the multigraph T〈0〉 with one object M , defaultmultiarrows M µn Mn, n ∈ N , and multiarrows M a M0, a ∈ T .

A CFG a la Walters over T is a faithful multigraph morphism G γT〈0〉

with G finite, together with a distinguished object G -object S .

Comparison with a traditional CFG in wCNF shows that

objects of G correspond to nonterminals;

the 0-ary multiarrows M a M0 correspond to terminals, whileM µ0 M0 corresponds to the empty word ε ;

the γ -assignments of T〈0〉 -multiarrows to G -multiarrowscorrespond to productions.

Faithfulness prevents multiple copies of productions from occurring.

To describe the language generated by γ as directly as possible, we take adifferent approach from that of Walters.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 8 / 25

Page 52: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Definition (Bob Walters, 1988)

For a set T consider the multigraph T〈0〉 with one object M , defaultmultiarrows M µn Mn, n ∈ N , and multiarrows M a M0, a ∈ T .

A CFG a la Walters over T is a faithful multigraph morphism G γT〈0〉

with G finite, together with a distinguished object G -object S .

Comparison with a traditional CFG in wCNF shows that

objects of G correspond to nonterminals;

the 0-ary multiarrows M a M0 correspond to terminals, whileM µ0 M0 corresponds to the empty word ε ;

the γ -assignments of T〈0〉 -multiarrows to G -multiarrowscorrespond to productions.

Faithfulness prevents multiple copies of productions from occurring.

To describe the language generated by γ as directly as possible, we take adifferent approach from that of Walters.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 8 / 25

Page 53: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Definition (Bob Walters, 1988)

For a set T consider the multigraph T〈0〉 with one object M , defaultmultiarrows M µn Mn, n ∈ N , and multiarrows M a M0, a ∈ T .

A CFG a la Walters over T is a faithful multigraph morphism G γT〈0〉

with G finite, together with a distinguished object G -object S .

Comparison with a traditional CFG in wCNF shows that

objects of G correspond to nonterminals;

the 0-ary multiarrows M a M0 correspond to terminals, whileM µ0 M0 corresponds to the empty word ε ;

the γ -assignments of T〈0〉 -multiarrows to G -multiarrowscorrespond to productions.

Faithfulness prevents multiple copies of productions from occurring.

To describe the language generated by γ as directly as possible, we take adifferent approach from that of Walters.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 8 / 25

Page 54: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Alternatives?

Definition (Bob Walters, 1988)

For a set T consider the multigraph T〈0〉 with one object M , defaultmultiarrows M µn Mn, n ∈ N , and multiarrows M a M0, a ∈ T .

A CFG a la Walters over T is a faithful multigraph morphism G γT〈0〉

with G finite, together with a distinguished object G -object S .

Comparison with a traditional CFG in wCNF shows that

objects of G correspond to nonterminals;

the 0-ary multiarrows M a M0 correspond to terminals, whileM µ0 M0 corresponds to the empty word ε ;

the γ -assignments of T〈0〉 -multiarrows to G -multiarrowscorrespond to productions.

Faithfulness prevents multiple copies of productions from occurring.

To describe the language generated by γ as directly as possible, we take adifferent approach from that of Walters.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 8 / 25

Page 55: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation The generated language

The generated language

. Freely extend γ to a multifunctor G∗ γ∗T∗〈0〉 (in analogy to

forming the free category over a graph).

. The γ∗ - image of the hom-set 〈S , ε〉G∗ in 〈M,M0〉T∗〈0〉 consists ofcertain tree-like composite diagrams with some leaves in T .

. The yields of these diagrams, i.e., the words formed by their leaves,constitute the language generated by γ .

We would like to identify words generated in this fashion with theirdiagrams. Hence we consider T〈0〉 as a “reflexive multigraph1” with thedefault multiarrows being distinguished.

The intention is to have the default multiarrows obey certain identificationsin the free multicategory T∗〈0〉 ; hence its construction needs to be revised:

1not to be confused with the graph-theoretic notion of this nameJurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 9 / 25

Page 56: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation The generated language

The generated language

. Freely extend γ to a multifunctor G∗ γ∗T∗〈0〉 (in analogy to

forming the free category over a graph).

. The γ∗ - image of the hom-set 〈S , ε〉G∗ in 〈M,M0〉T∗〈0〉 consists ofcertain tree-like composite diagrams with some leaves in T .

. The yields of these diagrams, i.e., the words formed by their leaves,constitute the language generated by γ .

We would like to identify words generated in this fashion with theirdiagrams. Hence we consider T〈0〉 as a “reflexive multigraph1” with thedefault multiarrows being distinguished.

The intention is to have the default multiarrows obey certain identificationsin the free multicategory T∗〈0〉 ; hence its construction needs to be revised:

1not to be confused with the graph-theoretic notion of this nameJurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 9 / 25

Page 57: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation The generated language

The generated language

. Freely extend γ to a multifunctor G∗ γ∗T∗〈0〉 (in analogy to

forming the free category over a graph).

. The γ∗ - image of the hom-set 〈S , ε〉G∗ in 〈M,M0〉T∗〈0〉 consists ofcertain tree-like composite diagrams with some leaves in T .

. The yields of these diagrams, i.e., the words formed by their leaves,constitute the language generated by γ .

We would like to identify words generated in this fashion with theirdiagrams. Hence we consider T〈0〉 as a “reflexive multigraph1” with thedefault multiarrows being distinguished.

The intention is to have the default multiarrows obey certain identificationsin the free multicategory T∗〈0〉 ; hence its construction needs to be revised:

1not to be confused with the graph-theoretic notion of this nameJurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 9 / 25

Page 58: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation The generated language

The generated language

. Freely extend γ to a multifunctor G∗ γ∗T∗〈0〉 (in analogy to

forming the free category over a graph).

. The γ∗ - image of the hom-set 〈S , ε〉G∗ in 〈M,M0〉T∗〈0〉 consists ofcertain tree-like composite diagrams with some leaves in T .

. The yields of these diagrams, i.e., the words formed by their leaves,constitute the language generated by γ .

We would like to identify words generated in this fashion with theirdiagrams. Hence we consider T〈0〉 as a “reflexive multigraph1” with thedefault multiarrows being distinguished.

The intention is to have the default multiarrows obey certain identificationsin the free multicategory T∗〈0〉 ; hence its construction needs to be revised:

1not to be confused with the graph-theoretic notion of this nameJurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 9 / 25

Page 59: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation The generated language

The generated language

. Freely extend γ to a multifunctor G∗ γ∗T∗〈0〉 (in analogy to

forming the free category over a graph).

. The γ∗ - image of the hom-set 〈S , ε〉G∗ in 〈M,M0〉T∗〈0〉 consists ofcertain tree-like composite diagrams with some leaves in T .

. The yields of these diagrams, i.e., the words formed by their leaves,constitute the language generated by γ .

We would like to identify words generated in this fashion with theirdiagrams.

Hence we consider T〈0〉 as a “reflexive multigraph1” with thedefault multiarrows being distinguished.

The intention is to have the default multiarrows obey certain identificationsin the free multicategory T∗〈0〉 ; hence its construction needs to be revised:

1not to be confused with the graph-theoretic notion of this nameJurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 9 / 25

Page 60: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation The generated language

The generated language

. Freely extend γ to a multifunctor G∗ γ∗T∗〈0〉 (in analogy to

forming the free category over a graph).

. The γ∗ - image of the hom-set 〈S , ε〉G∗ in 〈M,M0〉T∗〈0〉 consists ofcertain tree-like composite diagrams with some leaves in T .

. The yields of these diagrams, i.e., the words formed by their leaves,constitute the language generated by γ .

We would like to identify words generated in this fashion with theirdiagrams. Hence we consider T〈0〉 as a “reflexive multigraph1” with thedefault multiarrows being distinguished.

The intention is to have the default multiarrows obey certain identificationsin the free multicategory T∗〈0〉 ; hence its construction needs to be revised:

1not to be confused with the graph-theoretic notion of this nameJurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 9 / 25

Page 61: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation The generated language

The generated language

. Freely extend γ to a multifunctor G∗ γ∗T∗〈0〉 (in analogy to

forming the free category over a graph).

. The γ∗ - image of the hom-set 〈S , ε〉G∗ in 〈M,M0〉T∗〈0〉 consists ofcertain tree-like composite diagrams with some leaves in T .

. The yields of these diagrams, i.e., the words formed by their leaves,constitute the language generated by γ .

We would like to identify words generated in this fashion with theirdiagrams. Hence we consider T〈0〉 as a “reflexive multigraph1” with thedefault multiarrows being distinguished.

The intention is to have the default multiarrows obey certain identificationsin the free multicategory T∗〈0〉 ; hence its construction needs to be revised:

1not to be confused with the graph-theoretic notion of this nameJurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 9 / 25

Page 62: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Identifications in T∗〈0〉

Identifications in T∗〈0〉

µm

µn

M

M M M M M M

= µm+n−1

M

M M M M M M

and µ1

M

M

=

M

M

for m, n ∈ N , m > 0 .

This allows the elimination of µ0 - leaves, e.g.,

µ4

a b µ0 c

M

= µ3

a b c

M

Any generated w ∈ T∗ appears as yield directly underneath µ|w | .

This motivates us to write ε not only for µ0 , but also for µn , n ∈ N .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 10 / 25

Page 63: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Identifications in T∗〈0〉

Identifications in T∗〈0〉

µm

µn

M

M M M M M M

= µm+n−1

M

M M M M M M

and µ1

M

M

=

M

M

for m, n ∈ N , m > 0 . This allows the elimination of µ0 - leaves, e.g.,

µ4

a b µ0 c

M

= µ3

a b c

M

Any generated w ∈ T∗ appears as yield directly underneath µ|w | .

This motivates us to write ε not only for µ0 , but also for µn , n ∈ N .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 10 / 25

Page 64: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Identifications in T∗〈0〉

Identifications in T∗〈0〉

µm

µn

M

M M M M M M

= µm+n−1

M

M M M M M M

and µ1

M

M

=

M

M

for m, n ∈ N , m > 0 . This allows the elimination of µ0 - leaves, e.g.,

µ4

a b µ0 c

M

= µ3

a b c

M

Any generated w ∈ T∗ appears as yield directly underneath µ|w | .

This motivates us to write ε not only for µ0 , but also for µn , n ∈ N .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 10 / 25

Page 65: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Identifications in T∗〈0〉

Identifications in T∗〈0〉

µm

µn

M

M M M M M M

= µm+n−1

M

M M M M M M

and µ1

M

M

=

M

M

for m, n ∈ N , m > 0 . This allows the elimination of µ0 - leaves, e.g.,

µ4

a b µ0 c

M

= µ3

a b c

M

Any generated w ∈ T∗ appears as yield directly underneath µ|w | .

This motivates us to write ε not only for µ0 , but also for µn , n ∈ N .

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 10 / 25

Page 66: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Where’s the beef?

Where’s the beef?

There is an obvious translation between the traditional tree-view and themultiarrow view of productions, and hence of derivation diagrams:

Y

a

resp.Y

Xn−1. . .X1X0

corresponds to a

Y

resp. ε

Y

X0 X1 . . . Xn−1

where a ∈ Tε := T + {ε} . The nonterminals are labeling nodes on theleft, but wires on the right!

Besides a certain elegance of the new approach and the better handling ofε-productions (“peanuts”), how do we “sell” this to computer scientists orthe tree-people (Ents?), who seem to be perfectly happy with thetraditional approach?

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 11 / 25

Page 67: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Where’s the beef?

Where’s the beef?

There is an obvious translation between the traditional tree-view and themultiarrow view of productions, and hence of derivation diagrams:

Y

a

resp.Y

Xn−1. . .X1X0

corresponds to a

Y

resp. ε

Y

X0 X1 . . . Xn−1

where a ∈ Tε := T + {ε} .

The nonterminals are labeling nodes on theleft, but wires on the right!

Besides a certain elegance of the new approach and the better handling ofε-productions (“peanuts”), how do we “sell” this to computer scientists orthe tree-people (Ents?), who seem to be perfectly happy with thetraditional approach?

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 11 / 25

Page 68: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Where’s the beef?

Where’s the beef?

There is an obvious translation between the traditional tree-view and themultiarrow view of productions, and hence of derivation diagrams:

Y

a

resp.Y

Xn−1. . .X1X0

corresponds to a

Y

resp. ε

Y

X0 X1 . . . Xn−1

where a ∈ Tε := T + {ε} . The nonterminals are labeling nodes on theleft, but wires on the right!

Besides a certain elegance of the new approach and the better handling ofε-productions (“peanuts”), how do we “sell” this to computer scientists orthe tree-people (Ents?), who seem to be perfectly happy with thetraditional approach?

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 11 / 25

Page 69: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Where’s the beef?

Where’s the beef?

There is an obvious translation between the traditional tree-view and themultiarrow view of productions, and hence of derivation diagrams:

Y

a

resp.Y

Xn−1. . .X1X0

corresponds to a

Y

resp. ε

Y

X0 X1 . . . Xn−1

where a ∈ Tε := T + {ε} . The nonterminals are labeling nodes on theleft, but wires on the right!

Besides a certain elegance of the new approach and the better handling ofε-productions (“peanuts”),

how do we “sell” this to computer scientists orthe tree-people (Ents?), who seem to be perfectly happy with thetraditional approach?

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 11 / 25

Page 70: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Background and motivation Where’s the beef?

Where’s the beef?

There is an obvious translation between the traditional tree-view and themultiarrow view of productions, and hence of derivation diagrams:

Y

a

resp.Y

Xn−1. . .X1X0

corresponds to a

Y

resp. ε

Y

X0 X1 . . . Xn−1

where a ∈ Tε := T + {ε} . The nonterminals are labeling nodes on theleft, but wires on the right!

Besides a certain elegance of the new approach and the better handling ofε-productions (“peanuts”), how do we “sell” this to computer scientists orthe tree-people (Ents?), who seem to be perfectly happy with thetraditional approach?

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 11 / 25

Page 71: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting.

(We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 72: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting. (We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 73: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting. (We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 74: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting. (We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,

these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 75: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting. (We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,

these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 76: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting. (We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 77: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting. (We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 78: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting. (We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 79: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Inductive datatypes

Normal forms in the multi-setting

It makes sense to adapt the algorithm for transforming a wCNF grammarinto CNF to the multigraph setting. (We will not present this algorithm.)

ε

ε

a ε

d

b c

S

U V

W X

Y U

S

U V

W X

Y U

Consider derivation diagrams for a CFG a laWalters in CNF, i.e., elements of 〈S , ε〉G∗with multiarrows labeled by elements of Tε

and wires labeled by G -objects.

Disregarding for the moment the wire-labels,these are instances of the inductive datatypeof binary trees with leaves in T :

btree T = tip T | bin(btree T, btree T) = T + btree T × btree T

Some programmers [cf., Bird, deMoor, Ex. 1.13, 1.14] know this to beisomorphic to the inductive datatype of general trees with all nodes in T :

gtree T = node(T, listl(gtree T)) = T × listl(gtree T)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 12 / 25

Page 80: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 81: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 82: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 83: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 84: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 85: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 86: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 87: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 88: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting Uncurrying

The isomorphism from btree to gtree is just uncurrying:

ε

ε

a ε

d

b c

7→

ε

daa | ε

bb | ε

c

7→

a

dbb | ε

c

a | ε | ε

7→

a

b d

c

. obtain “composite nodes” by collapsing the green wires;

. revert to ordinary nodes by concatenation of labels.

Flattening these diagrams to strings requires parentheses; on the left theε-nodes then serve as implicit left application operators.

(a(bc))d 7→ a(b(c), d)

(There is a second (better?) isomorphism utilizing reverse Polish notation.)

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 13 / 25

Page 89: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels,

the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 , where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 90: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels,

the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 , where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 91: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels, the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 , where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 92: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels, the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 ,

where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 93: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels, the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 , where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 94: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels, the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 , where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 95: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels, the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 , where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 96: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels, the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 , where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.

The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 97: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Normal forms in the multi-setting GNF and currying

a

b d

c

S

X V

U

S

X V

U

Recovering the wire-labels, the resulting diagram oughtto be interpreted as derivation in a GNF grammar withconventional productions

S aXV , X bU , U c , V d

Of course, this diagram no longer lives in the reflexive multigraph T〈0〉 ,but rather in T〈N〉 , where all hom-sets coincide with T + {ε} .

Currying the non-nullaryproductions of a GNF andsplitting the results clearlyyields an equivalent CNF:

Not being able to recoverpreviously collapsed greenwires creates no problems.The new objects can bemapped on the old ones.

a

Y

X0 X1 . . . Xn−1

7→

ε

ε

···

ε

a

Y

ϕn−1

ϕ2

Xn−1

ϕ1X1

ϕ0X0

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 14 / 25

Page 98: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

The issue of recursiveness

Conversely, constructing a GNF from a CNF requires uncurrying certainleft-combinations of CNF productions to obtain single GNF productions.

For only finitely many such combinations to exist, the CNF-multigraph Gmust not admit left feedback (or not be left-recursive).

Adapting classical grammar techniques, eliminating direct feedback at Xcan be achieved by new nonterminals X and X ′ and new productions:

ϕi

X

X Yi

i < n

,

ψj

X

Uj Vj

j < m

7→,

ϕi

ψj

X

Yi

Uj Vj

i < n , j < m

X

, [X ]

X

X X ′

,

ϕ′i

ϕk,l

X ′

Yi

Yk Yl

i , k, l < n

X ′

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 15 / 25

Page 99: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

The issue of recursiveness

Conversely, constructing a GNF from a CNF requires uncurrying certainleft-combinations of CNF productions to obtain single GNF productions.For only finitely many such combinations to exist, the CNF-multigraph Gmust not admit left feedback (or not be left-recursive).

Adapting classical grammar techniques, eliminating direct feedback at Xcan be achieved by new nonterminals X and X ′ and new productions:

ϕi

X

X Yi

i < n

,

ψj

X

Uj Vj

j < m

7→,

ϕi

ψj

X

Yi

Uj Vj

i < n , j < m

X

, [X ]

X

X X ′

,

ϕ′i

ϕk,l

X ′

Yi

Yk Yl

i , k, l < n

X ′

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 15 / 25

Page 100: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

The issue of recursiveness

Conversely, constructing a GNF from a CNF requires uncurrying certainleft-combinations of CNF productions to obtain single GNF productions.For only finitely many such combinations to exist, the CNF-multigraph Gmust not admit left feedback (or not be left-recursive).

Adapting classical grammar techniques, eliminating direct feedback at Xcan be achieved by new nonterminals X and X ′ and new productions:

ϕi

X

X Yi

i < n

,

ψj

X

Uj Vj

j < m

7→,

ϕi

ψj

X

Yi

Uj Vj

i < n , j < m

X

, [X ]

X

X X ′

,

ϕ′i

ϕk,l

X ′

Yi

Yk Yl

i , k, l < n

X ′

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 15 / 25

Page 101: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

The issue of recursiveness

Conversely, constructing a GNF from a CNF requires uncurrying certainleft-combinations of CNF productions to obtain single GNF productions.For only finitely many such combinations to exist, the CNF-multigraph Gmust not admit left feedback (or not be left-recursive).

Adapting classical grammar techniques, eliminating direct feedback at Xcan be achieved by new nonterminals X and X ′ and new productions:

ϕi

X

X Yi

i < n

, ψj

X

Uj Vj

j < m

7→,

ϕi

ψj

X

Yi

Uj Vj

i < n , j < m

X

, [X ]

X

X X ′

,

ϕ′i

ϕk,l

X ′

Yi

Yk Yl

i , k, l < n

X ′

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 15 / 25

Page 102: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

The issue of recursiveness

Conversely, constructing a GNF from a CNF requires uncurrying certainleft-combinations of CNF productions to obtain single GNF productions.For only finitely many such combinations to exist, the CNF-multigraph Gmust not admit left feedback (or not be left-recursive).

Adapting classical grammar techniques, eliminating direct feedback at Xcan be achieved by new nonterminals X and X ′ and new productions:

ϕi

X

X Yi

i < n

, ψj

X

Uj Vj

j < m

7→

,

ϕi

ψj

X

Yi

Uj Vj

i < n , j < m

X

, [X ]

X

X X ′

,

ϕ′i

ϕk,l

X ′

Yi

Yk Yl

i , k, l < n

X ′

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 15 / 25

Page 103: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

The issue of recursiveness

Conversely, constructing a GNF from a CNF requires uncurrying certainleft-combinations of CNF productions to obtain single GNF productions.For only finitely many such combinations to exist, the CNF-multigraph Gmust not admit left feedback (or not be left-recursive).

Adapting classical grammar techniques, eliminating direct feedback at Xcan be achieved by new nonterminals X and X ′ and new productions:

ϕi

X

X Yi

i < n

,

ψj

X

Uj Vj

j < m

7→

,

ϕi

ψj

X

Yi

Uj Vj

i < n , j < m

X

, [X ]

X

X X ′

,

ϕ′i

ϕk,l

X ′

Yi

Yk Yl

i , k, l < n

X ′

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 15 / 25

Page 104: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

Of course, delayed feedback has to be eliminated as well.

This requires arecursive procedure with some arbitrary ordering on the G -objects:

Once the objects Xi , i < n , have been treated, perform “re-associations”

ϕ

ψ

Xn

Z

U V

Xi 7→

ϕ′

ψ′

Xn

U

V Z

X ′i

until no multiarrows of the form Xnϕ Xi Z with i < n are left. Then

eliminate direct feedback at Xn as described above.

This is an expensive operation as it can square the size of the grammar,i.e., the sum over the symbols in all productions. Uncurrying, like allclassical algorithms, can lead to another squaring in size.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 16 / 25

Page 105: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

Of course, delayed feedback has to be eliminated as well. This requires arecursive procedure with some arbitrary ordering on the G -objects:

Once the objects Xi , i < n , have been treated, perform “re-associations”

ϕ

ψ

Xn

Z

U V

Xi 7→

ϕ′

ψ′

Xn

U

V Z

X ′i

until no multiarrows of the form Xnϕ Xi Z with i < n are left. Then

eliminate direct feedback at Xn as described above.

This is an expensive operation as it can square the size of the grammar,i.e., the sum over the symbols in all productions. Uncurrying, like allclassical algorithms, can lead to another squaring in size.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 16 / 25

Page 106: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

Of course, delayed feedback has to be eliminated as well. This requires arecursive procedure with some arbitrary ordering on the G -objects:

Once the objects Xi , i < n , have been treated, perform “re-associations”

ϕ

ψ

Xn

Z

U V

Xi 7→

ϕ′

ψ′

Xn

U

V Z

X ′i

until no multiarrows of the form Xnϕ Xi Z with i < n are left. Then

eliminate direct feedback at Xn as described above.

This is an expensive operation as it can square the size of the grammar,i.e., the sum over the symbols in all productions. Uncurrying, like allclassical algorithms, can lead to another squaring in size.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 16 / 25

Page 107: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

Of course, delayed feedback has to be eliminated as well. This requires arecursive procedure with some arbitrary ordering on the G -objects:

Once the objects Xi , i < n , have been treated, perform “re-associations”

ϕ

ψ

Xn

Z

U V

Xi 7→

ϕ′

ψ′

Xn

U

V Z

X ′i

until no multiarrows of the form Xnϕ Xi Z with i < n are left.

Theneliminate direct feedback at Xn as described above.

This is an expensive operation as it can square the size of the grammar,i.e., the sum over the symbols in all productions. Uncurrying, like allclassical algorithms, can lead to another squaring in size.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 16 / 25

Page 108: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

Of course, delayed feedback has to be eliminated as well. This requires arecursive procedure with some arbitrary ordering on the G -objects:

Once the objects Xi , i < n , have been treated, perform “re-associations”

ϕ

ψ

Xn

Z

U V

Xi 7→

ϕ′

ψ′

Xn

U

V Z

X ′i

until no multiarrows of the form Xnϕ Xi Z with i < n are left. Then

eliminate direct feedback at Xn as described above.

This is an expensive operation as it can square the size of the grammar,i.e., the sum over the symbols in all productions. Uncurrying, like allclassical algorithms, can lead to another squaring in size.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 16 / 25

Page 109: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

Of course, delayed feedback has to be eliminated as well. This requires arecursive procedure with some arbitrary ordering on the G -objects:

Once the objects Xi , i < n , have been treated, perform “re-associations”

ϕ

ψ

Xn

Z

U V

Xi 7→

ϕ′

ψ′

Xn

U

V Z

X ′i

until no multiarrows of the form Xnϕ Xi Z with i < n are left. Then

eliminate direct feedback at Xn as described above.

This is an expensive operation as it can square the size of the grammar,i.e., the sum over the symbols in all productions.

Uncurrying, like allclassical algorithms, can lead to another squaring in size.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 16 / 25

Page 110: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The issue of recursiveness

Of course, delayed feedback has to be eliminated as well. This requires arecursive procedure with some arbitrary ordering on the G -objects:

Once the objects Xi , i < n , have been treated, perform “re-associations”

ϕ

ψ

Xn

Z

U V

Xi 7→

ϕ′

ψ′

Xn

U

V Z

X ′i

until no multiarrows of the form Xnϕ Xi Z with i < n are left. Then

eliminate direct feedback at Xn as described above.

This is an expensive operation as it can square the size of the grammar,i.e., the sum over the symbols in all productions. Uncurrying, like allclassical algorithms, can lead to another squaring in size.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 16 / 25

Page 111: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata

The regular case and automata

Interpreting (faithful) morphisms of reflexive(!) graphs, G γT〈1〉 with

G finite, as regular T -grammars provided Walters’ motivation.

Thinking of such graph morphisms instead as labeled transition systems,possibly with ε-transitions, nonterminals turn into states. Specifying initialand final states results in the notion of finite state automaton (FSA).

Now we can apply currying to the transitions of such an automaton:

S

a

b

c

T final

X

Y

7→

S

a

b ε

c

ε

T final

εDa X

Db Y

Dc

This essentially results in a right-linearand hence regular grammar that is inCNF iff the automaton does not haveε-transitions.

Final states provide an externallyimposed mechanism for termination,as T〈1〉 has no default for this.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 17 / 25

Page 112: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata

The regular case and automata

Interpreting (faithful) morphisms of reflexive(!) graphs, G γT〈1〉 with

G finite, as regular T -grammars provided Walters’ motivation.

Thinking of such graph morphisms instead as labeled transition systems,possibly with ε-transitions, nonterminals turn into states.

Specifying initialand final states results in the notion of finite state automaton (FSA).

Now we can apply currying to the transitions of such an automaton:

S

a

b

c

T final

X

Y

7→

S

a

b ε

c

ε

T final

εDa X

Db Y

Dc

This essentially results in a right-linearand hence regular grammar that is inCNF iff the automaton does not haveε-transitions.

Final states provide an externallyimposed mechanism for termination,as T〈1〉 has no default for this.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 17 / 25

Page 113: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata

The regular case and automata

Interpreting (faithful) morphisms of reflexive(!) graphs, G γT〈1〉 with

G finite, as regular T -grammars provided Walters’ motivation.

Thinking of such graph morphisms instead as labeled transition systems,possibly with ε-transitions, nonterminals turn into states. Specifying initialand final states results in the notion of finite state automaton (FSA).

Now we can apply currying to the transitions of such an automaton:

S

a

b

c

T final

X

Y

7→

S

a

b ε

c

ε

T final

εDa X

Db Y

Dc

This essentially results in a right-linearand hence regular grammar that is inCNF iff the automaton does not haveε-transitions.

Final states provide an externallyimposed mechanism for termination,as T〈1〉 has no default for this.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 17 / 25

Page 114: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata

The regular case and automata

Interpreting (faithful) morphisms of reflexive(!) graphs, G γT〈1〉 with

G finite, as regular T -grammars provided Walters’ motivation.

Thinking of such graph morphisms instead as labeled transition systems,possibly with ε-transitions, nonterminals turn into states. Specifying initialand final states results in the notion of finite state automaton (FSA).

Now we can apply currying to the transitions of such an automaton:

S

a

b

c

T final

X

Y

7→

S

a

b ε

c

ε

T final

εDa X

Db Y

Dc

This essentially results in a right-linearand hence regular grammar that is inCNF iff the automaton does not haveε-transitions.

Final states provide an externallyimposed mechanism for termination,as T〈1〉 has no default for this.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 17 / 25

Page 115: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata

The regular case and automata

Interpreting (faithful) morphisms of reflexive(!) graphs, G γT〈1〉 with

G finite, as regular T -grammars provided Walters’ motivation.

Thinking of such graph morphisms instead as labeled transition systems,possibly with ε-transitions, nonterminals turn into states. Specifying initialand final states results in the notion of finite state automaton (FSA).

Now we can apply currying to the transitions of such an automaton:

S

a

b

c

T final

X

Y

7→

S

a

b ε

c

ε

T final

εDa X

Db Y

Dc

This essentially results in a right-linearand hence regular grammar that is inCNF iff the automaton does not haveε-transitions.

Final states provide an externallyimposed mechanism for termination,as T〈1〉 has no default for this.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 17 / 25

Page 116: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata

The regular case and automata

Interpreting (faithful) morphisms of reflexive(!) graphs, G γT〈1〉 with

G finite, as regular T -grammars provided Walters’ motivation.

Thinking of such graph morphisms instead as labeled transition systems,possibly with ε-transitions, nonterminals turn into states. Specifying initialand final states results in the notion of finite state automaton (FSA).

Now we can apply currying to the transitions of such an automaton:

S

a

b

c

T final

X

Y

7→

S

a

b ε

c

ε

T final

εDa X

Db Y

Dc

This essentially results in a right-linearand hence regular grammar that is inCNF iff the automaton does not haveε-transitions.

Final states provide an externallyimposed mechanism for termination,as T〈1〉 has no default for this.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 17 / 25

Page 117: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata

The regular case and automata

Interpreting (faithful) morphisms of reflexive(!) graphs, G γT〈1〉 with

G finite, as regular T -grammars provided Walters’ motivation.

Thinking of such graph morphisms instead as labeled transition systems,possibly with ε-transitions, nonterminals turn into states. Specifying initialand final states results in the notion of finite state automaton (FSA).

Now we can apply currying to the transitions of such an automaton:

S

a

b

c

T final

X

Y

7→

S

a

b ε

c

ε

T final

εDa X

Db Y

Dc

This essentially results in a right-linearand hence regular grammar that is inCNF iff the automaton does not haveε-transitions.

Final states provide an externallyimposed mechanism for termination,as T〈1〉 has no default for this.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 17 / 25

Page 118: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 119: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 120: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 121: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 122: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 123: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions,

and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 124: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 125: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state.

Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 126: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 127: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s.

As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 128: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

The regular case and automata PDA’s

Extend the notion of CFG to faithful multigraph morphisms G γT〈N〉.

These can be turned into push-down automata (PDA), provided that

. strings(!) of nonterminals are interpreted as (internal) states;

. only left-derivations are considered, which corresponds to theconstrained access to the stack via its top.

The initial state is S , while the canonical final state is ε .

In particular, CFG’s in GNF correspond to push-down automata withoutε-transitions, and the transformation into GNF can be viewed as theelimination of ε-transitions from a general PDA.

Also note that CFG-induced PDA’s are pure in the sense of having onlyone external state. Still they can accept any context-free language.

Conventionally, PDA’s are defined with external states. Eliminating thestack then leads to FSA’s, also called 0-PDA’s. As seen above, FSA’s canalso be realized by pure PDA’s, where the stack is limited to depth 1.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 18 / 25

Page 129: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

(Multi-)Graph Comprehension

The familiar bijection for labeled transition systems

G γT〈1〉

T〈1〉Γ rel

(faithful graph morphism)

(graph morphism)

readily carries over to the multi-setting:

G γT〈N〉

T〈N〉Γ rel

(faithful multigraph morphism)

(multigraph morphism)

where the multigraph structure of rel is given by × .

Both bijections remain valid, if T〈1〉 and T〈N〉 are replaced by an arbitrarygraph, resp., multigraph as control. Restricting to finite G imposesappropriate finiteness conditions on the “denominators”.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 19 / 25

Page 130: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

(Multi-)Graph Comprehension

The familiar bijection for labeled transition systems

G γT〈1〉

T〈1〉Γ rel

(faithful graph morphism)

(graph morphism)

readily carries over to the multi-setting:

G γT〈N〉

T〈N〉Γ rel

(faithful multigraph morphism)

(multigraph morphism)

where the multigraph structure of rel is given by × .

Both bijections remain valid, if T〈1〉 and T〈N〉 are replaced by an arbitrarygraph, resp., multigraph as control. Restricting to finite G imposesappropriate finiteness conditions on the “denominators”.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 19 / 25

Page 131: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

(Multi-)Graph Comprehension

The familiar bijection for labeled transition systems

G γT〈1〉

T〈1〉Γ rel

(faithful graph morphism)

(graph morphism)

readily carries over to the multi-setting:

G γT〈N〉

T〈N〉Γ rel

(faithful multigraph morphism)

(multigraph morphism)

where the multigraph structure of rel is given by × .

Both bijections remain valid, if T〈1〉 and T〈N〉 are replaced by an arbitrarygraph, resp., multigraph as control.

Restricting to finite G imposesappropriate finiteness conditions on the “denominators”.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 19 / 25

Page 132: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

(Multi-)Graph Comprehension

The familiar bijection for labeled transition systems

G γT〈1〉

T〈1〉Γ rel

(faithful graph morphism)

(graph morphism)

readily carries over to the multi-setting:

G γT〈N〉

T〈N〉Γ rel

(faithful multigraph morphism)

(multigraph morphism)

where the multigraph structure of rel is given by × .

Both bijections remain valid, if T〈1〉 and T〈N〉 are replaced by an arbitrarygraph, resp., multigraph as control. Restricting to finite G imposesappropriate finiteness conditions on the “denominators”.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 19 / 25

Page 133: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

Closing up under “vertical” composition, we obtain bijections

G γT∗〈1〉

T∗〈1〉Γ rel

(faithful functor)

(lax functor)

Moving to the free monoidal category in the multi-setting yields

G γT?〈N〉

T?〈N〉Γ rel

(faithful strict monoidal functor)

(strict monoidal lax functor)

where G now is a (strict monoidal) category. Again, general (strictmonoidal) categories can serve as controls instead of T∗〈1〉 , resp., T?〈N〉 .

Oplax (monoidal) natural transformations turn out to be the appropriatetype of morphism in the “denominators” to encode simulations.

Instead of rel , matrix categories over other rigs yield further instances ofthis phenomenon, like probabilistic or weighted transition systems.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 20 / 25

Page 134: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

Closing up under “vertical” composition, we obtain bijections

G γT∗〈1〉

T∗〈1〉Γ rel

(faithful functor)

(lax functor)

Moving to the free monoidal category in the multi-setting yields

G γT?〈N〉

T?〈N〉Γ rel

(faithful strict monoidal functor)

(strict monoidal lax functor)

where G now is a (strict monoidal) category.

Again, general (strictmonoidal) categories can serve as controls instead of T∗〈1〉 , resp., T?〈N〉 .

Oplax (monoidal) natural transformations turn out to be the appropriatetype of morphism in the “denominators” to encode simulations.

Instead of rel , matrix categories over other rigs yield further instances ofthis phenomenon, like probabilistic or weighted transition systems.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 20 / 25

Page 135: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

Closing up under “vertical” composition, we obtain bijections

G γT∗〈1〉

T∗〈1〉Γ rel

(faithful functor)

(lax functor)

Moving to the free monoidal category in the multi-setting yields

G γT?〈N〉

T?〈N〉Γ rel

(faithful strict monoidal functor)

(strict monoidal lax functor)

where G now is a (strict monoidal) category. Again, general (strictmonoidal) categories can serve as controls instead of T∗〈1〉 , resp., T?〈N〉 .

Oplax (monoidal) natural transformations turn out to be the appropriatetype of morphism in the “denominators” to encode simulations.

Instead of rel , matrix categories over other rigs yield further instances ofthis phenomenon, like probabilistic or weighted transition systems.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 20 / 25

Page 136: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

Closing up under “vertical” composition, we obtain bijections

G γT∗〈1〉

T∗〈1〉Γ rel

(faithful functor)

(lax functor)

Moving to the free monoidal category in the multi-setting yields

G γT?〈N〉

T?〈N〉Γ rel

(faithful strict monoidal functor)

(strict monoidal lax functor)

where G now is a (strict monoidal) category. Again, general (strictmonoidal) categories can serve as controls instead of T∗〈1〉 , resp., T?〈N〉 .

Oplax (monoidal) natural transformations turn out to be the appropriatetype of morphism in the “denominators” to encode simulations.

Instead of rel , matrix categories over other rigs yield further instances ofthis phenomenon, like probabilistic or weighted transition systems.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 20 / 25

Page 137: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

(Multi-)Graph Comprehension

Closing up under “vertical” composition, we obtain bijections

G γT∗〈1〉

T∗〈1〉Γ rel

(faithful functor)

(lax functor)

Moving to the free monoidal category in the multi-setting yields

G γT?〈N〉

T?〈N〉Γ rel

(faithful strict monoidal functor)

(strict monoidal lax functor)

where G now is a (strict monoidal) category. Again, general (strictmonoidal) categories can serve as controls instead of T∗〈1〉 , resp., T?〈N〉 .

Oplax (monoidal) natural transformations turn out to be the appropriatetype of morphism in the “denominators” to encode simulations.

Instead of rel , matrix categories over other rigs yield further instances ofthis phenomenon, like probabilistic or weighted transition systems.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 20 / 25

Page 138: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions

Obvious questions

. What about general grammars with unrestricted productions

V∗ ×N × V∗ V∗ where V := T + N

(the left side has to contain at least one nonterminal)?

These generate all semidecidable languages, which are precisely thoserecognizable by Turing machines.

. What about “polygraphs” and consequently “polycategories”?

The well-developed theory of “planar” polycategories andpoly-bicategories, where the poly-2-cells can have finitely many inputsand outputs, cf., [Cockett, Koslowski, Seely: TAC 11(2)] and[Koslowski: TAC 14(7)], is based on logical considerations (calculusof 2-sided sequents) and uses cut along single wires as “vertical”composition. It would seem to be incomatible with the replacementprocess of general grammars.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 21 / 25

Page 139: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions

Obvious questions

. What about general grammars with unrestricted productions

V∗ ×N × V∗ V∗ where V := T + N

(the left side has to contain at least one nonterminal)?

These generate all semidecidable languages, which are precisely thoserecognizable by Turing machines.

. What about “polygraphs” and consequently “polycategories”?

The well-developed theory of “planar” polycategories andpoly-bicategories, where the poly-2-cells can have finitely many inputsand outputs, cf., [Cockett, Koslowski, Seely: TAC 11(2)] and[Koslowski: TAC 14(7)], is based on logical considerations (calculusof 2-sided sequents) and uses cut along single wires as “vertical”composition. It would seem to be incomatible with the replacementprocess of general grammars.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 21 / 25

Page 140: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions

Obvious questions

. What about general grammars with unrestricted productions

V∗ ×N × V∗ V∗ where V := T + N

(the left side has to contain at least one nonterminal)?

These generate all semidecidable languages, which are precisely thoserecognizable by Turing machines.

. What about “polygraphs” and consequently “polycategories”?

The well-developed theory of “planar” polycategories andpoly-bicategories, where the poly-2-cells can have finitely many inputsand outputs, cf., [Cockett, Koslowski, Seely: TAC 11(2)] and[Koslowski: TAC 14(7)], is based on logical considerations (calculusof 2-sided sequents) and uses cut along single wires as “vertical”composition. It would seem to be incomatible with the replacementprocess of general grammars.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 21 / 25

Page 141: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions

Obvious questions

. What about general grammars with unrestricted productions

V∗ ×N × V∗ V∗ where V := T + N

(the left side has to contain at least one nonterminal)?

These generate all semidecidable languages, which are precisely thoserecognizable by Turing machines.

. What about “polygraphs” and consequently “polycategories”?

The well-developed theory of “planar” polycategories andpoly-bicategories, where the poly-2-cells can have finitely many inputsand outputs, cf., [Cockett, Koslowski, Seely: TAC 11(2)] and[Koslowski: TAC 14(7)], is based on logical considerations (calculusof 2-sided sequents) and uses cut along single wires as “vertical”composition. It would seem to be incomatible with the replacementprocess of general grammars.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 21 / 25

Page 142: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions

Obvious questions

. What about general grammars with unrestricted productions

V∗ ×N × V∗ V∗ where V := T + N

(the left side has to contain at least one nonterminal)?

These generate all semidecidable languages, which are precisely thoserecognizable by Turing machines.

. What about “polygraphs” and consequently “polycategories”?

The well-developed theory of “planar” polycategories andpoly-bicategories, where the poly-2-cells can have finitely many inputsand outputs, cf., [Cockett, Koslowski, Seely: TAC 11(2)] and[Koslowski: TAC 14(7)],

is based on logical considerations (calculusof 2-sided sequents) and uses cut along single wires as “vertical”composition. It would seem to be incomatible with the replacementprocess of general grammars.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 21 / 25

Page 143: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions

Obvious questions

. What about general grammars with unrestricted productions

V∗ ×N × V∗ V∗ where V := T + N

(the left side has to contain at least one nonterminal)?

These generate all semidecidable languages, which are precisely thoserecognizable by Turing machines.

. What about “polygraphs” and consequently “polycategories”?

The well-developed theory of “planar” polycategories andpoly-bicategories, where the poly-2-cells can have finitely many inputsand outputs, cf., [Cockett, Koslowski, Seely: TAC 11(2)] and[Koslowski: TAC 14(7)], is based on logical considerations (calculusof 2-sided sequents) and uses cut along single wires as “vertical”composition.

It would seem to be incomatible with the replacementprocess of general grammars.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 21 / 25

Page 144: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions

Obvious questions

. What about general grammars with unrestricted productions

V∗ ×N × V∗ V∗ where V := T + N

(the left side has to contain at least one nonterminal)?

These generate all semidecidable languages, which are precisely thoserecognizable by Turing machines.

. What about “polygraphs” and consequently “polycategories”?

The well-developed theory of “planar” polycategories andpoly-bicategories, where the poly-2-cells can have finitely many inputsand outputs, cf., [Cockett, Koslowski, Seely: TAC 11(2)] and[Koslowski: TAC 14(7)], is based on logical considerations (calculusof 2-sided sequents) and uses cut along single wires as “vertical”composition. It would seem to be incomatible with the replacementprocess of general grammars.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 21 / 25

Page 145: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions. However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 146: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded.

E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions. However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 147: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.

As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions. However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 148: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.

As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions. However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 149: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions.

However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 150: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions.

However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 151: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions. However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.

Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 152: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions. However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.

Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 153: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions. However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 154: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions A thought experiment

How can we extend pure PDA’s as above in a finite fashion in order tohandle general grammars?

Even for left derivations, the first subword to which a production can beapplied need not be a prefix of the current stack; in fact the depth of itsoccurrence is unbounded. E.g., consider productions AB EF andCD B, and a current stack of the form AnCD . . . .

We can allow to look deeper into the stack, beyond the top element.As long as the depth is bounded, this does not help.

We can add finitely many external states to examine subwords on thestack for being left sides of productions. However, his does not helpin remembering the prefix before the first such subword.

We can add the ability to “bend wires out of the way” until we find afirst left hand side of a production, and “bend the wires back” later.Recall that we only have to deal with finitely many nonterminals.

A combination of the last two ideas indeed will do the trick.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 22 / 25

Page 155: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions Polygraphs with linear adjoints

Polygraphs with linear adjoints

Recall that planar poly-bicategories as well as polycategories admit a verynice notion of so-called linear adjoints, together with a mate calculus.

In analogy with the notion of reflexive (multi-)graph, where implicitly a setof equations is specified by which to factor the absolutely free(multi-)category, we consider adjoint polygraphs, which are supposed toalready contain the units and counits of the “free polycategory with linearadjunctions” over it as distinguished poly-2-cells.

Of course, T〈N〉 needs to be replaced by an obvious polygraph T〈N〉〈N〉 ,

where again all hom-sets coincide with T + {ε} .

In machine terms we obtain pure 2-PDA’s, which are more powerful thanpure PDA’s, as they can recognize shuffles of context-free languages(which need not be context-free anymore).

2-PDA’s with external states are well-known to be equivalent to Turingmachines.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 23 / 25

Page 156: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions Polygraphs with linear adjoints

Polygraphs with linear adjoints

Recall that planar poly-bicategories as well as polycategories admit a verynice notion of so-called linear adjoints, together with a mate calculus.

In analogy with the notion of reflexive (multi-)graph, where implicitly a setof equations is specified by which to factor the absolutely free(multi-)category, we consider adjoint polygraphs, which are supposed toalready contain the units and counits of the “free polycategory with linearadjunctions” over it as distinguished poly-2-cells.

Of course, T〈N〉 needs to be replaced by an obvious polygraph T〈N〉〈N〉 ,

where again all hom-sets coincide with T + {ε} .

In machine terms we obtain pure 2-PDA’s, which are more powerful thanpure PDA’s, as they can recognize shuffles of context-free languages(which need not be context-free anymore).

2-PDA’s with external states are well-known to be equivalent to Turingmachines.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 23 / 25

Page 157: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions Polygraphs with linear adjoints

Polygraphs with linear adjoints

Recall that planar poly-bicategories as well as polycategories admit a verynice notion of so-called linear adjoints, together with a mate calculus.

In analogy with the notion of reflexive (multi-)graph, where implicitly a setof equations is specified by which to factor the absolutely free(multi-)category, we consider adjoint polygraphs, which are supposed toalready contain the units and counits of the “free polycategory with linearadjunctions” over it as distinguished poly-2-cells.

Of course, T〈N〉 needs to be replaced by an obvious polygraph T〈N〉〈N〉 ,

where again all hom-sets coincide with T + {ε} .

In machine terms we obtain pure 2-PDA’s, which are more powerful thanpure PDA’s, as they can recognize shuffles of context-free languages(which need not be context-free anymore).

2-PDA’s with external states are well-known to be equivalent to Turingmachines.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 23 / 25

Page 158: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions Polygraphs with linear adjoints

Polygraphs with linear adjoints

Recall that planar poly-bicategories as well as polycategories admit a verynice notion of so-called linear adjoints, together with a mate calculus.

In analogy with the notion of reflexive (multi-)graph, where implicitly a setof equations is specified by which to factor the absolutely free(multi-)category, we consider adjoint polygraphs, which are supposed toalready contain the units and counits of the “free polycategory with linearadjunctions” over it as distinguished poly-2-cells.

Of course, T〈N〉 needs to be replaced by an obvious polygraph T〈N〉〈N〉 ,

where again all hom-sets coincide with T + {ε} .

In machine terms we obtain pure 2-PDA’s, which are more powerful thanpure PDA’s, as they can recognize shuffles of context-free languages(which need not be context-free anymore).

2-PDA’s with external states are well-known to be equivalent to Turingmachines.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 23 / 25

Page 159: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

Obvious questions Polygraphs with linear adjoints

Polygraphs with linear adjoints

Recall that planar poly-bicategories as well as polycategories admit a verynice notion of so-called linear adjoints, together with a mate calculus.

In analogy with the notion of reflexive (multi-)graph, where implicitly a setof equations is specified by which to factor the absolutely free(multi-)category, we consider adjoint polygraphs, which are supposed toalready contain the units and counits of the “free polycategory with linearadjunctions” over it as distinguished poly-2-cells.

Of course, T〈N〉 needs to be replaced by an obvious polygraph T〈N〉〈N〉 ,

where again all hom-sets coincide with T + {ε} .

In machine terms we obtain pure 2-PDA’s, which are more powerful thanpure PDA’s, as they can recognize shuffles of context-free languages(which need not be context-free anymore).

2-PDA’s with external states are well-known to be equivalent to Turingmachines.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 23 / 25

Page 160: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

To do

To do

. Do pure 2-PDA’s suffice to simulate Turing machines for decisionproblems?

. Even if they do, external states may still be useful for computationalproblems (even for 1-PDA’s).

What is the “right” way of addingexternal states, short of grafting them on?

. What about transducers, i.e., how should output be handled?

. Work out the details for polygraph comprehension.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 24 / 25

Page 161: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

To do

To do

. Do pure 2-PDA’s suffice to simulate Turing machines for decisionproblems?

. Even if they do, external states may still be useful for computationalproblems (even for 1-PDA’s).

What is the “right” way of addingexternal states, short of grafting them on?

. What about transducers, i.e., how should output be handled?

. Work out the details for polygraph comprehension.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 24 / 25

Page 162: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

To do

To do

. Do pure 2-PDA’s suffice to simulate Turing machines for decisionproblems?

. Even if they do, external states may still be useful for computationalproblems (even for 1-PDA’s). What is the “right” way of addingexternal states, short of grafting them on?

. What about transducers, i.e., how should output be handled?

. Work out the details for polygraph comprehension.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 24 / 25

Page 163: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

To do

To do

. Do pure 2-PDA’s suffice to simulate Turing machines for decisionproblems?

. Even if they do, external states may still be useful for computationalproblems (even for 1-PDA’s). What is the “right” way of addingexternal states, short of grafting them on?

. What about transducers, i.e., how should output be handled?

. Work out the details for polygraph comprehension.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 24 / 25

Page 164: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

To do

To do

. Do pure 2-PDA’s suffice to simulate Turing machines for decisionproblems?

. Even if they do, external states may still be useful for computationalproblems (even for 1-PDA’s). What is the “right” way of addingexternal states, short of grafting them on?

. What about transducers, i.e., how should output be handled?

. Work out the details for polygraph comprehension.

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 24 / 25

Page 165: Relating Chomsky Normal Form and Greibach …ct2011/talks/Koslowski.pdfRelating Chomsky Normal Form and Greibach Normal Form by Exponential Transposition J urgen Koslowski Department

To do

Thank you!

Jurgen Koslowski (TU-BS) Chomsky and Greibach normal form CT 2011, Vancouver, July 22 25 / 25