Skip to content

Commit

Permalink
Merge pull request #796 from goblint/yaml-witness-unassume
Browse files Browse the repository at this point in the history
Unassume witness invariants during solving
  • Loading branch information
sim642 authored Jan 2, 2023
2 parents ca7b8ce + 6e76ea6 commit 9ce9249
Show file tree
Hide file tree
Showing 110 changed files with 4,802 additions and 887 deletions.
50 changes: 50 additions & 0 deletions bench/zarith/benchZarith.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(** Benchmark calculation of powers of 2 with Zarith.
Originally for https://github.com/goblint/cil/pull/115.
dune exec bench/zarith/benchZarith.exe -- -a *)

open Benchmark
open Benchmark.Tree


let () =
let pow2_pow n = Big_int_Z.power_int_positive_int 2 n in
let pow2_lsl n = Big_int_Z.shift_left_big_int Big_int_Z.unit_big_int n in


register (
"pow2" @>>> [
"8" @> lazy (
let arg = 8 in
throughputN 1 [
("pow", pow2_pow, arg);
("lsl", pow2_lsl, arg);
]
);
"16" @> lazy (
let arg = 16 in
throughputN 1 [
("pow", pow2_pow, arg);
("lsl", pow2_lsl, arg);
]
);
"32" @> lazy (
let arg = 32 in
throughputN 1 [
("pow", pow2_pow, arg);
("lsl", pow2_lsl, arg);
]
);
"64" @> lazy (
let arg = 64 in
throughputN 1 [
("pow", pow2_pow, arg);
("lsl", pow2_lsl, arg);
]
);
]
)


let () =
run_global ()
4 changes: 4 additions & 0 deletions bench/zarith/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(name benchZarith)
(optional) ; TODO: for some reason this doesn't work: `dune build` still tries to compile if benchmark missing (https://github.com/ocaml/dune/issues/4065)
(libraries benchmark zarith))
76 changes: 76 additions & 0 deletions conf/bench-yaml-validate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"ana": {
"int": {
"def_exc": true,
"enums": false,
"interval": true
},
"activated": [
"expRelation",
"base",
"threadid",
"threadflag",
"threadreturn",
"escape",
"mutexEvents",
"mutex",
"access",
"mallocWrapper",
"mhp",
"assert",
"unassume"
],
"malloc": {
"wrappers": [
"kmalloc",
"__kmalloc",
"usb_alloc_urb",
"__builtin_alloca",
"kzalloc",

"ldv_malloc",

"kzalloc_node",
"ldv_zalloc",
"kmalloc_array",
"kcalloc",

"ldv_xmalloc",
"ldv_xzalloc",
"ldv_calloc"
]
},
"widen": {
"tokens": true
}
},
"witness": {
"enabled": false,
"invariant": {
"loop-head": true,
"after-lock": true,
"other": false
}
},
"sem": {
"unknown_function": {
"invalidate": {
"globals": false
},
"spawn": true
},
"builtin_unreachable": {
"dead_code": true
},
"int": {
"signed_overflow": "assume_none"
}
},
"pre": {
"cppflags": [
"-DGOBLINT_NO_PTHREAD_ONCE",
"-DGOBLINT_NO_QSORT",
"-DGOBLINT_NO_BSEARCH"
]
}
}
78 changes: 78 additions & 0 deletions conf/bench-yaml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"ana": {
"int": {
"def_exc": true,
"enums": false,
"interval": true
},
"activated": [
"expRelation",
"base",
"threadid",
"threadflag",
"threadreturn",
"escape",
"mutexEvents",
"mutex",
"access",
"mallocWrapper",
"mhp",
"assert"
],
"malloc": {
"wrappers": [
"kmalloc",
"__kmalloc",
"usb_alloc_urb",
"__builtin_alloca",
"kzalloc",

"ldv_malloc",

"kzalloc_node",
"ldv_zalloc",
"kmalloc_array",
"kcalloc",

"ldv_xmalloc",
"ldv_xzalloc",
"ldv_calloc"
]
}
},
"witness": {
"enabled": false,
"yaml": {
"enabled": true
},
"invariant": {
"exact": false,
"exclude-vars": [
"tmp\\(___[0-9]+\\)?",
"cond",
"RETURN"
]
}
},
"sem": {
"unknown_function": {
"invalidate": {
"globals": false
},
"spawn": true
},
"builtin_unreachable": {
"dead_code": true
},
"int": {
"signed_overflow": "assume_none"
}
},
"pre": {
"cppflags": [
"-DGOBLINT_NO_PTHREAD_ONCE",
"-DGOBLINT_NO_QSORT",
"-DGOBLINT_NO_BSEARCH"
]
}
}
94 changes: 94 additions & 0 deletions conf/svcomp-yaml-validate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"ana": {
"sv-comp": {
"enabled": true,
"functions": true
},
"int": {
"def_exc": true,
"enums": false,
"interval": true
},
"float": {
"interval": true
},
"activated": [
"base",
"threadid",
"threadflag",
"threadreturn",
"mallocWrapper",
"mutexEvents",
"mutex",
"access",
"race",
"escape",
"expRelation",
"mhp",
"assert",
"var_eq",
"symb_locks",
"region",
"thread",
"threadJoins",
"unassume"
],
"context": {
"widen": false
},
"malloc": {
"wrappers": [
"kmalloc",
"__kmalloc",
"usb_alloc_urb",
"__builtin_alloca",
"kzalloc",

"ldv_malloc",

"kzalloc_node",
"ldv_zalloc",
"kmalloc_array",
"kcalloc",

"ldv_xmalloc",
"ldv_xzalloc",
"ldv_calloc"
]
},
"base": {
"arrays": {
"domain": "partitioned"
}
},
"autotune": {
"enabled": false
},
"widen": {
"tokens": true
}
},
"exp": {
"region-offsets": true
},
"witness": {
"enabled": false,
"invariant": {
"loop-head": true,
"after-lock": false,
"other": false
}
},
"solver": "td3",
"sem": {
"unknown_function": {
"spawn": false
},
"int": {
"signed_overflow": "assume_none"
},
"null-pointer": {
"dereference": "assume_none"
}
}
}
Loading

0 comments on commit 9ce9249

Please sign in to comment.