]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/tests/replace.ma
splitting files
[helm.git] / matita / matita / tests / replace.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
16 include "coq.ma".
17 alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)".
18 alias num (instance 0) = "Coq natural number".
19 alias symbol "eq" (instance 0) = "Coq's leibnitz's equality".
20 alias symbol "plus" (instance 0) = "Coq's natural plus".
21 alias symbol "times" (instance 0) = "Coq's natural times".
22 alias id "mult_n_O" = "cic:/Coq/Init/Peano/mult_n_O.con".
23 alias id "plus_n_O" = "cic:/Coq/Init/Peano/plus_n_O.con".
24
25 theorem t: \forall x:nat. x * (x + 0) = (0 + x) * (x + x * 0).
26  intro.
27  replace in \vdash (? ? (? ? %) (? % %)) with x.
28  reflexivity.
29  rewrite < (mult_n_O x).
30  rewrite < (plus_n_O x).
31  reflexivity.
32  reflexivity.
33  autobatch library.
34 qed.
35
36 (* This test tests "replace in match t" where t contains some metavariables *)
37 theorem t2: 2 + (3 * 4) = (5 + 5) + 2 * 2.
38  replace in match (5+?) with (6 + 4); [reflexivity | reflexivity].
39 qed.