src/HOLCF/Tools/Domain/domain_isomorphism.ML
changeset 35657 0537c34c6067
parent 35654 7a15e181bf3b
child 35658 3d8da9fac424
equal deleted inserted replaced
35656:b62731352812 35657:0537c34c6067
     5 *)
     5 *)
     6 
     6 
     7 signature DOMAIN_ISOMORPHISM =
     7 signature DOMAIN_ISOMORPHISM =
     8 sig
     8 sig
     9   val domain_isomorphism :
     9   val domain_isomorphism :
    10     (string list * binding * mixfix * typ * (binding * binding) option) list
    10       (string list * binding * mixfix * typ
    11       -> theory -> Domain_Take_Proofs.iso_info list * theory
    11        * (binding * binding) option) list ->
       
    12       theory ->
       
    13       (Domain_Take_Proofs.iso_info list
       
    14        * Domain_Take_Proofs.take_induct_info) * theory
       
    15 
    12   val domain_isomorphism_cmd :
    16   val domain_isomorphism_cmd :
    13     (string list * binding * mixfix * string * (binding * binding) option) list
    17     (string list * binding * mixfix * string * (binding * binding) option) list
    14       -> theory -> theory
    18       -> theory -> theory
    15   val add_type_constructor :
    19   val add_type_constructor :
    16     (string * term * string * thm  * thm * thm * thm) -> theory -> theory
    20     (string * term * string * thm  * thm * thm * thm) -> theory -> theory
   263 
   267 
   264 fun gen_domain_isomorphism
   268 fun gen_domain_isomorphism
   265     (prep_typ: theory -> 'a -> (string * sort) list -> typ * (string * sort) list)
   269     (prep_typ: theory -> 'a -> (string * sort) list -> typ * (string * sort) list)
   266     (doms_raw: (string list * binding * mixfix * 'a * (binding * binding) option) list)
   270     (doms_raw: (string list * binding * mixfix * 'a * (binding * binding) option) list)
   267     (thy: theory)
   271     (thy: theory)
   268     : Domain_Take_Proofs.iso_info list * theory =
   272     : (Domain_Take_Proofs.iso_info list
       
   273        * Domain_Take_Proofs.take_induct_info) * theory =
   269   let
   274   let
   270     val _ = Theory.requires thy "Representable" "domain isomorphisms";
   275     val _ = Theory.requires thy "Representable" "domain isomorphisms";
   271 
   276 
   272     (* this theory is used just for parsing *)
   277     (* this theory is used just for parsing *)
   273     val tmp_thy = thy |>
   278     val tmp_thy = thy |>
   647     (* prove additional take theorems *)
   652     (* prove additional take theorems *)
   648     val (take_info2, thy) =
   653     val (take_info2, thy) =
   649         Domain_Take_Proofs.add_lub_take_theorems
   654         Domain_Take_Proofs.add_lub_take_theorems
   650           (dom_binds ~~ iso_infos) take_info lub_take_thms thy;
   655           (dom_binds ~~ iso_infos) take_info lub_take_thms thy;
   651   in
   656   in
   652     (iso_infos, thy)
   657     ((iso_infos, take_info2), thy)
   653   end;
   658   end;
   654 
   659 
   655 val domain_isomorphism = gen_domain_isomorphism cert_typ;
   660 val domain_isomorphism = gen_domain_isomorphism cert_typ;
   656 val domain_isomorphism_cmd = snd oo gen_domain_isomorphism read_typ;
   661 val domain_isomorphism_cmd = snd oo gen_domain_isomorphism read_typ;
   657 
   662