X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=matita%2Ftests%2Fdependent_guarded_bove_capretta.ma;fp=matita%2Ftests%2Fdependent_guarded_bove_capretta.ma;h=b9cdfa50e68a85a1a57c86422220f7ba785be40c;hp=0000000000000000000000000000000000000000;hb=f61af501fb4608cc4fb062a0864c774e677f0d76;hpb=58ae1809c352e71e7b5530dc41e2bfc834e1aef1 diff --git a/matita/tests/dependent_guarded_bove_capretta.ma b/matita/tests/dependent_guarded_bove_capretta.ma new file mode 100644 index 000000000..b9cdfa50e --- /dev/null +++ b/matita/tests/dependent_guarded_bove_capretta.ma @@ -0,0 +1,50 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +include "nat/nat.ma". + +inductive T : Prop := + | l : T + | r : T-> T. + +inductive Q : nat -> T -> Prop := + | lq : Q O l + | lr : ∀n,t.Q (S (S n)) t -> Q n (r t). + +axiom F : False. + +definition xxx := λt.(match t return (λt:T.T) with + [ l => match F in False with [] + | r (t1:T) => t1]). + +let rec f (n:nat) (t:T) on t :nat := + (match n with + [ O => O + | S mmm => + f (S (S mmm)) (xxx t)]). + +let rec f (n:nat) (t:T) on t : Q n t -> nat := + (match n with + [ O => λ_.O + | S mmm => λq:Q (S mmm) (r t). + f (S (S mmm)) + (match t return (λt:T.T) with + [ l => match F in False with [] + | r (t1:T) => t1]) + + (match q return λn,t,x.Q (S (S n)) t with + [ lq => match F in False return λ_.Q (S (S n)) t with [] + | lr k t qsskt => qsskt]) + ]). +