library colibrilib.bddbitv — module ModuloThe modulo of the rotations: it has a precondition, its only callers are the rotations of Export, which check sz
module Modulo5174use colibrilib.spec.Value5175use int.Int5176use int.EuclideanDivision as E5177use int.ComputerDivision as C5178use colibrilib.int63.Int635179
off modulo sz (Int.(%) of Base)
Valid (1.0s) (colibri2 9) (cvc4) (split_vc 2) (depth 2)let bv_modulo (off sz: int63) : int635182requires { 0 < sz }5183ensures { value_is (E.mod off sz) (to_int result) }5184ensures { 0 <= result < sz }5185=5186let o = off % sz in5187let o' = if o < 0 then o + sz else o in5188let ghost q = if o < 0 then C.div (to_int off) (to_int sz) - 1 else C.div (to_int off) (to_int sz) in5189assert { to_int off = q * to_int sz + to_int o' };5190assert { E.div off sz = q };5191o'5192end5193