1 let int_of_bitvector v =
5 | Vector.VCons (_,hd,tl) ->
7 pow + (aux (pow * 2) tl)
11 aux 1 (Vector.reverse Nat.O v)
13 let rec int_of_matitapos =
16 | Positive.P0 v -> int_of_matitapos v * 2
17 | Positive.P1 v -> int_of_matitapos v * 2 + 1
22 | Z.Pos p -> int_of_matitapos p
23 | Z.Neg p -> -(int_of_matitapos p)
25 let option_of_matitaoption =
28 | Types.Some v -> Some v
30 let rec matitanat_of_int n =
32 else if n < 0 then assert false
33 else Nat.S (matitanat_of_int (n-1))
35 let rec int_of_matitanat =
38 | Nat.S n -> int_of_matitanat n + 1
40 let int_pair_of_pointer { Pointers.pblock = bl ; Pointers.poff = off } =
41 (int_of_matitaZ bl, int_of_bitvector off)