source: Deliverables/D4.1/bit_vectors.mli @ 87

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

Moved tentative to bit_vectors. Added .mli file.

File size: 1.3 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 (-&-): 'a vect -> 'a vect -> 'a vect
27val (-|-): 'a vect -> 'a vect -> 'a vect
28val (-^-): 'a vect -> 'a vect -> 'a vect
29val not: 'a vect -> 'a vect
30
31val iter_bits: (bit -> string) -> 'a vect -> string
32val map_bits: (bit -> bit) -> 'a vect -> 'a vect
33val map2_bits: (bit -> bit -> bit) -> 'a vect -> 'a vect -> 'a vect
34
35val string_of_vect: 'a vect -> string
36
37val half_add: 'a vect -> 'a vect -> bit * 'a vect
38val full_add: 'a vect -> 'a vect -> bit -> bit * 'a vect
39
40val rotate_left : 'a vect -> 'a vect
41val rotate_right : 'a vect -> 'a vect
42val shift_right : 'a vect -> 'a vect
43val shift_left : 'a vect -> 'a vect
Note: See TracBrowser for help on using the repository browser.