Merge commit 'ocaml3102'
[ocaml.git] / ocamlbuild / bool.mli
blob4b3ea3f66942906f8bace486a36508e1fe47d19c
1 (***********************************************************************)
2 (* ocamlbuild *)
3 (* *)
4 (* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
5 (* *)
6 (* Copyright 2007 Institut National de Recherche en Informatique et *)
7 (* en Automatique. All rights reserved. This file is distributed *)
8 (* under the terms of the Q Public License version 1.0. *)
9 (* *)
10 (***********************************************************************)
12 (* $Id$ *)
13 (* Original author: Berke Durak *)
14 (* Bool *)
16 (** Provides a datatype for representing boolean formulas and evaluation,
17 iteration and map functions. *)
19 (** Public type for generic boolean formulas. An empty conjunction [And[]] is true and
20 an empty disjunction [Or[]] is false. *)
21 type 'a boolean =
22 And of 'a boolean list
23 | Or of 'a boolean list
24 | Not of 'a boolean
25 | Atom of 'a
26 | True
27 | False
29 val eval : ('a -> bool) -> 'a boolean -> bool
30 (** [eval g f] evaluates the boolean formula [f] using the values returned by [g] for the atoms. *)
31 val iter : ('a -> unit) -> 'a boolean -> unit
32 (** [iter g f] calls [g] over every atom of [f]. *)
33 val map : ('a -> 'b) -> 'a boolean -> 'b boolean
34 (** [map g f] replaces every atom of [f] by its image by [g]. *)