src/HOLCF/Tools/Domain/domain_library.ML
changeset 38557 9926c47ad1a1
parent 38549 d0385f2764d8
child 38795 848be46708dc
equal deleted inserted replaced
38556:dc92eee56ed7 38557:9926c47ad1a1
   120     let
   120     let
   121       val r_inst = read_instantiate ctxt;
   121       val r_inst = read_instantiate ctxt;
   122       fun at thm =
   122       fun at thm =
   123           case concl_of thm of
   123           case concl_of thm of
   124             _$(Const(@{const_name "op &"},_)$_$_)       => at(thm RS conjunct1)@at(thm RS conjunct2)
   124             _$(Const(@{const_name "op &"},_)$_$_)       => at(thm RS conjunct1)@at(thm RS conjunct2)
   125           | _$(Const(@{const_name "All"} ,_)$Abs(s,_,_))=> at(thm RS (r_inst [(("x", 0), "?" ^ s)] spec))
   125           | _$(Const(@{const_name All} ,_)$Abs(s,_,_))=> at(thm RS (r_inst [(("x", 0), "?" ^ s)] spec))
   126           | _                             => [thm];
   126           | _                             => [thm];
   127     in map zero_var_indexes (at thm) end;
   127     in map zero_var_indexes (at thm) end;
   128 
   128 
   129 exception Impossible of string;
   129 exception Impossible of string;
   130 fun Imposs msg = raise Impossible ("Domain:"^msg);
   130 fun Imposs msg = raise Impossible ("Domain:"^msg);
   183 fun mk_disj (S,T) = disj $ S $ T;
   183 fun mk_disj (S,T) = disj $ S $ T;
   184 fun mk_imp  (S,T) = imp  $ S $ T;
   184 fun mk_imp  (S,T) = imp  $ S $ T;
   185 fun mk_lam  (x,T) = Abs(x,dummyT,T);
   185 fun mk_lam  (x,T) = Abs(x,dummyT,T);
   186 fun mk_all  (x,P) = HOLogic.mk_all (x,dummyT,P);
   186 fun mk_all  (x,P) = HOLogic.mk_all (x,dummyT,P);
   187 fun mk_ex   (x,P) = mk_exists (x,dummyT,P);
   187 fun mk_ex   (x,P) = mk_exists (x,dummyT,P);
   188 fun mk_constrainall (x,typ,P) = %%:"All" $ (Type_Infer.constrain (typ --> boolT) (mk_lam(x,P)));
   188 fun mk_constrainall (x,typ,P) = %%: @{const_name All} $ (Type_Infer.constrain (typ --> boolT) (mk_lam(x,P)));
   189 end
   189 end
   190 
   190 
   191 fun mk_All  (x,P) = %%:"all" $ mk_lam(x,P); (* meta universal quantification *)
   191 fun mk_All  (x,P) = %%:"all" $ mk_lam(x,P); (* meta universal quantification *)
   192 
   192 
   193 infixr 0 ===>;  fun S ===> T = %%:"==>" $ S $ T;
   193 infixr 0 ===>;  fun S ===> T = %%:"==>" $ S $ T;