1 (* Copyright (C) 2006, HELM Team.
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.
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.
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.
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,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 type rule = SuperpositionRight | SuperpositionLeft | Demodulation
30 val mk_equality_bag: unit -> equality_bag
36 | Step of Subst.substitution * (rule * int * (Utils.pos * int) * Cic.term)
38 and goal_proof = (rule * Utils.pos * int * Subst.substitution * Cic.term) list
40 type goal = goal_proof * Cic.metasenv * Cic.term
44 (Cic.name option) list -> goal_proof -> proof -> Subst.substitution -> int ->
47 val pp_proofterm: Cic.term -> string
50 equality_bag -> int * proof *
51 (Cic.term * Cic.term * Cic.term * Utils.comparison) *
56 int * (Cic.term * Cic.term * Cic.term * Utils.comparison) * Cic.metasenv ->
62 (Cic.term * Cic.term * Cic.term * Utils.comparison) *
64 val depend : equality_bag -> equality -> int -> bool
65 val compare : equality -> equality -> int
66 val max_weight_in_proof : equality_bag -> int -> proof -> int
67 val max_weight : equality_bag -> goal_proof -> proof -> int
68 val string_of_equality :
69 ?env:Utils.environment -> equality -> string
71 ?names:(Cic.name option)list -> equality_bag -> proof -> goal_proof -> string
72 (* given a proof and a list of meta indexes we are interested in the
73 * instantiation gives back the cic proof and the list of instantiations *)
74 (* build_goal_proof [eq_URI] [goal_proof] [initial_proof] [ty]
75 * [ty] is the type of the goal *)
78 UriManager.uri -> goal_proof -> proof -> Cic.term-> int list ->
79 Cic.context -> Cic.metasenv ->
80 Cic.term * Cic.term list
81 val build_proof_term :
83 UriManager.uri -> (int * Cic.term) list -> int -> proof -> Cic.term
84 val refl_proof: UriManager.uri -> Cic.term -> Cic.term -> Cic.term
85 (** ensures that metavariables in equality are unique *)
86 val fix_metas_goal: int -> goal -> int * goal
87 val fix_metas: equality_bag -> int -> equality -> int * equality
88 val metas_of_proof: equality_bag -> proof -> int list
90 (* this should be used _only_ to apply (efficiently) this subst on the
91 * initial proof passed to build_goal_proof *)
92 val add_subst : Subst.substitution -> proof -> proof
93 exception TermIsNotAnEquality;;
96 raises TermIsNotAnEquality if term is not an equation.
97 The first Cic.term is a proof of the equation
99 val equality_of_term: equality_bag -> Cic.term -> Cic.term -> equality
102 Re-builds the term corresponding to this equality
104 val term_of_equality: UriManager.uri -> equality -> Cic.term
105 val term_is_equality: Cic.term -> bool
107 (** tests a sort of alpha-convertibility between the two terms, but on the
109 val meta_convertibility: Cic.term -> Cic.term -> bool
111 (** meta convertibility between two equations *)
112 val meta_convertibility_eq: equality -> equality -> bool
114 val is_weak_identity: equality -> bool
115 val is_identity: Utils.environment -> equality -> bool
117 (* symmetric [eq_ty] [l] [id] [uri] [m]
119 * given an equality (_,p,(_,[l],r,_),[m],[id]) of 'type' l=r
120 * returns the proof of the symmetric (r=l).
122 * [uri] is the uri of eq
123 * [eq_ty] the ty of the equality sides
126 equality_bag -> Cic.term -> Cic.term -> int -> UriManager.uri ->
127 Cic.metasenv -> proof
129 (* takes 3 lists of alive ids (they are threated the same way, the type is
130 * funny just to not oblige you to concatenate them) and drops all the dead
132 val collect: equality_bag -> int list -> int list -> int list -> unit
134 (* given an equality, returns the numerical id *)
135 val id_of: equality -> int
137 (* profiling statistics *)
138 val get_stats: unit -> string