Skip to content

Comments

Fixing the readme example to use z3 and to generate a witness:#140

Open
sohah wants to merge 1 commit intoSymbolicPathFinder:sv-compfrom
formal-pro:sv-comp
Open

Fixing the readme example to use z3 and to generate a witness:#140
sohah wants to merge 1 commit intoSymbolicPathFinder:sv-compfrom
formal-pro:sv-comp

Conversation

@sohah
Copy link

@sohah sohah commented Jan 7, 2026

The example in the readme is not working with the current setup. It uses choco, as the default solver. But there are multiple of problems with this. First, choco does not work with non-linear arithemtic, thus this example as it uses a divide operation, is not very nice example for using choco. The other reason is that choco actually is creating a wrong constraint, thus ignoring going deeper into the program, when it backtracks it is able to detect the div by zero, but there is an issue at an earlier point that needs to be addressed. I'll open up an issue with that problem.

This PR makes the following changes

  1. change the NumericExample.jpf to use z3
  2. changing the NumbericExample.java to use Verifier.nondetInt() to create the symbolic integer and chaning the NumericExample.jpf accordingly.
  3. Adding in the readme information about how to check the witness for the NumericExample.java, and clarifying that the program-under-test needs to use specific methods to create symbolic variables for it to trigger the creation of the witness in a graphml format.

1. The default choco solver cannot deal with non-linear arithmetic moreover, choco solver has a bug that which I will open an issue for it.
2. The witness generation requires using Verifier.<something>() or Debug.makeSymbolic<something>(), so it can intercept the particular variable and starts creating the graphml
@sohah
Copy link
Author

sohah commented Jan 20, 2026

Hi @yannicnoller , do you have any comments on this PR, if not, then can you please accept. Thanks!

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.

1 participant