* Seal the representation of states
[tatoo.git] / src / state.ml
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 open Format
17 include Hcons.PosInt
18
19 let next =
20   let id = ref ~-1 in
21     fun () -> incr id; make !id
22
23 let compare (a : t) (b : t) = (a :> int) - (b :> int)
24
25 let print fmt (x : t) = fprintf fmt "q%a" Pretty.pp_subscript (x :> int)
26
27 let dummy_state = make max_int