projects
/
tatoo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Seal the representation of states
[tatoo.git]
/
src
/
state.ml
diff --git
a/src/state.ml
b/src/state.ml
index
bb7a063
..
4b02d59
100644
(file)
--- a/
src/state.ml
+++ b/
src/state.ml
@@
-13,28
+13,15
@@
(* *)
(***********************************************************************)
(* *)
(***********************************************************************)
-(*
- Time-stamp: <Last modified on 2013-04-04 18:45:59 CEST by Kim Nguyen>
-*)
-
open Format
open Format
+include Hcons.PosInt
-type t = int
-let make =
+let next =
let id = ref ~-1 in
let id = ref ~-1 in
- fun () -> incr id; !id
-
-let compare = (-)
-
-let equal = (==)
-
-external hash : t -> int = "%identity"
-
-let print fmt x = fprintf fmt "q%a" Pretty.pp_subscript x
+ fun () -> incr id; make !id
-let
dump fmt x = print fmt x
+let
compare (a : t) (b : t) = (a :> int) - (b :> int)
-let check x =
- if x < 0 then failwith (Printf.sprintf "State: Assertion %i < 0 failed" x)
+let print fmt (x : t) = fprintf fmt "q%a" Pretty.pp_subscript (x :> int)
-let dummy
=
max_int
+let dummy
_state = make
max_int