]> matita.cs.unibo.it Git - helm.git/blob - helm/software/components/tactics/paramodulation/equality.mli
matitaprover
[helm.git] / helm / software / 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 pp_proofterm: Cic.term -> string
43     
44 val reset : unit -> unit
45
46 val mk_equality :
47   int * proof * 
48   (Cic.term * Cic.term * Cic.term * Utils.comparison) *
49   Cic.metasenv -> 
50     equality
51
52 val mk_tmp_equality :
53   int * (Cic.term * Cic.term * Cic.term * Utils.comparison) * Cic.metasenv -> 
54     equality
55     
56 val open_equality :
57   equality ->
58     int * proof * 
59     (Cic.term * Cic.term * Cic.term * Utils.comparison) *
60     Cic.metasenv * int
61 val depend : equality -> int -> bool
62 val compare : equality -> equality -> int
63 val max_weight_in_proof : int-> proof -> int
64 val max_weight : goal_proof -> proof -> int
65 val string_of_equality : ?env:Utils.environment -> equality -> string
66 val string_of_proof : 
67   ?names:(Cic.name option)list -> proof -> goal_proof -> string
68 (* given a proof and a list of meta indexes we are interested in the
69  * instantiation gives back the cic proof and the list of instantiations *)  
70 (* build_goal_proof [eq_URI] [goal_proof] [initial_proof] [ty] 
71  *  [ty] is the type of the goal *)
72 val build_goal_proof: 
73   UriManager.uri -> goal_proof -> proof -> Cic.term-> int list -> 
74     Cic.context -> Cic.metasenv -> 
75     Cic.term * Cic.term list
76 val build_proof_term : 
77   UriManager.uri -> (int * Cic.term) list -> int -> proof -> Cic.term
78 val refl_proof: UriManager.uri -> Cic.term -> Cic.term -> Cic.term 
79 (** ensures that metavariables in equality are unique *)
80 val fix_metas_goal: int -> goal -> int * goal
81 val fix_metas: int -> equality -> int * equality
82 val metas_of_proof: proof -> int list
83
84 (* this should be used _only_ to apply (efficiently) this subst on the 
85  * initial proof passed to build_goal_proof *)
86 val add_subst : Subst.substitution -> proof -> proof
87 exception TermIsNotAnEquality;;
88
89 (**
90    raises TermIsNotAnEquality if term is not an equation.
91    The first Cic.term is a proof of the equation
92 *)
93 val equality_of_term: Cic.term -> Cic.term -> equality
94
95 (**
96    Re-builds the term corresponding to this equality
97 *)
98 val term_of_equality: UriManager.uri -> equality -> Cic.term
99 val term_is_equality: Cic.term -> bool
100
101 (** tests a sort of alpha-convertibility between the two terms, but on the
102     metavariables *)
103 val meta_convertibility: Cic.term -> Cic.term -> bool
104
105 (** meta convertibility between two equations *)
106 val meta_convertibility_eq: equality -> equality -> bool
107
108 val is_weak_identity: equality -> bool
109 val is_identity: Utils.environment -> equality -> bool
110
111 (* symmetric [eq_ty] [l] [id] [uri] [m] 
112  *
113  * given an equality (_,p,(_,[l],r,_),[m],[id]) of 'type' l=r
114  * returns the proof of the symmetric (r=l).
115  *
116  * [uri] is the uri of eq
117  * [eq_ty] the ty of the equality sides
118  *)
119 val symmetric:
120   Cic.term -> Cic.term -> int -> UriManager.uri ->
121     Cic.metasenv -> proof
122
123 (* takes 3 lists of alive ids (they are threated the same way, the type is
124  * funny just to not oblige you to concatenate them) and drops all the dead
125  * equalities *)
126 val collect: int list -> int list -> int list -> unit
127
128 (* given an equality, returns the numerical id *)
129 val id_of: equality -> int
130
131 (* profiling statistics *)
132 val get_stats: unit -> string
133