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

Signed BitVec #42

Closed
bruderj15 opened this issue Jul 9, 2024 · 1 comment · Fixed by #87
Closed

Signed BitVec #42

bruderj15 opened this issue Jul 9, 2024 · 1 comment · Fixed by #87
Labels
enhancement New feature or request

Comments

@bruderj15
Copy link
Owner

Extend currently implemented unsigned BitVec by sign.
Promote encoding of the corresponding Haskell-Bitvector to the type-level:

data BvEnc = None | Ones | Twos
data SMTSort = BoolSort | ... | BvSort Nat BvEnc

Implement seperate instances: Num, Bounded, Integraled, ...

API for building formulas stays the same, implementation differs. Good.
Types in the API break. Bad. Just release as next major version

x <- var @(BvSort 8)

now becomes

x <- var @(BvSort 8 None)

After parsing solution we need to lookup the encoding in our state-monad. Or can the solver by any chance tell us?
Do not make the Parser do that, add an extra layer.
There will probably be some troubles here.

@bruderj15 bruderj15 added the enhancement New feature or request label Jul 9, 2024
@bruderj15
Copy link
Owner Author

bruderj15 commented Aug 21, 2024

Too much noise.
Just stray a little from the official SMTLib-Spec and add another sort SBvSort for signed bvs.
Maybe rename BvSort to UBvSort for unsigned bvs. Breaks API.
Implementation is straight forward.

@bruderj15 bruderj15 linked a pull request Aug 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant