src/HOL/Tools/Quickcheck/quickcheck_common.ML
changeset 48272 db75b4005d9a
parent 47204 6212bcc94bb0
child 50046 0051dc4f301f
equal deleted inserted replaced
48271:b28defd0b5a5 48272:db75b4005d9a
   447     val vs = (map o apsnd) (curry (Sorts.inter_sort algebra) sort_vs) raw_vs
   447     val vs = (map o apsnd) (curry (Sorts.inter_sort algebra) sort_vs) raw_vs
   448     fun insts_of sort constr  = (map (rpair sort) o flat o maps snd o maps snd)
   448     fun insts_of sort constr  = (map (rpair sort) o flat o maps snd o maps snd)
   449       (Datatype_Aux.interpret_construction descr vs constr)
   449       (Datatype_Aux.interpret_construction descr vs constr)
   450     val insts = insts_of sort  { atyp = single, dtyp = (K o K o K) [] }
   450     val insts = insts_of sort  { atyp = single, dtyp = (K o K o K) [] }
   451       @ insts_of aux_sort { atyp = K [], dtyp = K o K }
   451       @ insts_of aux_sort { atyp = K [], dtyp = K o K }
   452     val has_inst = exists (fn tyco => can (Sorts.mg_domain algebra tyco) sort) tycos;
   452     val has_inst = exists (fn tyco => Sorts.has_instance algebra tyco sort) tycos;
   453   in if has_inst then thy
   453   in if has_inst then thy
   454     else case perhaps_constrain thy insts vs
   454     else case perhaps_constrain thy insts vs
   455      of SOME constrain => instantiate config descr
   455      of SOME constrain => instantiate config descr
   456           (map constrain vs) tycos prfx (names, auxnames)
   456           (map constrain vs) tycos prfx (names, auxnames)
   457             ((pairself o map o map_atyps) (fn TFree v => TFree (constrain v)) raw_TUs) thy
   457             ((pairself o map o map_atyps) (fn TFree v => TFree (constrain v)) raw_TUs) thy