source: Deliverables/D4.1/BitVectors.mli @ 88

Last change on this file since 88 was 88, checked in by mulligan, 9 years ago

int_of_vect implemented.

File size: 1.4 KB
Line 
1type bit = bool
2
3type 'a vect
4
5type nibble = [`Four] vect
6type byte7 = [`Seven] vect
7type byte = [`Eight] vect
8type word = [`Sixteen] vect
9type word11 = [`Eleven] vect
10
11val mk_nibble: bit -> bit -> bit -> bit -> nibble
12val from_nibble: nibble -> bit * bit * bit * bit
13val mk_byte7: bit -> bit -> bit -> nibble -> byte7
14val from_byte7: byte7 -> bit * bit * bit * nibble
15val mk_byte: nibble -> nibble -> byte
16val from_byte: byte -> nibble * nibble
17val mk_word: byte -> byte -> word
18val from_word: word -> byte * byte
19val mk_word11: bit -> bit -> bit -> byte -> word11
20val from_word11: word11 -> bit * bit * bit * byte
21
22val to_bits: 'a vect -> bit list
23val get_bit: 'a vect -> int -> bit option
24val set_bit: 'a vect -> int -> bit -> 'a vect option
25
26val int_of_vect: 'a vect -> int
27val vect_of_int: int -> 'a -> 'a vect
28
29val (-&-): 'a vect -> 'a vect -> 'a vect
30val (-|-): 'a vect -> 'a vect -> 'a vect
31val (-^-): 'a vect -> 'a vect -> 'a vect
32val not: 'a vect -> 'a vect
33
34val iter_bits: (bit -> string) -> 'a vect -> string
35val map_bits: (bit -> bit) -> 'a vect -> 'a vect
36val map2_bits: (bit -> bit -> bit) -> 'a vect -> 'a vect -> 'a vect
37
38val string_of_vect: 'a vect -> string
39
40val half_add: 'a vect -> 'a vect -> bit * 'a vect
41val full_add: 'a vect -> 'a vect -> bit -> bit * 'a vect
42
43val rotate_left : 'a vect -> 'a vect
44val rotate_right : 'a vect -> 'a vect
45val shift_right : 'a vect -> 'a vect
46val shift_left : 'a vect -> 'a vect
Note: See TracBrowser for help on using the repository browser.