Theory Grammar
section ‹Types and Definitions›
theory Grammar
imports Main
begin
subsection ‹Grammar›
text‹We first define the datatypes for a grammar. A symbol is either a non-terminal of type
@{typ 'n} or a terminal of type @{typ 't}. A production is then a tuple of a non-terminal, and a
list of symbols. An empty list of symbols corresponds to the empty word. A grammar is defined
through a non-terminal as start symbol and a list of productions. Note that there may be more than
one production for some non-terminal.›