]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/tests/coercions.ma
ocaml 3.09 transition
[helm.git] / helm / matita / tests / coercions.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 set "baseuri" "cic:/matita/tests/coercions/".
16 include "coq.ma".
17
18 inductive pos: Set \def
19 | one : pos
20 | next : pos \to pos.
21
22 inductive nat:Set \def
23 | O : nat
24 | S : nat \to nat.
25
26 inductive int: Set \def
27 | positive: nat \to int
28 | negative : nat \to int.
29
30 inductive empty : Set \def .
31
32 let rec pos2nat x \def 
33   match x with  
34   [ one \Rightarrow (S O)
35   | (next z) \Rightarrow S (pos2nat z)].
36
37 definition nat2int \def \lambda x. positive x.
38
39 coercion pos2nat.
40
41 coercion nat2int.
42
43 definition fst \def \lambda x,y:int.x.
44
45 theorem a: fst O one = fst (positive O) (next one).
46 reflexivity.
47 qed.