summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/flow.sail23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/flow.sail b/lib/flow.sail
index 5c182af2..1655a719 100644
--- a/lib/flow.sail
+++ b/lib/flow.sail
@@ -9,30 +9,33 @@ therefore be included in just about every Sail specification.
*/
-val eq_unit : (unit, unit) -> bool
+val eq_unit : (unit, unit) -> bool(true)
val eq_bit = { lem : "eq", _ : "eq_bit" } : (bit, bit) -> bool
function eq_unit(_, _) = true
-val not_bool = {coq: "negb", _: "not"} : bool -> bool
+val not_bool = {coq: "negb", _: "not"} : forall ('p : Bool). bool('p) -> bool(not('p))
/* NB: There are special cases in Sail for effectful uses of and_bool and
or_bool that are not shown here. */
-val and_bool = {coq: "andb", _: "and_bool"} : (bool, bool) -> bool
-val or_bool = {coq: "orb", _: "or_bool"} : (bool, bool) -> bool
-val eq_int = {ocaml: "eq_int", lem: "eq", c: "eq_int", coq: "Z.eqb"} : (int, int) -> bool
+
+val and_bool = {coq: "andb", _: "and_bool"} : forall ('p : Bool) ('q : Bool). (bool('p), bool('q)) -> bool('p & 'q)
+val or_bool = {coq: "orb", _: "or_bool"} : forall ('p : Bool) ('q : Bool). (bool('p), bool('q)) -> bool('p | 'q)
+
+val eq_int = {ocaml: "eq_int", lem: "eq", c: "eq_int", coq: "Z.eqb"} : forall 'n 'm. (int('n), int('m)) -> bool('n == 'm)
+
val eq_bool = {ocaml: "eq_bool", lem: "eq", c: "eq_bool", coq: "Bool.eqb"} : (bool, bool) -> bool
-val neq_int = {lem: "neq"} : (int, int) -> bool
+val neq_int = {lem: "neq"} : forall 'n 'm. (int('n), int('m)) -> bool('n != 'm)
function neq_int (x, y) = not_bool(eq_int(x, y))
val neq_bool : (bool, bool) -> bool
function neq_bool (x, y) = not_bool(eq_bool(x, y))
-val lteq_int = {coq: "Z.leb", _:"lteq"} : (int, int) -> bool
-val gteq_int = {coq: "Z.geb", _:"gteq"} : (int, int) -> bool
-val lt_int = {coq: "Z.ltb", _:"lt"} : (int, int) -> bool
-val gt_int = {coq: "Z.gtb", _:"gt"} : (int, int) -> bool
+val lteq_int = {coq: "Z.leb", _:"lteq"} : forall 'n 'm. (int('n), int('m)) -> bool('n <= 'm)
+val gteq_int = {coq: "Z.geb", _:"gteq"} : forall 'n 'm. (int('n), int('m)) -> bool('n >= 'm)
+val lt_int = {coq: "Z.ltb", _:"lt"} : forall 'n 'm. (int('n), int('m)) -> bool('n < 'm)
+val gt_int = {coq: "Z.gtb", _:"gt"} : forall 'n 'm. (int('n), int('m)) -> bool('n > 'm)
overload operator == = {eq_int, eq_bit, eq_bool, eq_unit}
overload operator != = {neq_int, neq_bool}