]> matita.cs.unibo.it Git - helm.git/blob - components/tactics/paramodulation/equality.mli
New version of deep_subsumption
[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 substitution 
27
28 type rule = SuperpositionRight | SuperpositionLeft |Demodulation
29
30 type equality 
31
32 and proof = new_proof * old_proof
33
34 and new_proof =
35     Exact of Cic.term
36   | Step of substitution * (rule * int * (Utils.pos * int) * Cic.term)
37
38 and old_proof =
39     NoProof
40   | BasicProof of substitution * Cic.term
41   | ProofBlock of substitution * UriManager.uri * (Cic.name * Cic.term) *
42       Cic.term * (Utils.pos * equality) * old_proof
43   | ProofGoalBlock of old_proof * old_proof
44   | ProofSymBlock of Cic.term list * old_proof
45   | SubProof of Cic.term * int * old_proof
46
47 and goal_proof = (Utils.pos * int * substitution * Cic.term) list
48
49 val pp_proof: (Cic.name option) list -> goal_proof -> new_proof -> string
50
51 val empty_subst : substitution
52 val apply_subst : substitution -> Cic.term -> Cic.term
53 val apply_subst_metasenv : substitution -> Cic.metasenv -> Cic.metasenv
54 val ppsubst : substitution -> string
55 val buildsubst : 
56   int -> Cic.context -> Cic.term -> Cic.term -> substitution -> 
57     substitution
58 val flatten_subst : substitution -> substitution 
59 val lookup_subst : Cic.term -> substitution -> Cic.term
60 val filter : substitution -> Cic.metasenv -> Cic.metasenv
61 val is_in_subst : int -> substitution -> bool
62 val merge_subst_if_possible: 
63   substitution -> substitution -> 
64     substitution option
65
66 val reset : unit -> unit
67
68 val mk_equality :
69   int * proof * 
70   (Cic.term * Cic.term * Cic.term * Utils.comparison) *
71   Cic.metasenv -> 
72     equality
73
74 val mk_tmp_equality :
75   int * (Cic.term * Cic.term * Cic.term * Utils.comparison) * Cic.metasenv -> 
76     equality
77     
78 val open_equality :
79   equality ->
80     int * proof * 
81     (Cic.term * Cic.term * Cic.term * Utils.comparison) *
82     Cic.metasenv * int
83 val compare : equality -> equality -> int
84 val string_of_equality : ?env:Utils.environment -> equality -> string
85 val string_of_proof_old : ?names:(Cic.name option)list -> old_proof -> string
86 val string_of_proof_new : 
87   ?names:(Cic.name option)list -> new_proof -> goal_proof -> string
88 val build_proof_term_new: new_proof -> Cic.term 
89 val build_proof_term_old: ?noproof:Cic.term -> old_proof -> Cic.term
90 val build_goal_proof: goal_proof -> Cic.term -> Cic.term
91 val refl_proof: Cic.term -> Cic.term -> Cic.term 
92 (** ensures that metavariables in equality are unique *)
93 val fix_metas: int -> equality -> int * equality
94 val metas_of_proof: proof -> int list
95
96 exception TermIsNotAnEquality;;
97
98 (**
99    raises TermIsNotAnEquality if term is not an equation.
100    The first Cic.term is a proof of the equation
101 *)
102 val equality_of_term: Cic.term -> Cic.term -> equality
103
104 (**
105    Re-builds the term corresponding to this equality
106 *)
107 val term_of_equality: equality -> Cic.term
108 val term_is_equality: Cic.term -> bool
109
110 (** tests a sort of alpha-convertibility between the two terms, but on the
111     metavariables *)
112 val meta_convertibility: Cic.term -> Cic.term -> bool
113
114 (** meta convertibility between two equations *)
115 val meta_convertibility_eq: equality -> equality -> bool
116
117 val is_weak_identity: equality -> bool
118 val is_identity: Utils.environment -> equality -> bool
119