-
Notifications
You must be signed in to change notification settings - Fork 88
Precondition Invariant: Disjunct over matching state invariants #786
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
Merged
sim642
merged 18 commits into
yaml-witness-precondition
from
yaml-witness-precondition-groups
Aug 4, 2022
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f58c4ec
Add example where the generated witnesses are unsound.
jerhard 2114d85
Extract common function for creating contexts
jerhard 4b85cca
Extract check whether node is Statement out of node_context
jerhard 1c23167
Collect contexts that may satiesfy context invariants
jerhard 0b7dca4
PreconditionInvariants: Create postcondition as disjunction of matchi…
jerhard e109d60
Fix indentation
jerhard 8240a09
Fix comments
jerhard e4fb856
Precondition invariants: Handle case when invariant cannot be generat…
jerhard 13dbcc3
Add missing word in comment
jerhard 470c126
Fix comments and indentation
jerhard dc260c0
Use start state instead of context for generating preconditions
jerhard 2b6abe4
Merge branch 'yaml-witness-precondition' into yaml-witness-preconditi…
sim642 da65728
Move ask_local_node into YamlWitness.Query
sim642 948cd31
Prefer ask_local over ask_local_node in YamlWitness
sim642 b50801e
Explicitely use BatHashtbl instead of doing it via Prelude.Hashtbl.
jerhard 8f4cffc
Move comment about why we do not generate invariants for FunctionEntr…
jerhard b5ce4ba
Add comment to use IterSysVars when #391 (interactive) is merged
jerhard c1e9359
Check whether current_c.invariant can be generated before iterating o…
jerhard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //PARAM: --enable witness.yaml.enabled --enable ana.int.interval | ||
| #include <stdlib.h> | ||
|
|
||
| int foo(int* ptr1, int* ptr2){ | ||
| int result; | ||
| if(ptr1 == ptr2){ | ||
| result = 0; | ||
| } else { | ||
| result = 1; | ||
| } | ||
| // Look at the generated witness.yml to check whether there are contradictory precondition_loop_invariant[s] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't great as a test, but without something like #787 we cannot do any better either. |
||
| return result; | ||
| } | ||
|
|
||
| int main(){ | ||
| int five = 5; | ||
| int five2 = 5; | ||
| int y = foo(&five, &five); | ||
| int z = foo(&five, &five2); | ||
| assert(y != z); | ||
| return 0; | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.