]> matita.cs.unibo.it Git - helm.git/blob - matita/tests/generalize.ma
Missing optimization implemented: before starting to analyze the disambiguation
[helm.git] / matita / tests / generalize.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/generalize".
16 include "legacy/coq.ma".
17
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 id "plus_comm" = "cic:/Coq/Arith/Plus/plus_comm.con".
22 alias id "S" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1/2)".
23
24 (* This tests is for the case of a pattern that contains metavariables *)
25 theorem t: \forall x. x + 4 = 4 + x.
26  intro.
27  generalize in match (S ?).
28  intro; apply plus_comm.
29 qed. 
30  
31 (* This test used to fail because x was used in the wrong context *)
32 (* Once this was fixed it still did not work since apply is not   *)
33 (* able to solve a goal that ends in a product.                   *)
34 theorem test2: \forall x. 4 + x = x + 4.
35  generalize in match 4.
36  exact plus_comm.
37 qed.