src/HOLCF/Tools/Domain/domain_isomorphism.ML
changeset 35555 ec01c27bf580
parent 35515 d631dc53ede0
child 35557 5da670d57118
equal deleted inserted replaced
35533:743e8ca36b18 35555:ec01c27bf580
   103 fun isodefl_const T =
   103 fun isodefl_const T =
   104   Const (@{const_name isodefl}, (T ->> T) --> deflT --> HOLogic.boolT);
   104   Const (@{const_name isodefl}, (T ->> T) --> deflT --> HOLogic.boolT);
   105 
   105 
   106 fun mk_deflation t =
   106 fun mk_deflation t =
   107   Const (@{const_name deflation}, Term.fastype_of t --> boolT) $ t;
   107   Const (@{const_name deflation}, Term.fastype_of t --> boolT) $ t;
   108 
       
   109 fun mk_lub t =
       
   110   let
       
   111     val T = Term.range_type (Term.fastype_of t);
       
   112     val lub_const = Const (@{const_name lub}, (T --> boolT) --> T);
       
   113     val UNIV_const = @{term "UNIV :: nat set"};
       
   114     val image_type = (natT --> T) --> (natT --> boolT) --> T --> boolT;
       
   115     val image_const = Const (@{const_name image}, image_type);
       
   116   in
       
   117     lub_const $ (image_const $ t $ UNIV_const)
       
   118   end;
       
   119 
   108 
   120 (* splits a cterm into the right and lefthand sides of equality *)
   109 (* splits a cterm into the right and lefthand sides of equality *)
   121 fun dest_eqs t = HOLogic.dest_eq (HOLogic.dest_Trueprop t);
   110 fun dest_eqs t = HOLogic.dest_eq (HOLogic.dest_Trueprop t);
   122 
   111 
   123 fun mk_eqs (t, u) = HOLogic.mk_Trueprop (HOLogic.mk_eq (t, u));
   112 fun mk_eqs (t, u) = HOLogic.mk_Trueprop (HOLogic.mk_eq (t, u));