Skip to content

Adding witness generation to SymbolicListener GSoC 2024 project#104

Open
kylekim72 wants to merge 31 commits intoSymbolicPathFinder:sv-compfrom
kylekim72:sv-comp
Open

Adding witness generation to SymbolicListener GSoC 2024 project#104
kylekim72 wants to merge 31 commits intoSymbolicPathFinder:sv-compfrom
kylekim72:sv-comp

Conversation

@kylekim72
Copy link

Hi there,

Here is the list that shows the changes in SPF.

  1. I wrote a code to generate violation witness at SymbolicListener.java. It starts writing witness with reading "witness_template_minimal.txt", thus I added witness_template directory at jpf-symbc.

  2. We decided to use Debug.makeSymbolicBoolean() instead of Verifier.randomBool() to generate witness. Therefore, I changed Verifier.java.

When you have a moment, please give me some comments to improve. Thank you!

Copy link

@sohah sohah left a comment

Choose a reason for hiding this comment

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

I looked at this pull requests, and it needs serious refactoring. Please check out the specific comments on the code, but here are some general comments:

  1. Make a witness package that has all the necessary code for generating the witness.
  2. Refactor your code so that we can see the GraphML as java objects, this means we want to see a GraphML class that contains Node, and Edge objects. Then you'll need to serialize these objects to string, then to the witness file.
  3. Clean up all commented statements
  4. Include comments for all the classes and methods you are using, follow the Java documentation guidelines for that
  5. Files that contain template should exist under the "src/main/resources" directory within the project
  6. You should aim that the SymbolicListener would have a minimal added/modified code. Mostly method invocation to the Witness generation package.
  7. The state variable 'interceptSymbolic' needs to be set and reset correctly, check out my detailed comment on your code.

VM vm = search.getVM();
// Path to the witness template
// Assume working directory is SPF
String inputFilePath = "./jpf-symbc/witness_template/witness_template_minimal.txt";
Copy link

Choose a reason for hiding this comment

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

This file needs to be under "src/main/resources" directory.

@kylekim72
Copy link
Author

kylekim72 commented Aug 25, 2024

@sohah , I fixed my code based on your advice. Please take a look and give me some other feedbacks when you have a moment. Thank you!

Copy link

@sohah sohah left a comment

Choose a reason for hiding this comment

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

I have went over the readme instructions, and cannot reproduce the same outputs you've indicated, please look at the specific comments that I have left you, and let me know when you've addressed them. Thank you.

README.md Outdated
echo "symbolic.dp=z3bitvector" >> $DIR/config.jpf
echo "symbolic.bvlength=64" >> $DIR/config.jpf
echo "search.depth_limit=200" >> $DIR/config.jpf
echo "symbolic.strings=true" >> $DIR/config.jpf
Copy link

Choose a reason for hiding this comment

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

I think this configuration is wrong, you cannot have the string support enabled. This is going to give an error. Have you tried that? is this what you are using?
The readme should be very easy to follow and to reproduce the results that you have on your machine.

Copy link
Author

Choose a reason for hiding this comment

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

Yes it works. I used this when I ran all the benchmarks. I think symbolic string support isn't implemented yet, so regardless of whether the symbolic string option is turned on or off, it will just run as if it's turned off. This is just my guess, so if you have any other thoughts, please let me know.

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