X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_refiner%2Fesempio.ma;h=8f9604a8524817acdbc1489a7613b43239981310;hb=c22f39a5d5afc0ef55beb221e00e2e6703b13d90;hp=613448a61a1a59b18cde474687b6973c44a4395f;hpb=7d470885cbbe8c7c102c390eef61e26bff1686c0;p=helm.git diff --git a/helm/software/components/ng_refiner/esempio.ma b/helm/software/components/ng_refiner/esempio.ma index 613448a61..8f9604a85 100644 --- a/helm/software/components/ng_refiner/esempio.ma +++ b/helm/software/components/ng_refiner/esempio.ma @@ -15,15 +15,53 @@ include "nat/plus.ma". definition hole : ∀A:Type.A → A ≝ λA.λx.x. +definition id : ∀A:Type.A → A ≝ λA.λx.x. +(* Common case in dama, reduction with metas +inductive list : Type := nil : list | cons : nat -> list -> list. +let rec len l := match l with [ nil => O | cons _ l => S (len l) ]. +axiom lt : nat -> nat -> Prop. +axiom foo : ∀x. Not (lt (hole ? x) (hole ? O)) = (lt x (len nil) -> False). +*) + +(* meta1 Vs meta2 with different contexts axiom foo: ∀P:Type.∀f:P→P→Prop.∀x:P. (λw. ((∀e:P.f x (w x)) = (∀y:P. f x (hole ? y)))) - (λw:P.hole ? w). (* OK *) - + (λw:P.hole ? w). +*) + +(* meta1 Vs meta1 with different local contexts axiom foo: ∀P:Type.∀f:P→P→P.∀x,y:P. - (λw.(f x (w x) = f x (w y))) (λw:P.hole ? w). (* OK, restringe Rel1 *) + (λw.(f x (w x) = f x (w y))) (λw:P.hole ? w). +*) + +(* meta Vs term && term Vs meta with different local ctx +axiom foo: + ∀P:Type.∀f:P→P→P.∀x,y:P. + (λw.(f (w x) (hole ? x) = f x (w y))) (λw:P.hole ? w). +*) + +(* occur check +axiom foo: + ∀P:Type.∀f:P→P→P.∀x,y:P. + (λw.(f x (f (w x) x) = f x (w y))) (λw:P.hole ? w). +*) + +(* unifying the type of (y ?) with (Q x) we instantiate ? to x +axiom foo: + ∀P:Type.∀Q:P→Type.∀f:∀x:P.Q x→P→P.∀x:P.∀y:∀x.Q x. + (λw.(f w (y w) x = (id ? f) x (hole ? (y x)) x)) (hole ? x). +*) + +alias num (instance 0) = "natural number". +axiom foo: (100+111) = (100+110). + + + (id ?(id ?(id ?(id ? (100+100))))) = + (id ?(id ?(id ?(id ? (99+100))))).[3: + apply (refl_eq nat (id ?(id ?(id ?(id ? (98+102+?)))))); axiom foo: (λx,y.(λz. z (x+y) + z x) (λw:nat.hole ? w)) = λx,y.x. (* OK *) axiom foo: (λx,y.(λz. z x + z (x+y)) (λw:nat.hole ? w)) = λx,y.x. (* KO, delift rels only *)