2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
17 | Node of ('a foterm) list
19 type 'a substitution = (int * 'a foterm) list
21 type comparison = Lt | Eq | Gt | Incomparable | Invertible
23 type rule = Superposition | Demodulation
25 (* A Discrimination tree is a map: foterm |-> (dir, clause) *)
26 type direction = Left2Right | Right2Left | Nodir
28 type position = int list
32 (* for theorems like T : \forall x. C[x] = D[x] the proof is
33 * a foterm like (Node [ Leaf T ; Var i ]), while for the Goal
34 * it is just (Var g), i.e. the identity proof *)
35 | Step of rule * int * int * direction * position * 'a substitution
36 (* rule, eq1, eq2, direction of eq2, position, substitution *)
39 | Equation of 'a foterm (* lhs *)
41 * 'a foterm (* type *)
42 * comparison (* orientation *)
43 | Predicate of 'a foterm
45 type varlist = int list
51 * 'a proof (* proof *)
53 type 'a passive_clause = int * 'a unit_clause (* weight * equation *)
55 val is_eq_clause : 'a unit_clause -> bool
56 val vars_of_term : 'a foterm -> int list
58 module M : Map.S with type key = int
60 type 'a bag = int (* max ID *)
61 * (('a unit_clause * bool * int) M.t)
63 (* also gives a fresh ID to the clause *)
65 'a unit_clause -> 'a bag ->
66 'a bag * 'a unit_clause
69 'a unit_clause * bool * int -> 'a bag ->
73 int -> 'a bag -> 'a unit_clause * bool * int
75 val empty_bag : 'a bag
79 (* Blob is the type for opaque leaves:
80 * - checking equlity should be efficient
81 * - atoms have to be equipped with a total order relation
84 val eq : t -> t -> bool
85 val compare : t -> t -> int
87 (* TODO: consider taking in input an imperative buffer for Format
88 * val pp : Format.formatter -> t -> unit
90 val is_eq : t foterm -> (t foterm * t foterm * t foterm) option
94 val embed : input -> t foterm
95 (* saturate [proof] [type] -> [proof] * [type] *)
96 val saturate : input -> input -> t foterm * t foterm