doc-src/Ref/theory-syntax.tex
author lcp
Mon, 21 Mar 1994 10:51:28 +0100
changeset 285 fd4a6585e5bf
child 295 dcde5024895d
permissions -rw-r--r--
first draft of Springer book
     1 %% $Id$
     2 
     3 \appendix
     4 \newlinechar=-1  %mathsing.sty sets \newlinechar=`\|, which would cause mayhem
     5 
     6 \chapter{Syntax of Isabelle Theories}\label{app:TheorySyntax}
     7 \begin{itemize}
     8 \item {\tt Typewriter font} denotes terminal symbols.
     9 \item $id$, $tid$, $nat$, $string$ and $text$ are the lexical classes of
    10   identifiers, type identifiers, natural numbers, \ML\ strings (with their
    11   quotation marks) and arbitrary \ML\ text.  The first three are fully defined
    12   in the {\it Defining Logics} chapter of {\it Isabelle's Object Logics}.
    13 \end{itemize}
    14 
    15 \begin{rail}
    16 
    17 theoryDef : id '=' (name + '+') ('+' extension | ());
    18 
    19 name: id | string;
    20 
    21 extension : classes default types arities consts trans rules 'end' ml
    22           ;
    23 
    24 classes : ()
    25         | 'classes' ( ( id (  ()
    26                             | '<' (id + ',')
    27                            ) 
    28                        ) + )
    29         ;
    30 
    31 default : ()
    32         | 'default' sort 
    33         ;
    34 
    35 sort :  id
    36      | '\{' (id * ',') '\}'
    37      ;
    38 
    39 types :  ()
    40       | 'types' ( ( type ( () | '(' infix ')' ) ) + )
    41       ;
    42 
    43 type : ( () | tid | '(' ( tid + ',' ) ')') name ( () | '='  string );
    44 
    45 infix : ( 'infixr' | 'infixl' ) nat;
    46 
    47 
    48 arities :  ()
    49         | 'arities' ((( name + ',' ) '::' arity ) + )
    50         ;
    51 
    52 arity   : ( () 
    53           | '(' (sort + ',') ')' 
    54           ) id
    55         ;
    56 
    57 
    58 consts :  ()
    59        | 'consts' ( ( constDecl ( () | ( '(' mixfix ')' ) ) ) + )
    60        ;
    61 
    62 constDecl : ( name + ',') '::' string ;
    63 
    64 
    65 mixfix :  string ( () | ( () | ('[' (nat + ',') ']')) nat )
    66        | infix
    67        | 'binder' string nat ;
    68 
    69 trans : ()
    70       | 'translations' ( pat ( '==' | '=>' | '<=' ) pat + )
    71       ;
    72 
    73 pat : ( () | ( '(' id ')' ) ) string;
    74 
    75 rules :  ()
    76       | 'rules' (( id string ) + )
    77       ;
    78 
    79 ml :  ()
    80    | 'ML' text
    81    ;
    82 
    83 \end{rail}