analyzer icon indicating copy to clipboard operation
analyzer copied to clipboard

Remove `ID.is_bool` and `ID.is_int`

Open sim642 opened this issue 1 year ago • 1 comments

This fixes an assert failing in sv-benchmarks/c/recursive/MultCommutative-2 here: https://github.com/goblint/analyzer/blob/a4e917f86c983d7c97138364b07e031a7715e3d5/src/analyses/base.ml#L2216-L2220 The problem was that ID.is_bool value = true but ID.to_bool = None, which of course shouldn't happen.

The offending value is (0,[1,1]), which is the result of a sequence of imprecise refinements (documented in TODOs). These don't happen with --set ana.int.refinement once, but these imprecisions are nontrivial to avoid (e.g. intervals cannot represent exclusion sets).

The easier way to avoid the inconsistency between is_bool and to_bool is not to have is_bool because is_bool x is equivalent to to_bool x <> None. Most places where we use is_bool also end up calling to_bool, like above, which doubles the work. Same goes for is_int.

sim642 avatar Aug 24 '22 13:08 sim642

I did an sv-benchmarks run with this for good measure. That single benchmark went from ASSERTION to TIMEOUT, but at least there's no regression to results or performance.

sim642 avatar Aug 25 '22 07:08 sim642