summaryrefslogtreecommitdiff
path: root/src/sail_lib.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2019-05-14 15:46:10 +0100
committerAlasdair Armstrong2019-05-14 15:46:10 +0100
commit9d6734f717639f9babdec4441f8362bfeca10d66 (patch)
tree91080afb376c38328de7262352f7c3217bc22719 /src/sail_lib.ml
parent63d7f669f3d292315e4a353115284358ba7d5627 (diff)
parentf6cc45f2788dc777d1fa35aa9a216de994992288 (diff)
Merge branch 'smt_experiments' into sail2
Diffstat (limited to 'src/sail_lib.ml')
-rw-r--r--src/sail_lib.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sail_lib.ml b/src/sail_lib.ml
index 83d58178..13ed491b 100644
--- a/src/sail_lib.ml
+++ b/src/sail_lib.ml
@@ -193,6 +193,10 @@ let sint = function
let add_int (x, y) = Big_int.add x y
let sub_int (x, y) = Big_int.sub x y
+let sub_nat (x, y) =
+ let z = Big_int.sub x y in
+ if Big_int.less z Big_int.zero then Big_int.zero else z
+
let mult (x, y) = Big_int.mul x y
(* This is euclidian division from lem *)