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

Ensure that Z3 uses the correct SMT-LIB2 syntax for push and pop #4495

Merged

Conversation

aytey
Copy link
Contributor

@aytey aytey commented Jun 3, 2020

Issue

According to The SMT-LIB Standard Version 2.6, the operators push and pop are defined as follows:

| ( pop ⟨numeral ⟩ )
| ( push ⟨numeral ⟩ )

That is, they take an unsigned integer value for the number of "assertion levels" to push and pop.

However, if you ask Z3 to dump the SMT2 from the current instance (e.g., using the logFile kwarg in Python for a Solver) then this instance will contain (push) and (pop) with no integer arguments.

This makes it hard to re-use these SMT-LIB2 instances against other solvers (e.g., to submit benchmarks to SMT-LIB benchmarks) because the instances are not well-formed.

Solution

This PR changes all instance of (push) and (pop) with no arguments to be (push 1) and (pop 1), therefore making the instances usable across other SMT solvers, which are more strict on the syntax they accept.

aytey added 2 commits June 3, 2020 12:34
…for 'push'

Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
…for 'pop'

Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
@NikolajBjorner NikolajBjorner merged commit a23ca17 into Z3Prover:master Jun 3, 2020
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.

None yet

2 participants