Skip to content

Conversation

viktormalik
Copy link
Collaborator

@viktormalik viktormalik commented Nov 20, 2022

List of changes:

  • Support combination of --values-refine and --k-induction - so far, we supported --values-refine for AI only, which was fine since it was needed for heap for which we disabled k-induction. Now with the new unwinding, we need to support --values-refine for k-induction, too.
  • Disable --std-invariants for --k-induction as it causes more problems than just for the array invariants (fixed in Support arrays with standard invariants #171). It also makes heap-data examples not to pass.
  • Make user inputs (from *scanf calls) non-deterministic.
  • Fixes for dynamic object splitting, array domain template, and witness generation

The last number of the symbol is not necessarily the location number
since it may be the unwinding number. Handle that it
localSSAt::get_loc_with_symbol_def.
@viktormalik
Copy link
Collaborator Author

@peterschrammel do you think that disabling --std-invariants completely will cause some trouble?

If --values-refine is on, we first try the intervals domain and then the
zones domain. Until now, this has been supported for AI only, now
support for k-induction, too.

This requires some tests to use --intervals instead of --values-refine
since the zones invariant inference takes too long.
Standard invariants seem to cause more trouble than with array
invariants (already fixed). Let us try to disable them completely since
they should bring no significant benefits.

There are some tests which still require standard invariants with
k-induction. Add the option explicitly and we will debug them later.
There must be no code between creating dynamic objects (replace malloc)
and splitting them into instances since if the code in between changes
numbering of GOTO nodes, the split objects may have a different location
number than the original objects (which contain also a concrete object).

This may cause some trouble later, especially with the zones domain,
when it would add differences between fields of objects that can never
be allocated at the same time (have contradictory allocation guards).
Such template rows would make the invariant incomputable, yielding false
negative results.
Array domain uses some extra renamings in post_renaming_map. These are
cleared in the array domain constructor, however, they remain there if
no array template is created (when there are no array variables), which
may intercept other domains.

Fix the problem by removing the renamings if no array template is
created.
@viktormalik viktormalik marked this pull request as draft November 21, 2022 16:43
viktormalik and others added 2 commits January 9, 2023 09:53
Contains a fix of GOTO intstruction scopes in witnesses.
Signed-off-by: František Nečas <[email protected]>
@viktormalik
Copy link
Collaborator Author

Added some more fixes and updated the description. After this is merged, I'll do a new release.

@viktormalik viktormalik marked this pull request as ready for review January 9, 2023 09:11
@viktormalik
Copy link
Collaborator Author

cc @FrNecas


/// Makes user input nondeterministic, i.e. arguments of fscanf starting
/// from the second one are assigned a nondeterministic value.
void twols_parse_optionst::make_scanf_nondet(goto_modelt &goto_model)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not for this PR) Shouldn't this rather have a fix in CBMC's models library?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I saw Michael fixing this in CBMC so it should already be fixed, we just need to update again, so this is a temporary workaround :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about cherry-picking that fix to our fork, but I don't think it would have been that straight forward, there were more changes in the source code of C function models.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then we can revert on the next CBMC prerequisites upgrade.

@peterschrammel peterschrammel merged commit 59aab25 into diffblue:master Jan 9, 2023
@viktormalik viktormalik deleted the svcomp-fixes branch January 25, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants