src/HOL/Tools/hologic.ML
changeset 55411 27de2c976d90
parent 54489 03ff4d1e6784
child 55414 eab03e9cee8a
equal deleted inserted replaced
55410:54b09e82b9e1 55411:27de2c976d90
   346 fun dest_prod (Const ("Product_Type.Pair", _) $ t1 $ t2) = (t1, t2)
   346 fun dest_prod (Const ("Product_Type.Pair", _) $ t1 $ t2) = (t1, t2)
   347   | dest_prod t = raise TERM ("dest_prod", [t]);
   347   | dest_prod t = raise TERM ("dest_prod", [t]);
   348 
   348 
   349 fun mk_fst p =
   349 fun mk_fst p =
   350   let val pT = fastype_of p in
   350   let val pT = fastype_of p in
   351     Const ("Product_Type.fst", pT --> fst (dest_prodT pT)) $ p
   351     Const ("Product_Type.prod.fst", pT --> fst (dest_prodT pT)) $ p
   352   end;
   352   end;
   353 
   353 
   354 fun mk_snd p =
   354 fun mk_snd p =
   355   let val pT = fastype_of p in
   355   let val pT = fastype_of p in
   356     Const ("Product_Type.snd", pT --> snd (dest_prodT pT)) $ p
   356     Const ("Product_Type.prod.snd", pT --> snd (dest_prodT pT)) $ p
   357   end;
   357   end;
   358 
   358 
   359 fun split_const (A, B, C) =
   359 fun split_const (A, B, C) =
   360   Const ("Product_Type.prod.prod_case", (A --> B --> C) --> mk_prodT (A, B) --> C);
   360   Const ("Product_Type.prod.prod_case", (A --> B --> C) --> mk_prodT (A, B) --> C);
   361 
   361