src/HOL/Tools/function_package/fundef_package.ML
changeset 26989 9b2acb536228
parent 26749 397a1aeede7d
child 27187 17b63e145986
equal deleted inserted replaced
26988:742e26213212 26989:9b2acb536228
   194 local structure P = OuterParse and K = OuterKeyword in
   194 local structure P = OuterParse and K = OuterKeyword in
   195 
   195 
   196 val _ = OuterSyntax.keywords ["otherwise"];
   196 val _ = OuterSyntax.keywords ["otherwise"];
   197 
   197 
   198 val _ =
   198 val _ =
   199   OuterSyntax.command "function" "define general recursive functions" K.thy_goal
   199   OuterSyntax.local_theory_to_proof "function" "define general recursive functions" K.thy_goal
   200   (fundef_parser default_config
   200   (fundef_parser default_config
   201      >> (fn ((config, fixes), (flags, statements)) =>
   201      >> (fn ((config, fixes), (flags, statements)) => add_fundef fixes statements config flags));
   202             Toplevel.local_theory_to_proof (target_of config) (add_fundef fixes statements config flags)
       
   203             #> Toplevel.print));
       
   204 
   202 
   205 val _ =
   203 val _ =
   206   OuterSyntax.command "termination" "prove termination of a recursive function" K.thy_goal
   204   OuterSyntax.local_theory_to_proof "termination" "prove termination of a recursive function" K.thy_goal
   207   (P.opt_target -- Scan.option P.term
   205   (Scan.option P.term >> termination_cmd);
   208     >> (fn (target, name) =>
       
   209            Toplevel.print o
       
   210            Toplevel.local_theory_to_proof target (termination_cmd name)));
       
   211 
   206 
   212 end;
   207 end;
   213 
   208 
   214 
   209 
   215 end
   210 end