Question about bvadd that has just one argument #6521
-
Greetings, I have a question about Recently, I saw a formula written in smtlibv2. The formula is as follows:
I think that this formula cannot be parsed. Since according to standard of smtlibv2(https://smtlib.cs.uiowa.edu/theories-FixedSizeBitVectors.shtml), bvadd should have two arguments. Is this situation intended in z3? If so, could I know how to understand the situation? Thanks for reading :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For z3 you can parse associative/commutative operators with any > 0 arguments in Z3. When they are given 1 argument, they are treated as no-ops. so (* x) is x, (+ x) is x, (bvmul x) is x etc. |
Beta Was this translation helpful? Give feedback.
For z3 you can parse associative/commutative operators with any > 0 arguments in Z3. When they are given 1 argument, they are treated as no-ops. so (* x) is x, (+ x) is x, (bvmul x) is x etc.
The meaning of bvadd is idempotent on one argument. The simplifier/pre-processor eliminates this use of bvadd.
z3 strives to be able to process SMTLIB2 compliant input, but does not restrict itself to reject input that has unambiguous meaning.