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

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

fixed typing errors in ASMInterpret up to execute1.

File size: 1.7 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
11type sizes = [ `Four | `Seven | `Eight | `Eleven | `Sixteen ]
12
13val mk_nibble: bit -> bit -> bit -> bit -> nibble
14val from_nibble: nibble -> bit * bit * bit * bit
15val mk_byte7: bit -> bit -> bit -> nibble -> byte7
16val from_byte7: byte7 -> bit * bit * bit * nibble
17val mk_byte: nibble -> nibble -> byte
18val mk_byte_from_bits: ((bit * bit * bit * bit) * (bit * bit * bit * bit)) -> byte
19val from_byte: byte -> nibble * nibble
20val mk_word: byte -> byte -> word
21val from_word: word -> byte * byte
22val mk_word11: bit -> bit -> bit -> byte -> word11
23val from_word11: word11 -> bit * bit * bit * byte
24
25val to_bits: 'a vect -> bit list
26val get_bit: 'a vect -> int -> bit option
27val set_bit: 'a vect -> int -> bit -> 'a vect option
28
29val int_of_vect: 'a vect -> int
30val vect_of_int: int -> ([< sizes] as 'a) -> 'a vect
31
32val (-&-): 'a vect -> 'a vect -> 'a vect
33val (-|-): 'a vect -> 'a vect -> 'a vect
34val (-^-): 'a vect -> 'a vect -> 'a vect
35val complement: 'a vect -> 'a vect
36
37val iter_bits: (bit -> string) -> 'a vect -> string
38val map_bits: (bit -> bit) -> 'a vect -> 'a vect
39val map2_bits: (bit -> bit -> bit) -> 'a vect -> 'a vect -> 'a vect
40
41val string_of_vect: 'a vect -> string
42
43val zero: [< `Four | `Seven | `Eight | `Eleven | `Sixteen ] -> [< `Four | `Seven | `Eight | `Eleven | `Sixteen ] vect
44
45val half_add: 'a vect -> 'a vect -> bit * 'a vect
46val full_add: 'a vect -> 'a vect -> bit -> bit * 'a vect
47
48val rotate_left : 'a vect -> 'a vect
49val rotate_right : 'a vect -> 'a vect
50val shift_right : 'a vect -> 'a vect
51val shift_left : 'a vect -> 'a vect
Note: See TracBrowser for help on using the repository browser.