"unify_first_prem_with_concl" (cf. 9ceb585c097a) sometimes throws an exception, but it is very rarely needed -- catch the exception for now
authorblanchet
Thu, 14 Apr 2011 11:24:05 +0200
changeset 42344 4a58173ffb99
parent 42343 118cc349de35
child 42345 5ecd55993606
"unify_first_prem_with_concl" (cf. 9ceb585c097a) sometimes throws an exception, but it is very rarely needed -- catch the exception for now
src/HOL/Tools/Metis/metis_reconstruct.ML
--- a/src/HOL/Tools/Metis/metis_reconstruct.ML	Thu Apr 14 11:24:05 2011 +0200
+++ b/src/HOL/Tools/Metis/metis_reconstruct.ML	Thu Apr 14 11:24:05 2011 +0200
@@ -652,8 +652,9 @@
       | (Var _, _) => add_terms (t, u)
       | (_, Var _) => add_terms (u, t)
       | _ => I
-    val t_inst = [] |> unify_terms (prem, concl)
-                    |> map (pairself (cterm_of thy))
+    val t_inst =
+      [] |> try (unify_terms (prem, concl) #> map (pairself (cterm_of thy)))
+         |> the_default [] (* FIXME *)
   in th |> cterm_instantiate t_inst end
 
 val copy_prem = @{lemma "P ==> (P ==> P ==> Q) ==> Q" by fast}