doc-src/IsarRef/Thy/HOL_Specific.thy
changeset 34172 4301e9ea1c54
parent 33858 0c348f7997f7
child 35331 450ab945c451
equal deleted inserted replaced
34171:0928909af6aa 34172:4301e9ea1c54
  1137     @{command_def (HOL) "print_codeproc"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
  1137     @{command_def (HOL) "print_codeproc"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
  1138     @{attribute_def (HOL) code} & : & @{text attribute} \\
  1138     @{attribute_def (HOL) code} & : & @{text attribute} \\
  1139   \end{matharray}
  1139   \end{matharray}
  1140 
  1140 
  1141   \begin{rail}
  1141   \begin{rail}
  1142     'export\_code' ( constexpr + ) ? \\
  1142     'export\_code' ( constexpr + ) \\
  1143       ( ( 'in' target ( 'module\_name' string ) ? \\
  1143       ( ( 'in' target ( 'module\_name' string ) ? \\
  1144         ( 'file' ( string | '-' ) ) ? ( '(' args ')' ) ?) + ) ?
  1144         ( 'file' ( string | '-' ) ) ? ( '(' args ')' ) ?) + ) ?
  1145     ;
  1145     ;
  1146 
  1146 
  1147     'code\_thms' ( constexpr + ) ?
  1147     'code\_thms' ( constexpr + ) ?
  1214 
  1214 
  1215   \begin{description}
  1215   \begin{description}
  1216 
  1216 
  1217   \item @{command (HOL) "export_code"} is the canonical interface for
  1217   \item @{command (HOL) "export_code"} is the canonical interface for
  1218   generating and serializing code: for a given list of constants, code
  1218   generating and serializing code: for a given list of constants, code
  1219   is generated for the specified target languages.  Abstract code is
  1219   is generated for the specified target languages.  If no serialization
  1220   cached incrementally.  If no constant is given, the currently cached
  1220   instruction is given, only abstract code is generated internally.
  1221   code is serialized.  If no serialization instruction is given, only
       
  1222   abstract code is cached.
       
  1223 
  1221 
  1224   Constants may be specified by giving them literally, referring to
  1222   Constants may be specified by giving them literally, referring to
  1225   all executable contants within a certain theory by giving @{text
  1223   all executable contants within a certain theory by giving @{text
  1226   "name.*"}, or referring to \emph{all} executable constants currently
  1224   "name.*"}, or referring to \emph{all} executable constants currently
  1227   available by giving @{text "*"}.
  1225   available by giving @{text "*"}.
  1237   hierarchy.  The file specification ``@{text "-"}'' denotes standard
  1235   hierarchy.  The file specification ``@{text "-"}'' denotes standard
  1238   output.  For \emph{SML}, omitting the file specification compiles
  1236   output.  For \emph{SML}, omitting the file specification compiles
  1239   code internally in the context of the current ML session.
  1237   code internally in the context of the current ML session.
  1240 
  1238 
  1241   Serializers take an optional list of arguments in parentheses.  For
  1239   Serializers take an optional list of arguments in parentheses.  For
  1242   \emph{Haskell} a module name prefix may be given using the ``@{text
  1240   \emph{SML} and \emph{OCaml}, ``@{text no_signatures}`` omits
       
  1241   explicit module signatures.
       
  1242   
       
  1243   For \emph{Haskell} a module name prefix may be given using the ``@{text
  1243   "root:"}'' argument; ``@{text string_classes}'' adds a ``@{verbatim
  1244   "root:"}'' argument; ``@{text string_classes}'' adds a ``@{verbatim
  1244   "deriving (Read, Show)"}'' clause to each appropriate datatype
  1245   "deriving (Read, Show)"}'' clause to each appropriate datatype
  1245   declaration.
  1246   declaration.
  1246 
  1247 
  1247   \item @{command (HOL) "code_thms"} prints a list of theorems
  1248   \item @{command (HOL) "code_thms"} prints a list of theorems
  1248   representing the corresponding program containing all given
  1249   representing the corresponding program containing all given
  1249   constants; if no constants are given, the currently cached code
  1250   constants.
  1250   theorems are printed.
       
  1251 
  1251 
  1252   \item @{command (HOL) "code_deps"} visualizes dependencies of
  1252   \item @{command (HOL) "code_deps"} visualizes dependencies of
  1253   theorems representing the corresponding program containing all given
  1253   theorems representing the corresponding program containing all given
  1254   constants; if no constants are given, the currently cached code
  1254   constants.
  1255   theorems are visualized.
       
  1256 
  1255 
  1257   \item @{command (HOL) "code_datatype"} specifies a constructor set
  1256   \item @{command (HOL) "code_datatype"} specifies a constructor set
  1258   for a logical type.
  1257   for a logical type.
  1259 
  1258 
  1260   \item @{command (HOL) "code_const"} associates a list of constants
  1259   \item @{command (HOL) "code_const"} associates a list of constants