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 (** Implementation of hashconsed Boolean formulae *)
18 type move = [ `Left | `Right | `Epsilon | `Up1 | `Up2 ]
20 (** Direction for automata predicates *)
25 | Or of 'formula * 'formula
26 | And of 'formula * 'formula
27 | Move of move * bool * State.t
29 (** View of the internal representation of a formula,
30 used for pattern matching *)
34 (** Abstract type representing hashconsed formulae *)
37 (** Hash function for formulae *)
40 (** Returns a unique ID for formulae *)
42 val equal : t -> t -> bool
43 (** Equality over formulae *)
45 val expr : t -> t expr
46 (** Equality over formulae *)
48 (*val st : t -> StateSet.t * StateSet.t
49 (** states occuring left and right, positively or negatively *)
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 *)
70 val atom_ : move -> bool -> StateSet.elt -> t
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 *)