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 (***********************************************************************)
20 include Hcons.Abstract with type t := t
21 include Common_sig.Printable with type t := t
24 type ('formula,'atom) expr =
27 | Or of 'formula * 'formula
28 | And of 'formula * 'formula
31 (** View of the internal representation of a formula,
32 used for pattern matching *)
34 module Make(P : ATOM) :
38 (** Abstract type representing hashconsed formulae *)
41 (** Hash function for formulae *)
44 (** Returns a unique ID for formulae *)
46 val equal : t -> t -> bool
47 (** Equality over formulae *)
49 val expr : t -> (t,P.t) expr
50 (** Return a view of the formulae *)
52 val compare : t -> t -> int
53 (** Comparison of formulae *)
55 val print : Format.formatter -> t -> unit
58 val is_true : t -> bool
59 (** [is_true f] tests whether the formula is the atom True *)
61 val is_false : t -> bool
62 (** [is_false f] tests whether the formula is the atom False *)
71 (** [atom_ dir b q] creates a down_left or down_right atom for state
72 [q]. The atom is positive if [b == true].
77 val and_ : t -> t -> t
78 (** Boolean connective *)
80 val of_bool : bool -> t
81 (** Convert an ocaml Boolean value to a formula *)
83 val fold : (t -> 'a -> 'a) -> t -> 'a -> 'a
84 (** [fold f phi acc] folds [f] over the formula structure *)