1 (***********************************************************************)
4 (* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
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. *)
10 (***********************************************************************)
13 (* Original author: Nicolas Pouillard *)
14 include Set.Make
(String
)
17 does_match {foo, bar, baz} {foo} => ok
18 does_match {foo, bar, baz} {foo, boo} => ko
19 does_match {foo, bar, baz} {} => ok
20 does_match {foo, bar, baz} {foo, bar, baz} => ok
22 let does_match x y
= subset y x
24 let of_list l
= List.fold_right add l empty
29 let () = fprintf f
"@[<0>" in
31 fold
begin fun elt first
->
32 if not first
then fprintf f
",@ ";
33 pp_print_string f elt
;
38 module Operators
= struct
39 let ( ++ ) x y
= add y x
40 let ( -- ) x y
= remove y x
41 let ( +++ ) x
= function Some y
-> add y x
| None
-> x
42 let ( --- ) x
= function Some y
-> remove y x
| None
-> x