summaryrefslogtreecommitdiff
path: root/src/gen_lib/prompt.lem
diff options
context:
space:
mode:
authorThomas Bauereiss2018-04-18 16:03:26 +0100
committerThomas Bauereiss2018-04-18 16:03:26 +0100
commite1b2379f9058e858722f2bd9691c76d00c00dcaa (patch)
tree635c9dfcf02772200796297f98aea114a118fda1 /src/gen_lib/prompt.lem
parent15f965c9e4bd39eb7fe97552b9ac9db51a3cdbfb (diff)
Add some lemmas about bitvectors
Also clean up some library functions a bit, and add some missing failure handling variants of division operations on bitvectors.
Diffstat (limited to 'src/gen_lib/prompt.lem')
-rw-r--r--src/gen_lib/prompt.lem5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gen_lib/prompt.lem b/src/gen_lib/prompt.lem
index 8214bf49..de683047 100644
--- a/src/gen_lib/prompt.lem
+++ b/src/gen_lib/prompt.lem
@@ -67,6 +67,11 @@ let of_bits_oracle bits =
val of_bits_fail : forall 'rv 'a 'e. Bitvector 'a => list bitU -> monad 'rv 'a 'e
let of_bits_fail bits = maybe_fail "of_bits" (of_bits bits)
+val mword_oracle : forall 'rv 'a 'e. Size 'a => unit -> monad 'rv (mword 'a) 'e
+let mword_oracle () =
+ bools_of_bits_oracle (repeat [BU] (integerFromNat size)) >>= (fun bs ->
+ return (wordFromBitlist bs))
+
val whileM : forall 'rv 'vars 'e. 'vars -> ('vars -> monad 'rv bool 'e) ->
('vars -> monad 'rv 'vars 'e) -> monad 'rv 'vars 'e
let rec whileM vars cond body =