equal
deleted
inserted
replaced
159 by (simp_tac |
159 by (simp_tac |
160 (!simpset addsimps [unifyRel_def, lex_prod_def, measure_def, |
160 (!simpset addsimps [unifyRel_def, lex_prod_def, measure_def, |
161 inv_image_def, less_eq]) 1); |
161 inv_image_def, less_eq]) 1); |
162 (** LEVEL 7 **) |
162 (** LEVEL 7 **) |
163 (*Comb-Comb case*) |
163 (*Comb-Comb case*) |
164 by (asm_simp_tac (!simpset addsplits [expand_option_case]) 1); |
164 by (asm_simp_tac (!simpset addsplits [split_option_case]) 1); |
165 by (strip_tac 1); |
165 by (strip_tac 1); |
166 by (rtac (trans_unifyRel RS transD) 1); |
166 by (rtac (trans_unifyRel RS transD) 1); |
167 by (Blast_tac 1); |
167 by (Blast_tac 1); |
168 by (simp_tac (HOL_ss addsimps [subst_Comb RS sym]) 1); |
168 by (simp_tac (HOL_ss addsimps [subst_Comb RS sym]) 1); |
169 by (rtac Rassoc 1); |
169 by (rtac Rassoc 1); |
182 \ of None => None \ |
182 \ of None => None \ |
183 \ | Some theta => (case unify(N1 <| theta, N2 <| theta) \ |
183 \ | Some theta => (case unify(N1 <| theta, N2 <| theta) \ |
184 \ of None => None \ |
184 \ of None => None \ |
185 \ | Some sigma => Some (theta <> sigma)))"; |
185 \ | Some sigma => Some (theta <> sigma)))"; |
186 by (asm_simp_tac (!simpset addsimps (unify_TC::unifyRules0) |
186 by (asm_simp_tac (!simpset addsimps (unify_TC::unifyRules0) |
187 addsplits [expand_option_case]) 1); |
187 addsplits [split_option_case]) 1); |
188 qed "unifyCombComb"; |
188 qed "unifyCombComb"; |
189 |
189 |
190 |
190 |
191 val unifyRules = rev (unifyCombComb :: tl (rev unifyRules0)); |
191 val unifyRules = rev (unifyCombComb :: tl (rev unifyRules0)); |
192 |
192 |
218 (*Comb-Var case*) |
218 (*Comb-Var case*) |
219 by (stac mgu_sym 1); |
219 by (stac mgu_sym 1); |
220 by (simp_tac (!simpset addsimps [MGUnifier_Var]) 1); |
220 by (simp_tac (!simpset addsimps [MGUnifier_Var]) 1); |
221 (** LEVEL 8 **) |
221 (** LEVEL 8 **) |
222 (*Comb-Comb case*) |
222 (*Comb-Comb case*) |
223 by (asm_simp_tac (!simpset addsplits [expand_option_case]) 1); |
223 by (asm_simp_tac (!simpset addsplits [split_option_case]) 1); |
224 by (strip_tac 1); |
224 by (strip_tac 1); |
225 by (rotate_tac ~2 1); |
225 by (rotate_tac ~2 1); |
226 by (asm_full_simp_tac |
226 by (asm_full_simp_tac |
227 (!simpset addsimps [MGUnifier_def, Unifier_def, MoreGeneral_def]) 1); |
227 (!simpset addsimps [MGUnifier_def, Unifier_def, MoreGeneral_def]) 1); |
228 by (safe_tac (!claset) THEN rename_tac "theta sigma gamma" 1); |
228 by (safe_tac (!claset) THEN rename_tac "theta sigma gamma" 1); |
244 goal Unify.thy "!theta. unify(M,N) = Some theta --> Idem theta"; |
244 goal Unify.thy "!theta. unify(M,N) = Some theta --> Idem theta"; |
245 by (res_inst_tac [("u","M"),("v","N")] unifyInduct 1); |
245 by (res_inst_tac [("u","M"),("v","N")] unifyInduct 1); |
246 by (ALLGOALS |
246 by (ALLGOALS |
247 (asm_simp_tac |
247 (asm_simp_tac |
248 (!simpset addsimps [Var_Idem] |
248 (!simpset addsimps [Var_Idem] |
249 addsplits [expand_if,expand_option_case]))); |
249 addsplits [expand_if,split_option_case]))); |
250 (*Comb-Comb case*) |
250 (*Comb-Comb case*) |
251 by (safe_tac (!claset)); |
251 by (safe_tac (!claset)); |
252 by (REPEAT (dtac spec 1 THEN mp_tac 1)); |
252 by (REPEAT (dtac spec 1 THEN mp_tac 1)); |
253 by (safe_tac (!claset addSDs [rewrite_rule [MGUnifier_def] unify_gives_MGU])); |
253 by (safe_tac (!claset addSDs [rewrite_rule [MGUnifier_def] unify_gives_MGU])); |
254 by (rtac Idem_comp 1); |
254 by (rtac Idem_comp 1); |