X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Ftests%2Felim.ma;h=9d48bc970ecd46c576942a3911f45b7d974527fe;hb=97c2d258a5c524eb5c4b85208899d80751a2c82f;hp=ab7afafa69e34cf52a33b9530ffaa2aa4e5ab9b6;hpb=cec61c8b027b15b98d308cee8900d9cf35a02d28;p=helm.git diff --git a/helm/matita/tests/elim.ma b/helm/matita/tests/elim.ma index ab7afafa6..9d48bc970 100644 --- a/helm/matita/tests/elim.ma +++ b/helm/matita/tests/elim.ma @@ -1,5 +1,5 @@ (**************************************************************************) -(* ___ *) +(* ___ *) (* ||M|| *) (* ||A|| A project by Andrea Asperti *) (* ||T|| *) @@ -13,6 +13,7 @@ (**************************************************************************) set "baseuri" "cic:/matita/tests/elim". +include "coq.ma". inductive stupidtype: Set \def | Base : stupidtype @@ -37,10 +38,10 @@ intros. elim a. clear a.left.left. reflexivity. -clear H.clear H1.clear a.right. - exists.exact s.exists.exact s1.reflexivity. clear H.clear a.left.right. exists.exact s.reflexivity. +clear H.clear H1.clear a.right. + exists.exact s.exists.exact s1.reflexivity. qed. theorem t: 0=0 \to stupidtype. @@ -52,3 +53,28 @@ qed. theorem foo: let ax \def refl_equal ? 0 in t ax = t ax. elim t; reflexivity. qed. + +(* This test shows a bug where elim opens a new unus{ed,eful} goal *) + +alias symbol "eq" (instance 0) = "Coq's leibnitz's equality". +alias id "O" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1/1)". + +inductive sum (n:nat) : nat \to nat \to Set \def + k: \forall x,y. n = x + y \to sum n x y. + +theorem t': \forall x,y. \forall H: sum x y O. + match H with [ (k a b p) \Rightarrow a ] = x. + intros. + cut (y = y \to O = O \to match H with [ (k a b p) \Rightarrow a] = x). + apply Hcut; reflexivity. + apply + (sum_ind ? + (\lambda a,b,K. y=a \to O=b \to + match K with [ (k a b p) \Rightarrow a ] = x) + ? ? ? H). + goal 16. + simplify. intros. + generalize in match H1. + rewrite < H2; rewrite < H3.intro. + rewrite > H4.auto. +qed.