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

Add datatype support for z3 #346

Merged
merged 9 commits into from
Mar 21, 2024
Merged

Conversation

farmerzhang1
Copy link
Contributor

Hi all,

I'm trying to play with smt-switch and decide to add z3 backend support for datatypes. Any feedback is welcome.

Copy link
Collaborator

@yoni206 yoni206 left a comment

Choose a reason for hiding this comment

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

Thank you very much for this PR. It would be great to have support for z3 datatypes!
I've made some initial comments/questions inline.

In addition to them -- I wonder -- would it make sense to add tests that are specific to z3 datatypes? Perhaps here?
https://github.com/stanford-centaur/smt-switch/tree/main/tests/z3

We are already in good shape because I can see that CI ran the general datatypes tests, but I still wonder whether there is anything specific to test in the z3 API side.

@farmerzhang1
Copy link
Contributor Author

Hi Yoni, I've add some z3-specific tests and try to mirror the cvc5 datatype files as much as possible. Maybe you can check them again?

Copy link
Collaborator

@yoni206 yoni206 left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Looks like the new tests are passing, and also the old ones, also after adding datatypes to the list of supported theories of z3, which is great.

Just one last question inline.

Comment on lines +29 to +30
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DZ3_BUILD_LIBZ3_SHARED=Off -DZ3_BUILD_LIBZ3_MSVC_STATIC=On
cmake --build build -j$NUM_CORES
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is basically doing the classic

cd build
cmake ..
make

In the first command, -S . means source is in the current directory, -B build means the build directory, and the rest is just to make sure we build the binary we want, which is optimized static library, we don't need the shared one so I turn it off.

The second one is designating the build directory and build the target in parallel

Copy link
Collaborator

@yoni206 yoni206 left a comment

Choose a reason for hiding this comment

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

Thanks again for this valuable contribution!

@yoni206 yoni206 merged commit 2e2253b into stanford-centaur:main Mar 21, 2024
10 checks passed
CyanoKobalamyne pushed a commit to CyanoKobalamyne/smt-switch that referenced this pull request May 16, 2024
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.

2 participants