1 (***********************************************************************)
5 (* Kim Nguyen, LRI UMR8623 *)
6 (* Université Paris-Sud & CNRS *)
8 (* Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (* Recherche Scientifique. All rights reserved. This file is *)
10 (* distributed under the terms of the GNU Lesser General Public *)
11 (* License, with the special exception on linking described in file *)
14 (***********************************************************************)
19 include Common_sig.Printable with type t := t
22 type ('formula,'atom) expr =
25 | Or of 'formula * 'formula
26 | And of 'formula * 'formula
27 | Atom of 'atom * bool
29 (** View of the internal representation of a formula,
30 used for pattern matching *)
32 module Make(A : ATOM) :
36 (** Abstract type representing hashconsed formulae *)
39 (** Hash function for formulae *)
42 (** Returns a unique ID for formulae *)
44 val equal : t -> t -> bool
45 (** Equality over formulae *)
47 val expr : t -> (t,A.t) expr
48 (** Return a view of the formulae *)
50 val compare : t -> t -> int
51 (** Comparison of formulae *)
53 val print : Format.formatter -> t -> unit
56 val is_true : t -> bool
57 (** [is_true f] tests whether the formula is the atom True *)
59 val is_false : t -> bool
60 (** [is_false f] tests whether the formula is the atom False *)
69 (** [atom_ a] creates a new formula consisting of the atome a.
74 val and_ : t -> t -> t
75 (** Boolean connective *)
77 val of_bool : bool -> t
78 (** Convert an ocaml Boolean value to a formula *)
80 val fold : (t -> 'a -> 'a) -> t -> 'a -> 'a
81 (** [fold f phi acc] folds [f] over the formula structure *)