Skip to content

Commit

Permalink
Merge pull request #1357 from goblint/yaml-witness-test
Browse files Browse the repository at this point in the history
Add cram tests for YAML witnesses
  • Loading branch information
sim642 authored Apr 4, 2024
2 parents 049d42b + 6f3fc9c commit dd8e25e
Show file tree
Hide file tree
Showing 19 changed files with 1,440 additions and 138 deletions.
2 changes: 1 addition & 1 deletion goblint.opam
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ dev-repo: "git+https://github.com/goblint/analyzer.git"
available: os-distribution != "alpine" & arch != "arm64"
pin-depends: [
# published goblint-cil 2.0.3 is currently up-to-date, so no pin needed
[ "goblint-cil.2.0.3" "git+https://github.com/goblint/cil.git#fb471582d7e9685ab705ba57f7a6675b97ca8f64" ]
[ "goblint-cil.2.0.3" "git+https://github.com/goblint/cil.git#ae3a4949d478fad77e004c6fe15a7c83427df59f" ]
# TODO: add back after release, only pinned for optimization (https://github.com/ocaml-ppx/ppx_deriving/pull/252)
[ "ppx_deriving.5.2.1" "git+https://github.com/ocaml-ppx/ppx_deriving.git#0a89b619f94cbbfc3b0fb3255ab4fe5bc77d32d6" ]
]
Expand Down
2 changes: 1 addition & 1 deletion goblint.opam.locked
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ post-messages: [
pin-depends: [
[
"goblint-cil.2.0.3"
"git+https://github.com/goblint/cil.git#fb471582d7e9685ab705ba57f7a6675b97ca8f64"
"git+https://github.com/goblint/cil.git#ae3a4949d478fad77e004c6fe15a7c83427df59f"
]
[
"ppx_deriving.5.2.1"
Expand Down
2 changes: 1 addition & 1 deletion goblint.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
available: os-distribution != "alpine" & arch != "arm64"
pin-depends: [
# published goblint-cil 2.0.3 is currently up-to-date, so no pin needed
[ "goblint-cil.2.0.3" "git+https://github.com/goblint/cil.git#fb471582d7e9685ab705ba57f7a6675b97ca8f64" ]
[ "goblint-cil.2.0.3" "git+https://github.com/goblint/cil.git#ae3a4949d478fad77e004c6fe15a7c83427df59f" ]
# TODO: add back after release, only pinned for optimization (https://github.com/ocaml-ppx/ppx_deriving/pull/252)
[ "ppx_deriving.5.2.1" "git+https://github.com/ocaml-ppx/ppx_deriving.git#0a89b619f94cbbfc3b0fb3255ab4fe5bc77d32d6" ]
]
Expand Down
1 change: 0 additions & 1 deletion src/witness/yamlWitness.ml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ struct
let query = Queries.Invariant Invariant.default_context in
begin match R.ask_local pre_lvar query with
| `Lifted c_inv ->
let loc = Node.location n in
(* Find unknowns for which the preceding start state satisfies the precondtion *)
let xs = find_matching_states lvar in

Expand Down
14 changes: 14 additions & 0 deletions src/witness/yamlWitnessType.ml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ struct
column: int;
function_: string;
}
[@@deriving ord]

let to_yaml {file_name; file_hash; line; column; function_} =
`O [
Expand Down Expand Up @@ -138,6 +139,7 @@ struct
type_: string;
format: string;
}
[@@deriving ord]

let to_yaml {string; type_; format} =
`O [
Expand All @@ -160,6 +162,7 @@ struct
location: Location.t;
loop_invariant: Invariant.t;
}
[@@deriving ord]

let entry_type = "loop_invariant"

Expand All @@ -182,6 +185,7 @@ struct
location: Location.t;
location_invariant: Invariant.t;
}
[@@deriving ord]

let entry_type = "location_invariant"

Expand All @@ -203,6 +207,7 @@ struct
type t = {
flow_insensitive_invariant: Invariant.t;
}
[@@deriving ord]

let entry_type = "flow_insensitive_invariant"

Expand All @@ -224,6 +229,7 @@ struct
loop_invariant: Invariant.t;
precondition: Invariant.t;
}
[@@deriving ord]

let entry_type = "precondition_loop_invariant"

Expand Down Expand Up @@ -251,6 +257,7 @@ struct
value: string;
format: string;
}
[@@deriving ord]

let invariant_type = "loop_invariant"

Expand Down Expand Up @@ -282,6 +289,7 @@ struct
type t =
| LocationInvariant of LocationInvariant.t
| LoopInvariant of LoopInvariant.t
[@@deriving ord]

let invariant_type = function
| LocationInvariant _ -> LocationInvariant.invariant_type
Expand Down Expand Up @@ -309,6 +317,7 @@ struct
type t = {
invariant_type: InvariantType.t;
}
[@@deriving ord]

let to_yaml {invariant_type} =
`O [
Expand All @@ -327,6 +336,7 @@ struct
type t = {
content: Invariant.t list;
}
[@@deriving ord]

let entry_type = "invariant_set"

Expand All @@ -346,6 +356,7 @@ struct
type_: string;
file_hash: string;
}
[@@deriving ord]

let to_yaml {uuid; type_; file_hash} =
`O [
Expand All @@ -369,6 +380,7 @@ struct
type_: string;
format: string;
}
[@@deriving ord]

let to_yaml {string; type_; format} =
`O [
Expand All @@ -391,6 +403,7 @@ struct
target: Target.t;
certification: Certification.t;
}
[@@deriving ord]

let entry_type = "loop_invariant_certificate"

Expand Down Expand Up @@ -424,6 +437,7 @@ struct
| LoopInvariantCertificate of LoopInvariantCertificate.t
| PreconditionLoopInvariantCertificate of PreconditionLoopInvariantCertificate.t
| InvariantSet of InvariantSet.t
[@@deriving ord]

let entry_type = function
| LocationInvariant _ -> LocationInvariant.entry_type
Expand Down
Loading

0 comments on commit dd8e25e

Please sign in to comment.