src/Doc/Isar_Ref/Outer_Syntax.thy
changeset 59853 4039d8aecda4
parent 59785 4e6ab5831cc0
child 60131 2506f17d2739
equal deleted inserted replaced
59850:f339ff48a6ee 59853:4039d8aecda4
   288     @{syntax_def term}: @{syntax nameref} | @{syntax var}
   288     @{syntax_def term}: @{syntax nameref} | @{syntax var}
   289     ;
   289     ;
   290     @{syntax_def prop}: @{syntax term}
   290     @{syntax_def prop}: @{syntax term}
   291   \<close>}
   291   \<close>}
   292 
   292 
   293   Positional instantiations are indicated by giving a sequence of
   293   Positional instantiations are specified as a sequence of terms, or the
   294   terms, or the placeholder ``@{text _}'' (underscore), which means to
   294   placeholder ``@{text _}'' (underscore), which means to skip a position.
   295   skip a position.
       
   296 
   295 
   297   @{rail \<open>
   296   @{rail \<open>
   298     @{syntax_def inst}: '_' | @{syntax term}
   297     @{syntax_def inst}: '_' | @{syntax term}
   299     ;
   298     ;
   300     @{syntax_def insts}: (@{syntax inst} *)
   299     @{syntax_def insts}: (@{syntax inst} *)
       
   300   \<close>}
       
   301 
       
   302   Named instantiations are specified as pairs of assignments @{text "v =
       
   303   t"}, which refer to schematic variables in some theorem that is
       
   304   instantiated. Both type and terms instantiations are admitted, and
       
   305   distinguished by the usual syntax of variable names.
       
   306 
       
   307   @{rail \<open>
       
   308     @{syntax_def named_inst}: variable '=' (type | term)
       
   309     ;
       
   310     @{syntax_def named_insts}: (named_inst @'and' +)
       
   311     ;
       
   312     variable: @{syntax name} | @{syntax var} | @{syntax typefree} | @{syntax typevar}
   301   \<close>}
   313   \<close>}
   302 
   314 
   303   Type declarations and definitions usually refer to @{syntax
   315   Type declarations and definitions usually refer to @{syntax
   304   typespec} on the left-hand side.  This models basic type constructor
   316   typespec} on the left-hand side.  This models basic type constructor
   305   application at the outer syntax level.  Note that only plain postfix
   317   application at the outer syntax level.  Note that only plain postfix