-
Notifications
You must be signed in to change notification settings - Fork 88
Add experimental generation and validation of YAML witness invariants with preconditions #752
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
Merged
Changes from 14 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
a4ee518
Add yaml witness entries with context precondition
sim642 7dd2066
Add prototype for precondition invariant validation
sim642 42a9465
Add OCaml types for yaml witness entries
sim642 24db283
Add of_yaml to yaml witness types
sim642 548575f
Refactor yaml witness entry handling
sim642 792b8df
Add precondition_loop_invariant_certificate
sim642 193ef7b
Extract invariant parsing to WitnessUtil
sim642 f66ac5c
Extract node locating to WitnessUtil
sim642 d1afe27
Refactor yaml witness validation
sim642 03cbf6f
Change unknown precondition to be excluded from validation
sim642 d45d471
Add option_map and list_map combinators for GobYaml
sim642 a46a6bb
Use GobYaml.list in witness validation
sim642 553f2cd
Merge branch 'master' into yaml-witness-precondition
sim642 e779f93
Merge branch 'master' into yaml-witness-precondition
sim642 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 dd244a5
Merge branch 'master' into yaml-witness-precondition
sim642 4f5ba97
Remove commented-out yaml witness code
sim642 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 9e07541
Merge pull request #786 from goblint/yaml-witness-precondition-groups
sim642 d686533
Merge branch 'master' into yaml-witness-precondition
sim642 f9b85a1
Add YAML witnesses to .gitignore
sim642 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| include Yaml.Util | ||
|
|
||
| let (let*) = Result.bind | ||
| let (let+) r f = Result.map f r | ||
| let (>>=) = Result.bind | ||
|
|
||
| let option_map (f: 'a -> ('b, 'e) result) (o: 'a option): ('b option, 'e) result = | ||
| match o with | ||
| | Some x -> Result.map Option.some (f x) | ||
| | None -> Ok None | ||
|
|
||
| let rec list_map (f: 'a -> ('b, 'e) result) (l: 'a list): ('b list, 'e) result = | ||
| match l with | ||
| | [] -> Ok [] | ||
| | x :: xs -> | ||
| let* y = f x in | ||
| let+ ys = list_map f xs in | ||
| y :: ys | ||
|
|
||
| let find s y = | ||
| (* let* y' = Yaml.Util.find s y in | ||
| match y' with | ||
| | Some y'' -> Ok y'' | ||
| | None -> Error (`Msg ("find " ^ s)) *) | ||
| match Yaml.Util.find s y with | ||
| | Ok y' -> | ||
| begin | ||
| match y' with | ||
| | Some y'' -> Ok y'' | ||
| | None -> Error (`Msg ("find " ^ s)) | ||
| end | ||
| | Error `Msg e -> | ||
| Error (`Msg ("find " ^ s ^ ": " ^ e)) | ||
|
|
||
| let to_int y = | ||
| let+ f = to_float y in | ||
| int_of_float f | ||
|
|
||
| let list = function | ||
| | `A l -> Ok l | ||
| | _ -> Error (`Msg "Failed to get elements from non-array value") | ||
|
|
||
| let entries = function | ||
| | `O assoc -> Ok assoc | ||
| | _ -> Error (`Msg "Failed to get entries from non-object value") | ||
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
Oops, something went wrong.
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.