equal
deleted
inserted
replaced
104 (**** integ_of_bin ****) |
104 (**** integ_of_bin ****) |
105 |
105 |
106 |
106 |
107 qed_goal "integ_of_bin_norm_Bcons" Bin.thy |
107 qed_goal "integ_of_bin_norm_Bcons" Bin.thy |
108 "integ_of_bin(norm_Bcons w b) = integ_of_bin(Bcons w b)" |
108 "integ_of_bin(norm_Bcons w b) = integ_of_bin(Bcons w b)" |
109 (fn _ =>[(bin.induct_tac "w" 1), |
109 (fn _ =>[(induct_tac "w" 1), |
110 (ALLGOALS Simp_tac) ]); |
110 (ALLGOALS Simp_tac) ]); |
111 |
111 |
112 qed_goal "integ_of_bin_succ" Bin.thy |
112 qed_goal "integ_of_bin_succ" Bin.thy |
113 "integ_of_bin(bin_succ w) = $#1 + integ_of_bin w" |
113 "integ_of_bin(bin_succ w) = $#1 + integ_of_bin w" |
114 (fn _ =>[(rtac bin.induct 1), |
114 (fn _ =>[(rtac bin.induct 1), |
138 integ_of_bin_norm_Bcons]; |
138 integ_of_bin_norm_Bcons]; |
139 val bin_simps = [iob_Plus,iob_Minus,iob_Bcons]; |
139 val bin_simps = [iob_Plus,iob_Minus,iob_Bcons]; |
140 |
140 |
141 Goal |
141 Goal |
142 "! w. integ_of_bin(bin_add v w) = integ_of_bin v + integ_of_bin w"; |
142 "! w. integ_of_bin(bin_add v w) = integ_of_bin v + integ_of_bin w"; |
143 by (bin.induct_tac "v" 1); |
143 by (induct_tac "v" 1); |
144 by (simp_tac (simpset() addsimps bin_add_simps) 1); |
144 by (simp_tac (simpset() addsimps bin_add_simps) 1); |
145 by (simp_tac (simpset() addsimps bin_add_simps) 1); |
145 by (simp_tac (simpset() addsimps bin_add_simps) 1); |
146 by (rtac allI 1); |
146 by (rtac allI 1); |
147 by (bin.induct_tac "w" 1); |
147 by (induct_tac "w" 1); |
148 by (asm_simp_tac (simpset() addsimps (bin_add_simps)) 1); |
148 by (asm_simp_tac (simpset() addsimps (bin_add_simps)) 1); |
149 by (asm_simp_tac (simpset() addsimps (bin_add_simps @ zadd_ac)) 1); |
149 by (asm_simp_tac (simpset() addsimps (bin_add_simps @ zadd_ac)) 1); |
150 by (cut_inst_tac [("P","bool")] True_or_False 1); |
150 by (cut_inst_tac [("P","bool")] True_or_False 1); |
151 by (etac disjE 1); |
151 by (etac disjE 1); |
152 by (asm_simp_tac (simpset() addsimps (bin_add_simps @ zadd_ac)) 1); |
152 by (asm_simp_tac (simpset() addsimps (bin_add_simps @ zadd_ac)) 1); |
160 |
160 |
161 val bin_mult_simps = [integ_of_bin_minus, integ_of_bin_add, |
161 val bin_mult_simps = [integ_of_bin_minus, integ_of_bin_add, |
162 integ_of_bin_norm_Bcons]; |
162 integ_of_bin_norm_Bcons]; |
163 |
163 |
164 Goal "integ_of_bin(bin_mult v w) = integ_of_bin v * integ_of_bin w"; |
164 Goal "integ_of_bin(bin_mult v w) = integ_of_bin v * integ_of_bin w"; |
165 by (bin.induct_tac "v" 1); |
165 by (induct_tac "v" 1); |
166 by (simp_tac (simpset() addsimps bin_mult_simps) 1); |
166 by (simp_tac (simpset() addsimps bin_mult_simps) 1); |
167 by (simp_tac (simpset() addsimps bin_mult_simps) 1); |
167 by (simp_tac (simpset() addsimps bin_mult_simps) 1); |
168 by (cut_inst_tac [("P","bool")] True_or_False 1); |
168 by (cut_inst_tac [("P","bool")] True_or_False 1); |
169 by (etac disjE 1); |
169 by (etac disjE 1); |
170 by (asm_simp_tac (simpset() addsimps (bin_mult_simps @ [zadd_zmult_distrib])) 2); |
170 by (asm_simp_tac (simpset() addsimps (bin_mult_simps @ [zadd_zmult_distrib])) 2); |