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 (***********************************************************************)
16 type ('formula,'atom) expr =
19 | Or of 'formula * 'formula
20 | And of 'formula * 'formula
21 | Atom of 'atom * bool
23 (** View of the internal representation of a formula,
24 used for pattern matching *)
28 include Common_sig.Printable with type t := t
33 (** Abstract type representing hashconsed formulae *)
36 (** Hash function for formulae *)
39 (** Returns a unique ID for formulae *)
41 val equal : t -> t -> bool
42 (** Equality over formulae *)
44 val expr : t -> (t,A.t) expr
45 (** Return a view of the formulae *)
47 val compare : t -> t -> int
48 (** Comparison of formulae *)
50 val print : Format.formatter -> t -> unit
53 val is_true : t -> bool
54 (** [is_true f] tests whether the formula is the atom True *)
56 val is_false : t -> bool
57 (** [is_false f] tests whether the formula is the atom False *)
66 (** [atom_ a] creates a new formula consisting of the atome a.
71 val and_ : t -> t -> t
72 (** Boolean connective *)
74 val of_bool : bool -> t
75 (** Convert an ocaml Boolean value to a formula *)
77 val fold : (t -> 'a -> 'a) -> t -> 'a -> 'a
78 (** [fold f phi acc] folds [f] over the formula structure *)
80 val iter : (t -> unit) -> t -> unit
81 (** [iter f phi] iters [f] over the formula structure *)