src/HOL/Tools/Quickcheck/abstract_generators.ML
changeset 46949 94aa7b81bcf6
parent 46565 ad21900e0ee9
child 46961 5c6955f487e5
equal deleted inserted replaced
46948:aae5566d6756 46949:94aa7b81bcf6
    64 val quickcheck_generator_cmd = gen_quickcheck_generator
    64 val quickcheck_generator_cmd = gen_quickcheck_generator
    65   (fn ctxt => fst o dest_Type o Proof_Context.read_type_name_proper ctxt false) Syntax.read_term
    65   (fn ctxt => fst o dest_Type o Proof_Context.read_type_name_proper ctxt false) Syntax.read_term
    66   
    66   
    67 val _ = Outer_Syntax.command "quickcheck_generator" "define quickcheck generators for abstract types"
    67 val _ = Outer_Syntax.command "quickcheck_generator" "define quickcheck generators for abstract types"
    68     Keyword.thy_decl ((Parse.type_const --
    68     Keyword.thy_decl ((Parse.type_const --
    69       Scan.option (Args.$$$ "predicate" |-- Parse.$$$ ":" |-- Parse.term)) --
    69       Scan.option (Args.$$$ "predicate" |-- @{keyword ":"} |-- Parse.term)) --
    70       (Args.$$$ "constructors" |-- Parse.$$$ ":" |-- Parse.list1 Parse.term)
    70       (Args.$$$ "constructors" |-- @{keyword ":"} |-- Parse.list1 Parse.term)
    71       >> (fn ((tyco, opt_pred), constrs) =>
    71       >> (fn ((tyco, opt_pred), constrs) =>
    72         Toplevel.theory (quickcheck_generator_cmd tyco opt_pred constrs)))
    72         Toplevel.theory (quickcheck_generator_cmd tyco opt_pred constrs)))
    73 
    73 
    74 end;
    74 end;