Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up support for CVC5 #729

Merged
merged 9 commits into from
Dec 23, 2024
Merged

Clean up support for CVC5 #729

merged 9 commits into from
Dec 23, 2024

Conversation

ranjitjhala
Copy link
Member

  • Simplifies the "preamble" code
  • Fixes some glitches in serialization
  • Adds cvc5 to the CI ... (!!!)

Fixes #728

Comment on lines 531 to 532
Cvc4 -> "bv2nat"
Cvc5 -> "bv2nat"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? Sounds like bv2nat has different semantics than bv2int

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently they do the same thing... (per Nikolaj B.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cvc people say is not standard smtlib cvc5/cvc5#11252, but I see it here https://smt-lib.org/theories-FixedSizeBitVectors.shtml

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, its odd. Furthermore -- CVC seems to just not support bv2int -- I get Symbol 'bv2int' not declared as a variable errors...? I guess you better only implicitly convert nats into bv...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, Z3Prover/z3#6419 seems to indicate that even in z3 bv2int and bv2nat do the same thing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I get it now, bv2int and bv2nat are not part of the standard they are only defined to define the semantics. From the CVC5 issue it seems that is going to be standardized in smtlib 2.7 so maybe worth tracking in an issue.

Also is bv2int/bv2nat in z3 the same as bv2nat in CVC?

Copy link
Contributor

@nilehmann nilehmann Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I get it now (for real)

  • In Z3, bv2int and bv2nat are aliases. They both implement the semantics of the upcoming bv2nat, i.e., they interpret the bit vector as an unsigned integer
  • In CVC, only bv2nat is implemented and it has the semantics of the upcoming bv2nat

In smtlib 2.7, bv2int will have a precise meaning (bit vectors as signed integer) different from the one implemented by z3, so the correct thing here is to use bv2nat both for z3 and cvc because it will be forward compatible.

Fixpoint (and users of fixpoint) should probably start using *_to_nat instead of *_to_int to reserve to_int for the upcoming meaning in 2.7.

Comment on lines +489 to +490
, interpSym intbv32Name "(_ int2bv 32)" (FFunc intSort bv32)
, interpSym intbv64Name "(_ int2bv 64)" (FFunc intSort bv64)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably a similar argument applies here and we should use nat2bv, but I haven't checked.

@ranjitjhala ranjitjhala merged commit 9a82815 into develop Dec 23, 2024
3 checks passed
@ranjitjhala ranjitjhala deleted the issue-728 branch December 23, 2024 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fixpoint crashes when using CVC
2 participants