842 (atoms ~~ perm_closed_thmss)); |
842 (atoms ~~ perm_closed_thmss)); |
843 |
843 |
844 (* prove distinctness theorems *) |
844 (* prove distinctness theorems *) |
845 |
845 |
846 val distinct_props = DatatypeProp.make_distincts descr' sorts'; |
846 val distinct_props = DatatypeProp.make_distincts descr' sorts'; |
847 val dist_rewrites = map (fn (rep_thms, dist_lemma) => |
847 val dist_rewrites = map2 (fn rep_thms => fn dist_lemma => |
848 dist_lemma::(rep_thms @ [In0_eq, In1_eq, In0_not_In1, In1_not_In0])) |
848 dist_lemma :: rep_thms @ [In0_eq, In1_eq, In0_not_In1, In1_not_In0]) |
849 (constr_rep_thmss ~~ dist_lemmas); |
849 constr_rep_thmss dist_lemmas; |
850 |
850 |
851 fun prove_distinct_thms _ (_, []) = [] |
851 fun prove_distinct_thms _ (_, []) = [] |
852 | prove_distinct_thms (p as (rep_thms, dist_lemma)) (k, t :: ts) = |
852 | prove_distinct_thms (p as (rep_thms, dist_lemma)) (k, t :: ts) = |
853 let |
853 let |
854 val dist_thm = Goal.prove_global thy8 [] [] t (fn _ => |
854 val dist_thm = Goal.prove_global thy8 [] [] t (fn _ => |
855 simp_tac (simpset_of thy8 addsimps (dist_lemma :: rep_thms)) 1) |
855 simp_tac (simpset_of thy8 addsimps (dist_lemma :: rep_thms)) 1) |
856 in dist_thm :: (standard (dist_thm RS not_sym)) :: |
856 in dist_thm :: standard (dist_thm RS not_sym) :: |
857 (prove_distinct_thms p (k, ts)) |
857 prove_distinct_thms p (k, ts) |
858 end; |
858 end; |
859 |
859 |
860 val distinct_thms = map2 prove_distinct_thms |
860 val distinct_thms = map2 prove_distinct_thms |
861 (constr_rep_thmss ~~ dist_lemmas) distinct_props; |
861 (constr_rep_thmss ~~ dist_lemmas) distinct_props; |
862 |
862 |