]> matita.cs.unibo.it Git - helm.git/blob - components/tactics/paramodulation/inference.mli
args removed from equalities.
[helm.git] / components / tactics / paramodulation / inference.mli
1 (* Copyright (C) 2005, 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://cs.unibo.it/helm/.
24  *)
25
26 val metas_of_proof_time : float ref
27
28 type equality =
29     int *                (* weight *)
30     proof *              (* proof *)
31     (Cic.term *          (* type *)
32      Cic.term *          (* left side *)
33      Cic.term *          (* right side *)
34      Utils.comparison) * (* ordering *)  
35     Cic.metasenv        (* environment for metas *)
36
37 and proof =
38   | NoProof   (* no proof *)
39   | BasicProof of Cic.term (* already a proof of a goal *)
40   | ProofBlock of (* proof of a rewrite step *)
41       Cic.substitution * UriManager.uri * (* eq_ind or eq_ind_r *)
42         (Cic.name * Cic.term) * Cic.term * (Utils.pos * equality) * proof
43   | ProofGoalBlock of proof * proof
44       (* proof of the new meta, proof of the goal from which this comes *)
45   | ProofSymBlock of Cic.term list * proof (* expl.named subst, proof *)
46   | SubProof of Cic.term * int * proof
47       (* parent proof, subgoal, proof of the subgoal *)
48
49 type environment = Cic.metasenv * Cic.context * CicUniv.universe_graph
50
51 (** builds the Cic.term encoded by proof *)
52 val build_proof_term: ?noproof:Cic.term -> proof -> Cic.term
53
54 val string_of_proof: proof -> string
55
56 val filter : Cic.substitution -> Cic.metasenv -> Cic.metasenv
57
58 exception MatchingFailure
59
60 (** matching between two terms. Can raise MatchingFailure *)
61 val matching:
62   Cic.metasenv -> Cic.metasenv -> Cic.context -> Cic.term -> Cic.term ->
63   CicUniv.universe_graph ->
64   Cic.substitution * Cic.metasenv * CicUniv.universe_graph
65
66 (**
67    special unification that checks if the two terms are "simple", and in
68    such case should be significantly faster than CicUnification.fo_unif
69 *)
70 val unification:
71   Cic.metasenv -> Cic.metasenv -> Cic.context -> Cic.term -> Cic.term ->
72   CicUniv.universe_graph ->
73   Cic.substitution * Cic.metasenv * CicUniv.universe_graph
74
75     
76 (**
77    scans the context to find all Declarations "left = right"; returns a
78    list of tuples (proof, (type, left, right), newmetas). Uses
79    PrimitiveTactics.new_metasenv_for_apply to replace bound variables with
80    fresh metas...
81 *)
82 val find_equalities:
83   Cic.context -> ProofEngineTypes.proof -> int list * equality list * int
84
85 (**
86    searches the library for equalities that can be applied to the current goal
87 *)
88 val find_library_equalities:
89   HMysql.dbd -> Cic.context -> ProofEngineTypes.status -> int ->
90   UriManager.UriSet.t * (UriManager.uri * equality) list * int
91
92 (**
93    searches the library for theorems that are not equalities (returned by the
94    function above)
95 *)
96 val find_library_theorems:
97   HMysql.dbd -> environment -> ProofEngineTypes.status -> UriManager.UriSet.t ->
98   (Cic.term * Cic.term * Cic.metasenv) list
99
100 (**
101    searches the context for hypotheses that are not equalities
102 *)
103 val find_context_hypotheses:
104   environment -> int list -> (Cic.term * Cic.term * Cic.metasenv) list
105
106
107 exception TermIsNotAnEquality;;
108
109 (**
110    raises TermIsNotAnEquality if term is not an equation.
111    The first Cic.term is a proof of the equation
112 *)
113 val equality_of_term: Cic.term -> Cic.term -> equality
114
115 (**
116    Re-builds the term corresponding to this equality
117 *)
118 val term_of_equality: equality -> Cic.term
119
120 val term_is_equality: Cic.term -> bool
121
122 (** tests a sort of alpha-convertibility between the two terms, but on the
123     metavariables *)
124 val meta_convertibility: Cic.term -> Cic.term -> bool
125
126 (** meta convertibility between two equations *)
127 val meta_convertibility_eq: equality -> equality -> bool
128
129 val is_weak_identity: environment -> equality -> bool
130 val is_identity: environment -> equality -> bool
131
132 val string_of_equality: ?env:environment -> equality -> string
133
134 val metas_of_term: Cic.term -> int list
135 val metas_of_proof: proof -> int list
136
137 (** ensures that metavariables in equality are unique *)
138 val fix_metas: int -> equality -> int * equality