X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Fmatita%2Ftests%2Felim.ma;h=7c4031971307cd524eeca3379431c823ad7d2e1f;hb=5a702cea95883f7095c16b450e065ccb1714fc5a;hp=d7dd320e227ace04d856832fb7604015795401e0;hpb=42e7448a9e2eb9c44a336f0f3e56c9249f46fcc6;p=helm.git diff --git a/helm/matita/tests/elim.ma b/helm/matita/tests/elim.ma index d7dd320e2..7c4031971 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,15 +13,16 @@ (**************************************************************************) set "baseuri" "cic:/matita/tests/elim". +include "coq.ma". inductive stupidtype: Set \def | Base : stupidtype | Next : stupidtype \to stupidtype | Pair : stupidtype \to stupidtype \to stupidtype. -alias symbol "eq" (instance 0) = "leibnitz's equality". -alias symbol "exists" (instance 0) = "exists". -alias symbol "or" (instance 0) = "logical or". +alias symbol "eq" (instance 0) = "Coq's leibnitz's equality". +alias symbol "exists" (instance 0) = "Coq's exists". +alias symbol "or" (instance 0) = "Coq's logical or". alias num (instance 0) = "natural number". alias id "True" = "cic:/Coq/Init/Logic/True.ind#xpointer(1/1)". alias id "refl_equal" = "cic:/Coq/Init/Logic/eq.ind#xpointer(1/1/1)". @@ -38,9 +39,9 @@ elim a. clear a.left.left. reflexivity. clear H.clear H1.clear a.right. - exists.exact e2.exists.exact e1.reflexivity. + exists.exact s.exists.exact s1.reflexivity. clear H.clear a.left.right. - exists.exact e3.reflexivity. + exists.exact s.reflexivity. qed. theorem t: 0=0 \to stupidtype. @@ -52,3 +53,27 @@ 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). + simplify. intros. + generalize in match H1. + rewrite < H2; rewrite < H3.intro. + rewrite > H4.auto. +qed.