1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 set "baseuri" "cic:/matita/tests/replace/".
16 include "legacy/coq.ma".
17 alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)".
18 alias num (instance 0) = "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".
25 theorem t: \forall x:nat. x * (x + 0) = (0 + x) * (x + x * 0).
27 replace in \vdash (? ? (? ? %) (? % %)) with x.
29 rewrite < (mult_n_O x).
30 rewrite < (plus_n_O x).
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].