简体   繁体   中英

Is there a modulus operator for Integers in the OCaml bindings for Z3?

I'm looking through the Z3.Arithmetic module, and I do not see any mk_modulus or similar function provided. Is there a binding for the mod operator in Z3?

I can internally build a term (x - ((x / 2) * 2)) , but if there's a binding for mod , I would prefer it.

You're looking for the mk_mod function, found here:

https://github.com/Z3Prover/z3/blob/a1f484fa35d171131f294e6c1b415b897fdb99df/src/api/ml/z3.mli#L1186-L1188

There's also mk_rem , right next to mk_mod , if that's what you'd need as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM