src/HOL/Tools/specification_package.ML
changeset 24867 e5b55d7be9bb
parent 24707 dfeb98f84e93
child 26478 9d1029ce0e13
equal deleted inserted replaced
24866:6e6d9e80ebb4 24867:e5b55d7be9bb
   242 
   242 
   243 val specification_decl =
   243 val specification_decl =
   244   P.$$$ "(" |-- Scan.repeat1 (opt_name -- P.term -- opt_overloaded) --| P.$$$ ")" --
   244   P.$$$ "(" |-- Scan.repeat1 (opt_name -- P.term -- opt_overloaded) --| P.$$$ ")" --
   245           Scan.repeat1 (SpecParse.opt_thm_name ":" -- P.prop)
   245           Scan.repeat1 (SpecParse.opt_thm_name ":" -- P.prop)
   246 
   246 
   247 val specificationP =
   247 val _ =
   248   OuterSyntax.command "specification" "define constants by specification" K.thy_goal
   248   OuterSyntax.command "specification" "define constants by specification" K.thy_goal
   249     (specification_decl >> (fn (cos,alt_props) =>
   249     (specification_decl >> (fn (cos,alt_props) =>
   250                                Toplevel.print o (Toplevel.theory_to_proof
   250                                Toplevel.print o (Toplevel.theory_to_proof
   251                                                      (process_spec NONE cos alt_props))))
   251                                                      (process_spec NONE cos alt_props))))
   252 
   252 
   253 val ax_specification_decl =
   253 val ax_specification_decl =
   254     P.name --
   254     P.name --
   255     (P.$$$ "(" |-- Scan.repeat1 (opt_name -- P.term -- opt_overloaded) --| P.$$$ ")" --
   255     (P.$$$ "(" |-- Scan.repeat1 (opt_name -- P.term -- opt_overloaded) --| P.$$$ ")" --
   256            Scan.repeat1 (SpecParse.opt_thm_name ":" -- P.prop))
   256            Scan.repeat1 (SpecParse.opt_thm_name ":" -- P.prop))
   257 
   257 
   258 val ax_specificationP =
   258 val _ =
   259   OuterSyntax.command "ax_specification" "define constants by specification" K.thy_goal
   259   OuterSyntax.command "ax_specification" "define constants by specification" K.thy_goal
   260     (ax_specification_decl >> (fn (axname,(cos,alt_props)) =>
   260     (ax_specification_decl >> (fn (axname,(cos,alt_props)) =>
   261                                Toplevel.print o (Toplevel.theory_to_proof
   261                                Toplevel.print o (Toplevel.theory_to_proof
   262                                                      (process_spec (SOME axname) cos alt_props))))
   262                                                      (process_spec (SOME axname) cos alt_props))))
   263 
   263 
   264 val _ = OuterSyntax.add_parsers [specificationP,ax_specificationP]
   264 end
   265 
   265 
   266 end
   266 
   267 
   267 end
   268 
       
   269 end