equal
deleted
inserted
replaced
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 |