]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/tests/rewrite.ma
0. core_notation.ma splitted into coq.moo and core_notation.moo
[helm.git] / helm / matita / tests / rewrite.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/rewrite/".
16 include "coq.ma".
17
18 alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)".
19 alias num (instance 0) = "natural number".
20 alias symbol "eq" (instance 0) = "Coq's leibnitz's equality". 
21 alias symbol "plus" (instance 0) = "Coq's natural plus".
22 alias id "plus_n_O" = "cic:/Coq/Init/Peano/plus_n_O.con".
23
24 theorem a:
25   \forall a,b:nat.
26   a = b \to b + a + b + a= (\lambda j.((\lambda w.((\lambda x.x + b + w + j) a)) b)) a.
27 intros.
28 rewrite < H in \vdash (? ? ? ((\lambda j.((\lambda w.%) ?)) ?)).
29
30 rewrite < H in \vdash (? ? % ?).
31
32 simplify in \vdash (? ? ? ((\lambda _.((\lambda _.%) ?)) ?)).
33
34 rewrite < H in \vdash (? ? ? (% ?)).
35 simplify.
36 reflexivity.
37 qed.
38  
39 theorem t: \forall n. 0=0 \to n = n + 0.
40  intros.
41  apply plus_n_O.
42 qed.
43
44 (* In this test "rewrite < t" should open a new goal 0=0 and put it in *)
45 (* the goallist so that the THEN tactical closes it using reflexivity. *)
46 theorem foo: \forall n. n = n + 0.
47  intros.
48  rewrite < t; reflexivity.
49 qed.