]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/tests/coercions.ma
removed "tilde_expand" hack: for the moment it is not needed (we can use $HOME)
[helm.git] / helm / matita / tests / coercions.ma
index 9e47c3e1e5b6b99ab0677a9344799b14e44bb4f1..20b15cd2650d8a7f7840d68696da39423af2248c 100644 (file)
@@ -1,3 +1,20 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+set "baseuri" "cic:/matita/tests/coercions/".
+include "legacy/coq.ma".
+
 inductive pos: Set \def
 | one : pos
 | next : pos \to pos.
@@ -17,28 +34,31 @@ let rec pos2nat x \def
   [ one \Rightarrow (S O)
   | (next z) \Rightarrow S (pos2nat z)].
 
-let rec nat2int x \def
-  match x with
-  [ O \Rightarrow positive O
-  | (S z) \Rightarrow positive (S z)].
-
-coercion pos2nat.
-
-coercion nat2int.
-
-let rec plus x y \def
-  match x with
-  [ (positive n) \Rightarrow x
-  | (negative z) \Rightarrow y].
-
-theorem a: plus O one.
-
-
-
-
+definition nat2int \def \lambda x. positive x.
 
+coercion cic:/matita/tests/coercions/pos2nat.con.
 
+coercion cic:/matita/tests/coercions/nat2int.con.
 
+definition fst \def \lambda x,y:int.x.
 
+theorem a: fst O one = fst (positive O) (next one).
+reflexivity.
+qed.
 
+definition double: 
+  \forall f:int \to int. pos \to int 
+\def 
+  \lambda f:int \to int. \lambda x : pos .f (nat2int x).
+  
+definition double1: 
+  \forall f:int \to int. pos \to int 
+\def 
+  \lambda f:int \to int. \lambda x : pos .f (pos2nat x).
 
+definition double2: 
+  \forall f:int \to int. pos \to int 
+\def 
+  \lambda f:int \to int. \lambda x : pos .f (nat2int (pos2nat x)).
+  
+