src/HOL/Tools/BNF/bnf_gfp_rec_sugar.ML
changeset 58394 f0c51576964a
parent 58393 dafe52a76ae7
child 58459 f70bffabd7cf
equal deleted inserted replaced
58393:dafe52a76ae7 58394:f0c51576964a
  1451 
  1451 
  1452 val primcorec_option_parser = Parse.group (fn () => "option")
  1452 val primcorec_option_parser = Parse.group (fn () => "option")
  1453   (Parse.reserved "sequential" >> K Sequential_Option
  1453   (Parse.reserved "sequential" >> K Sequential_Option
  1454   || Parse.reserved "exhaustive" >> K Exhaustive_Option)
  1454   || Parse.reserved "exhaustive" >> K Exhaustive_Option)
  1455 
  1455 
       
  1456 (* FIXME: should use "Parse_Spec.spec" instead of "Parse.prop" and honor binding *)
  1456 val where_alt_specs_of_parser = Parse.where_ |-- Parse.!!! (Parse.enum1 "|"
  1457 val where_alt_specs_of_parser = Parse.where_ |-- Parse.!!! (Parse.enum1 "|"
  1457   (Parse_Spec.spec -- Scan.option (Parse.reserved "of" |-- Parse.const)));
  1458   ((Parse.prop >> pair Attrib.empty_binding) -- Scan.option (Parse.reserved "of" |-- Parse.const)));
  1458 
  1459 
  1459 val _ = Outer_Syntax.local_theory_to_proof @{command_spec "primcorecursive"}
  1460 val _ = Outer_Syntax.local_theory_to_proof @{command_spec "primcorecursive"}
  1460   "define primitive corecursive functions"
  1461   "define primitive corecursive functions"
  1461   ((Scan.optional (@{keyword "("} |--
  1462   ((Scan.optional (@{keyword "("} |--
  1462       Parse.!!! (Parse.list1 primcorec_option_parser) --| @{keyword ")"}) []) --
  1463       Parse.!!! (Parse.list1 primcorec_option_parser) --| @{keyword ")"}) []) --