Skip to content
Snippets Groups Projects
Commit 32e31b63 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[wp] export bit-tests lfuns

parent 029ac347
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,11 @@ let f_bit_export = Lang.extern_p ~library ~bool:"bit_testb" ~prop:"bit_test" (
let () = let open LogicBuiltins in add_builtin "\\bit_test_stdlib" [Z;Z] f_bit_stdlib
let () = let open LogicBuiltins in add_builtin "\\bit_test" [Z;Z] f_bit_positive
let f_bits = [ f_bit_stdlib ; f_bit_positive ; f_bit_export ]
let bit_test e k =
F.e_fun (if k <= 0 then f_bit_positive else f_bit_stdlib) [e ; e_int k]
(* -------------------------------------------------------------------------- *)
(* --- Matching utilities for simplifications --- *)
(* -------------------------------------------------------------------------- *)
......
......@@ -73,6 +73,9 @@ val f_lsl : lfun
val f_lsr : lfun
val f_bitwised : lfun list (** All except f_bit_positive *)
val f_bits : lfun list (** All bit-test functions *)
val bit_test : term -> int -> term
(** Simplifiers *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment