Sanitize header files and add a timestamp mark in each source file.
[tatoo.git] / src / formula.mli
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                     Kim Nguyen, LRI UMR8623                         *)
6 (*                   Université Paris-Sud & CNRS                       *)
7 (*                                                                     *)
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   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15
16 (*
17   Time-stamp: <Last modified on 2013-01-30 19:08:52 CET by Kim Nguyen>
18 *)
19
20 (** Implementation of hashconsed Boolean formulae *)
21
22 type move = [ `Left | `Right | `Epsilon | `Up1 | `Up2 ]
23
24 (** Direction for automata predicates *)
25
26 type 'formula expr =
27   | False
28   | True
29   | Or of 'formula * 'formula
30   | And of 'formula * 'formula
31   | Move of move * bool * State.t
32
33 (** View of the internal representation of a formula,
34     used for pattern matching *)
35
36 type t
37
38 (** Abstract type representing hashconsed formulae *)
39
40 val hash : t -> int
41 (** Hash function for formulae *)
42
43 val uid : t -> Uid.t
44 (** Returns a unique ID for formulae *)
45
46 val equal : t -> t -> bool
47 (** Equality over formulae *)
48
49 val expr : t -> t expr
50 (** Equality over formulae *)
51
52 (*val st : t -> StateSet.t * StateSet.t
53 (** states occuring left and right, positively or negatively *)
54 *)
55
56 val compare : t -> t -> int
57 (** Comparison of formulae *)
58
59 val print : Format.formatter -> t -> unit
60 (** Pretty printer *)
61
62 val is_true : t -> bool
63 (** [is_true f] tests whether the formula is the atom True *)
64
65 val is_false : t -> bool
66 (** [is_false f] tests whether the formula is the atom False *)
67
68 val true_ : t
69 (** Atom True *)
70
71 val false_ : t
72 (** Atom False *)
73
74 val atom_ : move -> bool -> StateSet.elt -> t
75 (** [atom_ dir b q] creates a down_left or down_right atom for state
76     [q]. The atom is positive if [b == true].
77 *)
78
79 val not_ : t -> t
80 val or_ : t -> t -> t
81 val and_ : t -> t -> t
82 (** Boolean connective *)
83
84 val of_bool : bool -> t
85 (** Convert an ocaml Boolean value to a formula *)