156 |
143 |
157 fun follow_factor clause lit1 lit2 allvars thml clause_strs= |
144 fun follow_factor clause lit1 lit2 allvars thml clause_strs= |
158 let |
145 let |
159 val th = Recon_Base.assoc clause thml |
146 val th = Recon_Base.assoc clause thml |
160 val prems = prems_of th |
147 val prems = prems_of th |
|
148 val sign = sign_of_thm th |
161 val fac1 = get_nth (lit1+1) prems |
149 val fac1 = get_nth (lit1+1) prems |
162 val fac2 = get_nth (lit2+1) prems |
150 val fac2 = get_nth (lit2+1) prems |
163 val unif_env = Unify.unifiers (Mainsign,Envir.empty 0, [(fac1, fac2)]) |
151 val unif_env = Unify.unifiers (Mainsign,Envir.empty 0, [(fac1, fac2)]) |
164 val newenv = getnewenv unif_env |
152 val newenv = getnewenv unif_env |
165 val envlist = Envir.alist_of newenv |
153 val envlist = Envir.alist_of newenv |
166 |
154 |
167 val newsubsts = mksubstlist envlist [] |
155 val (t1,t2)::_ = mksubstlist envlist [] |
168 in |
156 in |
169 if (is_Var (fst(hd(newsubsts)))) |
157 if (is_Var t1) |
170 then |
158 then |
171 let |
159 let |
172 val str1 = lit_string_with_nums (fst (hd newsubsts)); |
160 val str1 = lit_string_with_nums t1; |
173 val str2 = lit_string_with_nums (snd (hd newsubsts)); |
161 val str2 = lit_string_with_nums t2; |
174 val facthm = read_instantiate [(str1,str2)] th; |
162 val facthm = read_instantiate [(str1,str2)] th; |
175 val res = hd (Seq.list_of(delete_assump_tac facthm (lit1 + 1))) |
163 val res = hd (Seq.list_of(delete_assump_tac facthm (lit1 + 1))) |
176 val (res', numlist, symlist, nsymlist) = (rearrange_clause res clause_strs allvars) |
164 val (res', numlist, symlist, nsymlist) = (rearrange_clause res clause_strs allvars) |
177 val thmvars = thm_vars res' |
165 val thmvars = thm_vars res' |
178 in |
166 in |
179 (res',((Factor (clause, lit1, lit2)),clause_strs,thmvars)) |
167 (res',((Factor (clause, lit1, lit2)),clause_strs,thmvars)) |
180 end |
168 end |
181 else |
169 else |
182 let |
170 let |
183 val str2 = lit_string_with_nums (fst (hd newsubsts)); |
171 val str2 = lit_string_with_nums t1; |
184 val str1 = lit_string_with_nums (snd (hd newsubsts)); |
172 val str1 = lit_string_with_nums t2; |
185 val facthm = read_instantiate [(str1,str2)] th; |
173 val facthm = read_instantiate [(str1,str2)] th; |
186 val res = hd (Seq.list_of(delete_assump_tac facthm (lit1 + 1))) |
174 val res = hd (Seq.list_of(delete_assump_tac facthm (lit1 + 1))) |
187 val (res', numlist, symlist, nsymlist) = (rearrange_clause res clause_strs allvars) |
175 val (res', numlist, symlist, nsymlist) = (rearrange_clause res clause_strs allvars) |
188 val thmvars = thm_vars res' |
176 val thmvars = thm_vars res' |
189 in |
177 in |
280 let val eq_lit_th = select_literal (lit1+1) cl1 |
268 let val eq_lit_th = select_literal (lit1+1) cl1 |
281 val mod_lit_th = select_literal (lit2+1) cl2 |
269 val mod_lit_th = select_literal (lit2+1) cl2 |
282 val eqsubst = eq_lit_th RSN (2,rev_subst) |
270 val eqsubst = eq_lit_th RSN (2,rev_subst) |
283 val newth = Seq.hd (biresolution false [(false, mod_lit_th)] 1 |
271 val newth = Seq.hd (biresolution false [(false, mod_lit_th)] 1 |
284 eqsubst) |
272 eqsubst) |
285 in negated_asm_of_head newth end; |
273 in Meson.negated_asm_of_head newth end; |
286 |
274 |
287 val newth = Seq.hd (biresolution false [(false, mod_lit_th)] 1 |
275 val newth = Seq.hd (biresolution false [(false, mod_lit_th)] 1 |
288 eqsubst) |
276 eqsubst) |
289 |
277 |
290 val mod_lit_th' = mod_lit_th RS not_sym |
278 val mod_lit_th' = mod_lit_th RS not_sym |