Skip to content
Open
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
934cf98
Copied lineartwovarequalityanalysis and domain, including tests
manuel-pietsch Jan 17, 2025
41135b8
added intervals, does not work yet
manuel-pietsch Feb 3, 2025
231e164
Simple tests are working, no regression failures anymore
manuel-pietsch Feb 5, 2025
5bdf17f
extended conditions + small cleanup
manuel-pietsch Feb 10, 2025
f2e1fb6
Add config for gobcron testing
manuel-pietsch Feb 12, 2025
003f332
second conf for testing
manuel-pietsch Feb 14, 2025
8e5ff62
Take advantage of congruence information for refinement and asserts
manuel-pietsch Feb 15, 2025
1d6ebc2
Fixes for meeting returning bot, Small cleanup
manuel-pietsch Feb 17, 2025
a1b3eba
Fix refinement leading to bot, but not propagating
manuel-pietsch Feb 17, 2025
e77e800
Fix evaluation using new context
manuel-pietsch Feb 17, 2025
e30d79f
Modulo conditions supported
manuel-pietsch Feb 18, 2025
e31836a
Fixed join not considering congruence constraints generated by rhs
manuel-pietsch Feb 18, 2025
f215565
Fixed modular inverse for negative numbers, small adaptations
manuel-pietsch Feb 19, 2025
5542e79
Indentation
manuel-pietsch Feb 19, 2025
6da7797
Revert changes to affine_transform
manuel-pietsch Feb 19, 2025
a84c202
More flexible invariant handling, refining all occuring vars
manuel-pietsch Feb 22, 2025
7b7e55f
Better bounds checking for overflow, regression tests
manuel-pietsch Feb 25, 2025
d5ec239
Splitting Subdomains into a separate file. Change function names ment…
manuel-pietsch Feb 26, 2025
ce074de
Added Interface for Inequalities and integrated it into the lin2var_p…
manuel-pietsch Feb 28, 2025
9e61cec
Simple Inequalities implemented, but not completely tested
manuel-pietsch Mar 3, 2025
17047fa
transfering inequalities when assigning, bug fix in to_inequalities
manuel-pietsch Mar 6, 2025
34331f1
Integrate Interval / Congruence with bounds into the original files
manuel-pietsch Mar 6, 2025
c74832f
Use queries when assigning expressions
manuel-pietsch Mar 6, 2025
2deec18
Fixed small bugs
manuel-pietsch Mar 6, 2025
3fee377
Fixed more bugs
manuel-pietsch Mar 6, 2025
280be0d
Fixed forget_variable not keeping invariant when root was deleted, ad…
manuel-pietsch Mar 7, 2025
b602814
Make InEq stay sparse
manuel-pietsch Mar 7, 2025
99ed24b
Fixed get_value not returning correct congruence information. Make al…
manuel-pietsch Mar 7, 2025
cfad8f6
Revert changes to affine_transform, add comment why this is correct
manuel-pietsch Mar 8, 2025
87bba0c
Make Termination Analysis use new domain instead of apron polyhedra (…
manuel-pietsch Mar 11, 2025
8489b54
Fix TopIntOps returning usefull values for widening when bound is top
manuel-pietsch Mar 11, 2025
2ccdc55
start of Complex linear inequalities, make join part of common action…
manuel-pietsch Mar 20, 2025
937c0fc
fix accidentialy duplicated regression test
manuel-pietsch Mar 20, 2025
6e8ee16
finish linear inequalities, generate inequalities with offset, allow …
manuel-pietsch Mar 25, 2025
03b9f0a
small fixes, debugging output
manuel-pietsch Mar 25, 2025
8788cdd
more fixing
manuel-pietsch Mar 25, 2025
5b8fa24
make sure we only save relations for the roots, simple transfering
manuel-pietsch Mar 26, 2025
582919b
remove value when the variable is replaced by a constant
manuel-pietsch Mar 26, 2025
2222c20
fixed using wrong variable to calculate value refinements
manuel-pietsch Mar 27, 2025
2ac6636
fixed looking at wrong bound in interval
manuel-pietsch Mar 27, 2025
06bde16
larger rework of linear inequalities
manuel-pietsch Apr 10, 2025
7ae6dda
first round of fixes
manuel-pietsch Apr 10, 2025
f42c066
second round of fixes
manuel-pietsch Apr 10, 2025
9b521db
make it non-strict equalities
manuel-pietsch Apr 11, 2025
457ec76
missed value refinement
manuel-pietsch Apr 11, 2025
e309216
more off-by-one errors
manuel-pietsch Apr 11, 2025
7e29720
fix widening (and leq?)
manuel-pietsch Apr 11, 2025
2d72269
leq fixed now?
manuel-pietsch Apr 11, 2025
2cba0cf
another fix for leq where different kinds of bot did not return the c…
manuel-pietsch Apr 11, 2025
0d22d78
join implement splitting
manuel-pietsch Apr 26, 2025
2d4da5d
cache slopes
manuel-pietsch Apr 26, 2025
cf60376
reworked limit to be lazy and need less memory
manuel-pietsch Apr 29, 2025
549b38a
invariant implemented, TODO cleanup and sorting
manuel-pietsch May 2, 2025
64f0810
fix substitution not handeling swapping sides
manuel-pietsch May 2, 2025
c3a6db2
small fixes
manuel-pietsch May 2, 2025
8c4de9f
renaming GT/LT to GE/LE to better reflect current purpose. Bugfixing …
manuel-pietsch May 3, 2025
41f69c2
small fix: order correctly
manuel-pietsch May 3, 2025
992c54c
refinement: general structure, allow for equality refinement, refine …
manuel-pietsch May 3, 2025
069d3de
allow conversion to tcons for inverted conditions
manuel-pietsch May 3, 2025
3ed88f2
refinement: refinement everywhere + some cleanup
manuel-pietsch May 6, 2025
5d8207c
leq: do value refinement until fixpoint to properly represent relatio…
manuel-pietsch May 7, 2025
b825fc0
in meet_relation, add some transitive inequalities. small fixes and c…
manuel-pietsch May 12, 2025
40b19c0
small fixes
manuel-pietsch May 12, 2025
9c534db
more fixes
manuel-pietsch May 13, 2025
b2e7eaa
fixed join not being monotonic, also join inequalities where the othe…
manuel-pietsch May 16, 2025
2dacbbe
accelerated narrowing, formatting
manuel-pietsch May 19, 2025
22eb2b3
Allow division in linear relation if congruence proves exactness, sma…
manuel-pietsch May 21, 2025
de4e5bb
do not lose value information when entering a function body
manuel-pietsch May 23, 2025
17e223b
add missing
manuel-pietsch Jun 14, 2025
3902ccc
Merge remote-tracking branch 'goblint/master'
manuel-pietsch Jun 14, 2025
bc169d8
Rename file
manuel-pietsch Jun 14, 2025
6890fa9
forgot adding dune file
manuel-pietsch Jun 15, 2025
3019518
add weaker domains, proper options
manuel-pietsch Jun 19, 2025
567301b
forgot staging formatting
manuel-pietsch Jun 19, 2025
3c2b527
Merge branch 'goblint:master' into master
manuel-pietsch Jun 23, 2025
287a6eb
keep map properly sparse, small fixes
manuel-pietsch Jun 23, 2025
7ee3c88
use succ / pred
manuel-pietsch Jun 23, 2025
1cc06dc
delete configuration for testing
manuel-pietsch Jun 23, 2025
8ce2066
small fixes, remove asserts for performance
manuel-pietsch Jun 24, 2025
d626bbd
fixed bug in join
manuel-pietsch Jun 24, 2025
ec41fb5
revert last commit and include actual fix
manuel-pietsch Jun 29, 2025
67f4207
Fix wrong results and other bugs, remove unused top function
manuel-pietsch Jul 2, 2025
d00764a
fixes: do not report overflow in conversions to base, nontermination …
manuel-pietsch Jul 5, 2025
7bc66ac
reenable interval narrowing after fixing underlying bug, disable asse…
manuel-pietsch Jul 6, 2025
c093c14
fix regression test: wrong optimisation of join. Cleanup TODOs
manuel-pietsch Jul 7, 2025
8426027
Merge branch 'master' into master
DrMichaelPetter Jul 16, 2025
d6f829f
move regression tests
manuel-pietsch Jul 18, 2025
e9ef54f
Merge remote-tracking branch 'goblint/master'
manuel-pietsch Jul 18, 2025
9ff7ece
Ignore division by zero in speculative execution
manuel-pietsch Jul 22, 2025
de46b15
use Seq instead of Enum
manuel-pietsch Jul 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions conf/svcomp25_testing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"ana": {
"sv-comp": {
"enabled": true,
"functions": true
},
"int": {
"def_exc": true,
"enums": false,
"interval": true
},
"float": {
"interval": true,
"evaluate_math_functions": true
},
"activated": [
"base",
"threadid",
"threadflag",
"threadreturn",
"mallocWrapper",
"mutexEvents",
"mutex",
"access",
"race",
"escape",
"expRelation",
"mhp",
"assert",
"var_eq",
"symb_locks",
"region",
"thread",
"threadJoins",
"abortUnless",
"lin2vareq_p"
],
"path_sens": [
"mutex",
"malloc_null",
"uninit",
"expsplit",
"activeSetjmp",
"memLeak",
"threadflag"
],
"context": {
"widen": false
},
"base": {
"arrays": {
"domain": "partitioned"
}
},
"race": {
"free": false,
"call": false
},
"lin2vareq_p": {
"inequalities" : "coeffs_threshold"
},
"autotune": {
"enabled": false,
"activated": [
"singleThreaded",
"mallocWrappers",
"noRecursiveIntervals",
"enums",
"congruence",
"octagon",
"wideningThresholds",
"loopUnrollHeuristic",
"memsafetySpecification",
"noOverflows",
"termination",
"tmpSpecialAnalysis"
],
"extraTerminationDomain": "lin2vareq_p"
}
},
"exp": {
"region-offsets": true
},
"solver": "td3",
"sem": {
"unknown_function": {
"spawn": false
},
"int": {
"signed_overflow": "assume_none"
},
"null-pointer": {
"dereference": "assume_none"
}
},
"witness": {
"graphml": {
"enabled": true,
"id": "enumerate",
"unknown": false
},
"yaml": {
"enabled": true,
"format-version": "2.0",
"entry-types": [
"invariant_set"
],
"invariant-types": [
"loop_invariant"
]
},
"invariant": {
"loop-head": true,
"after-lock": false,
"other": false,
"accessed": false,
"exact": true
}
},
"pre": {
"enabled": false
}
}
119 changes: 119 additions & 0 deletions conf/svcomp25_testing2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"ana": {
"sv-comp": {
"enabled": true,
"functions": true
},
"int": {
"def_exc": true,
"enums": false,
"interval": true
},
"float": {
"interval": true,
"evaluate_math_functions": true
},
"activated": [
"base",
"threadid",
"threadflag",
"threadreturn",
"mallocWrapper",
"mutexEvents",
"mutex",
"access",
"race",
"escape",
"expRelation",
"mhp",
"assert",
"var_eq",
"symb_locks",
"region",
"thread",
"threadJoins",
"abortUnless",
"lin2vareq"
],
"path_sens": [
"mutex",
"malloc_null",
"uninit",
"expsplit",
"activeSetjmp",
"memLeak",
"threadflag"
],
"context": {
"widen": false
},
"base": {
"arrays": {
"domain": "partitioned"
}
},
"race": {
"free": false,
"call": false
},
"autotune": {
"enabled": false,
"activated": [
"singleThreaded",
"mallocWrappers",
"noRecursiveIntervals",
"enums",
"congruence",
"octagon",
"wideningThresholds",
"loopUnrollHeuristic",
"memsafetySpecification",
"noOverflows",
"termination",
"tmpSpecialAnalysis"
]
}
},
"exp": {
"region-offsets": true
},
"solver": "td3",
"sem": {
"unknown_function": {
"spawn": false
},
"int": {
"signed_overflow": "assume_none"
},
"null-pointer": {
"dereference": "assume_none"
}
},
"witness": {
"graphml": {
"enabled": true,
"id": "enumerate",
"unknown": false
},
"yaml": {
"enabled": true,
"format-version": "2.0",
"entry-types": [
"invariant_set"
],
"invariant-types": [
"loop_invariant"
]
},
"invariant": {
"loop-head": true,
"after-lock": false,
"other": false,
"accessed": false,
"exact": true
}
},
"pre": {
"enabled": false
}
}
40 changes: 40 additions & 0 deletions src/analyses/apron/linearTwoVarEqualityAnalysisPentagon.apron.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
(** {{!RelationAnalysis} Relational integer value analysis} using an OCaml implementation of the linear two-variable equalities domain ([lin2vareq]).

@see <http://doi.acm.org/10.1145/2049706.2049710> A. Flexeder, M. Petter, and H. Seidl Fast Interprocedural Linear Two-Variable Equalities. *)

open Analyses
include RelationAnalysis

module NoIneq = LinearTwoVarEqualityDomainPentagon.D2(RepresentantDomains.NoInequalties)
module PentagonIneq = LinearTwoVarEqualityDomainPentagon.D2(RepresentantDomains.InequalityFunctor(RepresentantDomains.PentagonCoeffs))
module PentagonOffsetIneq = LinearTwoVarEqualityDomainPentagon.D2(RepresentantDomains.InequalityFunctor(RepresentantDomains.PentagonOffsetCoeffs))
module FullIneq = LinearTwoVarEqualityDomainPentagon.D2(RepresentantDomains.InequalityFunctor(RepresentantDomains.TwoVarInequalitySet))

let spec_module: (module MCPSpec) Lazy.t =
lazy (
let (module AD) = match GobConfig.get_string "ana.lin2vareq_p.inequalities" with
| "none" -> (module NoIneq : RelationDomain.RD)
| "pentagon" -> (module PentagonIneq : RelationDomain.RD)
| "pentagon_offset" -> (module PentagonOffsetIneq : RelationDomain.RD)
| _ -> (module FullIneq : RelationDomain.RD) (*Other options differ only in the limit function*)
in
let module Priv = (val RelationPriv.get_priv ()) in
let module Spec =
struct
include SpecFunctor (Priv) (AD) (RelationPrecCompareUtil.DummyUtil)
let name () = "lin2vareq_p"
end
in
(module Spec)
)

let get_spec (): (module MCPSpec) =
Lazy.force spec_module

let after_config () =
let module Spec = (val get_spec ()) in
MCP.register_analysis (module Spec : MCPSpec);
GobConfig.set_string "ana.path_sens[+]" (Spec.name ())

let _ =
AfterConfig.register after_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(* This analysis is empty on purpose. It serves only as an alternative dependency
in cases where the actual domain can't be used because of a missing library.
It was added because we don't want to fully depend on Apron. *)
6 changes: 3 additions & 3 deletions src/autoTune.ml
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ let focusOnMemSafetySpecification () =
let focusOnTermination (spec: Svcomp.Specification.t) =
match spec with
| Termination ->
let terminationAnas = ["threadflag"; "apron"] in
let terminationAnas = ["threadflag"; get_string "ana.autotune.extraTerminationDomain"] in
enableAnalyses "Specification: Termination" "termination analyses" terminationAnas;
set_string "sem.int.signed_overflow" "assume_none";
set_bool "ana.int.interval" true;
set_string "ana.apron.domain" "polyhedra"; (* TODO: Needed? *)
()
if get_string "ana.autotune.extraTerminationDomain" = "apron" then
set_string "ana.apron.domain" "polyhedra"; (* TODO: Needed? *)
| _ -> ()

let focusOnTermination () =
Expand Down
71 changes: 54 additions & 17 deletions src/cdomain/value/cdomains/int/congruenceDomain.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
open IntDomain0
open GoblintCil

module type Norm = sig
val normalize : ikind -> (Z.t * Z.t) option -> (Z.t * Z.t) option
end

module Congruence : S with type int_t = Z.t and type t = (Z.t * Z.t) option =
module CongruenceFunctor (Norm : Norm): S with type int_t = Z.t and type t = (Z.t * Z.t) option =
struct
let name () = "congruences"
type int_t = Z.t
Expand All @@ -24,22 +27,7 @@ struct
let ( |: ) a b =
if a =: Z.zero then false else (b %: a) =: Z.zero

let normalize ik x =
match x with
| None -> None
| Some (c, m) ->
if m =: Z.zero then
if should_wrap ik then
Some (Size.cast ik c, m)
else
Some (c, m)
else
let m' = Z.abs m in
let c' = c %: m' in
if c' <: Z.zero then
Some (c' +: m', m')
else
Some (c' %: m', m')
let normalize = Norm.normalize

let range ik = Size.range ik

Expand Down Expand Up @@ -540,3 +528,52 @@ struct

let project ik p t = t
end

module Wrapping : Norm = struct

let (%:) = Z.rem
let (=:) = Z.equal
let (+:) = Z.add
let (<:) x y = Z.compare x y < 0

let normalize ik x =
match x with
| None -> None
| Some (c, m) ->
if m =: Z.zero then
if should_wrap ik then
Some (Size.cast ik c, m)
else
Some (c, m)
else
let m' = Z.abs m in
let c' = c %: m' in
if c' <: Z.zero then
Some (c' +: m', m')
else
Some (c' %: m', m')
end

module NoWrapping : Norm = struct

let (%:) = Z.rem
let (=:) = Z.equal
let (+:) = Z.add
let (<:) x y = Z.compare x y < 0

let normalize ik x =
match x with
| None -> None
| Some (c, m) ->
if m =: Z.zero then
Some (c, m)
else
let m' = Z.abs m in
let c' = c %: m' in
if c' <: Z.zero then
Some (c' +: m', m')
else
Some (c' %: m', m')
end

module Congruence = CongruenceFunctor(Wrapping)
Loading
Loading