aboutsummaryrefslogtreecommitdiff
path: root/src/reg.mli
blob: 6e81259270469f96bc4fd9bc481b7cbf6124bbf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(*
 * UPEM / L3 / Functional programming / Project: URM
 * Pacien TRAN-GIRARD, Adam NAILI
 *)

open Common

(* Returns the index of a register. *)
val reg_idx : reg -> regidx

(* Compares two register Ri and Rj.
 * It returns an integer less than, equal to, or greater than zero if
 * the first register index is respectively less than, equal to, or
 * greater than the second register index. *)
val reg_compar : reg -> reg -> int

(* Returns the register value of a register from its index. Fails if
 * there is not register with the sought register index. *)
val regs_get : reg list -> regidx -> regval

(* Set the value of the register to value,
 * or creates it to the value specified if it does not exist *)
val regs_set : reg list -> regidx -> regval -> reg list

(* Sorts a list of registers in ascending index order *)
val regs_sort : reg list -> reg list

(* Returns the string representation of a register list. *)
val regs_string : reg list -> string