summaryrefslogtreecommitdiff
path: root/mips_new_tc
diff options
context:
space:
mode:
authorRobert Norton2018-03-06 11:44:37 +0000
committerRobert Norton2018-03-06 11:45:32 +0000
commitf41f149d35932eaf7b0469302fd6407fed02ae21 (patch)
tree61a48f8ebeade556589982f519a022d35ca6c2cf /mips_new_tc
parent68df36a0e620ddd4d8c5d17384795d24b106f9d8 (diff)
add atom versions of val declaration for min and max.
Diffstat (limited to 'mips_new_tc')
-rw-r--r--mips_new_tc/prelude.sail8
1 files changed, 6 insertions, 2 deletions
diff --git a/mips_new_tc/prelude.sail b/mips_new_tc/prelude.sail
index 3f1198f5..bd6be289 100644
--- a/mips_new_tc/prelude.sail
+++ b/mips_new_tc/prelude.sail
@@ -245,9 +245,13 @@ val max_nat = {ocaml: "max_int", lem: "max"} : (nat, nat) -> nat
val max_int = {ocaml: "max_int", lem: "max"} : (int, int) -> int
-overload min = {min_nat, min_int}
+val min_atom = {ocaml: "min_int", lem: "min"} : forall 'a 'b . (atom('a), atom('b)) -> {'c, ('c = 'a | 'c = 'b) & 'c <= 'a & 'c <= 'b . atom('c)}
-overload max = {max_nat, max_int}
+val max_atom = {ocaml: "max_int", lem: "max"} : forall 'a 'b . (atom('a), atom('b)) -> {'c, ('c = 'a | 'c = 'b) & 'c >= 'a & 'c >= 'b . atom('c)}
+
+overload min = {min_atom, min_nat, min_int}
+
+overload max = {max_atom, max_nat, max_int}
val __WriteRAM = "write_ram" : forall 'n 'm.
(atom('m), atom('n), bits('m), bits('m), bits(8 * 'n)) -> unit effect {wmv}