]> matita.cs.unibo.it Git - helm.git/blob - components/tactics/paramodulation/equality.mli
1a62ee2ff0e2a7e159e059ca2db41cafe7a95e7b
[helm.git] / components / tactics / paramodulation / equality.mli
1 (* Copyright (C) 2006, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://helm.cs.unibo.it/
24  *)
25
26 type rule = SuperpositionRight | SuperpositionLeft | Demodulation
27
28 type equality 
29
30 and proof =
31     Exact of Cic.term
32   | Step of Subst.substitution * (rule * int * (Utils.pos * int) * Cic.term)
33
34 and goal_proof = (rule * Utils.pos * int * Subst.substitution * Cic.term) list
35
36 type goal = goal_proof * Cic.metasenv * Cic.term
37
38 val pp_proof: 
39   (Cic.name option) list -> goal_proof -> proof -> Subst.substitution -> int ->
40     Cic.term -> string
41
42 val reset : unit -> unit
43
44 val mk_equality :
45   int * proof * 
46   (Cic.term * Cic.term * Cic.term * Utils.comparison) *
47   Cic.metasenv -> 
48     equality
49
50 val mk_tmp_equality :
51   int * (Cic.term * Cic.term * Cic.term * Utils.comparison) * Cic.metasenv -> 
52     equality
53     
54 val open_equality :
55   equality ->
56     int * proof * 
57     (Cic.term * Cic.term * Cic.term * Utils.comparison) *
58     Cic.metasenv * int
59 val depend : equality -> int -> bool
60 val compare : equality -> equality -> int
61 val string_of_equality : ?env:Utils.environment -> equality -> string
62 val string_of_proof : 
63   ?names:(Cic.name option)list -> proof -> goal_proof -> string
64 (* given a proof and a list of meta indexes we are interested in the
65  * instantiation gives back the cic proof and the list of instantiations *)  
66 (* build_goal_proof [eq_URI] [goal_proof] [initial_proof] [ty] 
67  *  [ty] is the type of the goal *)
68 val build_goal_proof: 
69   UriManager.uri -> goal_proof -> proof -> Cic.term-> int list -> 
70     Cic.context -> Cic.metasenv -> 
71     Cic.term * Cic.term list
72 val build_proof_term : UriManager.uri -> (int * Cic.term) list -> int -> proof -> Cic.term
73 val refl_proof: UriManager.uri -> Cic.term -> Cic.term -> Cic.term 
74 (** ensures that metavariables in equality are unique *)
75 val fix_metas_goal: int -> goal -> int * goal
76 val fix_metas: int -> equality -> int * equality
77 val metas_of_proof: proof -> int list
78
79 (* this should be used _only_ to apply (efficiently) this subst on the 
80  * initial proof passed to build_goal_proof *)
81 val add_subst : Subst.substitution -> proof -> proof
82 exception TermIsNotAnEquality;;
83
84 (**
85    raises TermIsNotAnEquality if term is not an equation.
86    The first Cic.term is a proof of the equation
87 *)
88 val equality_of_term: Cic.term -> Cic.term -> equality
89
90 (**
91    Re-builds the term corresponding to this equality
92 *)
93 val term_of_equality: UriManager.uri -> equality -> Cic.term
94 val term_is_equality: Cic.term -> bool
95
96 (** tests a sort of alpha-convertibility between the two terms, but on the
97     metavariables *)
98 val meta_convertibility: Cic.term -> Cic.term -> bool
99
100 (** meta convertibility between two equations *)
101 val meta_convertibility_eq: equality -> equality -> bool
102
103 val is_weak_identity: equality -> bool
104 val is_identity: Utils.environment -> equality -> bool
105
106 (* symmetric [eq_ty] [l] [id] [uri] [m] 
107  *
108  * given an equality (_,p,(_,[l],r,_),[m],[id]) of 'type' l=r
109  * returns the proof of the symmetric (r=l).
110  *
111  * [uri] is the uri of eq
112  * [eq_ty] the ty of the equality sides
113  *)
114 val symmetric:
115   Cic.term -> Cic.term -> int -> UriManager.uri ->
116     Cic.metasenv -> proof
117
118 (* takes 3 lists of alive ids (they are threated the same way, the type is
119  * funny just to not oblige you to concatenate them) and drops all the dead
120  * equalities *)
121 val collect: int list -> int list -> int list -> unit
122
123 (* given an equality, returns the numerical id *)
124 val id_of: equality -> int
125
126 (* profiling statistics *)
127 val get_stats: unit -> string
128