Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ana.base.strings.domain option and unit string domain #1208

Merged
merged 8 commits into from
Nov 27, 2023

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Oct 6, 2023

In goblint/bench#62 (comment) I noted:

One possible reason for so many contexts with ana.base.context.non-ptr disabled could be string literals (StrPtr) in address sets, which would be preserved in contexts. ana.base.limit-string-addresses (true by default) doesn't do enough limitation. When true, string literals are handled like a flat lattice (a la constant propagation), which still yields separate contexts for all different calls with string literal arguments. When false, string literals are handled as a set.

It would be possible to do even more limiting: not track any string literals, i.e. use a unit domain for them. I hacked it by making of_string always return StrPtr None. This at least got rid of many contexts for some functions, but not all.

This PR implements that hack more cleanly by extracting a StringDomain module and introducing the option ana.base.strings.domain with three possible values:

  1. disjoint corresponds to ana.base.limit-string-addresses false.
  2. flat corresponds to ana.base.limit-string-addresses true.
  3. unit corresponds to the new even more imprecise domain with no information at all.

@sim642 sim642 added cleanup Refactoring, clean-up feature performance Analysis time, memory usage benchmarking labels Oct 6, 2023
@sim642 sim642 requested a review from michael-schwarz October 6, 2023 15:06
@michael-schwarz
Copy link
Member

I would strategically propose to delay this until @nathanschmidt can integrate his PR #1076 and potentially also #1118, as these will significantly extend the string domains, and the interface that is needed will hopefully be more clear after this (though I am not sure how significant the overlap is between these two issues here anyway).

@nathanschmidt could you comment with an estimated timeline for addressing the comments on the PRs? Iirc you said no earlier than this week?

@sim642
Copy link
Member Author

sim642 commented Oct 7, 2023

Neither of those has to do with the StrPtrs in AddressDomain though: one modifies array domains and the other adds a new relational analysis. So they're orthogonal and there's no conflict.

Right now, the big problem for us analyzing real-world programs is performance, not imprecision. Already given #1126, it's beneficial to have the ability turn off all these new things. We're shooting ourselves in the foot on real-world programs if the analyses keep getting more expensive without a choice.

@nathanschmidt
Copy link
Collaborator

@nathanschmidt could you comment with an estimated timeline for addressing the comments on the PRs? Iirc you said no earlier than this week?

@michael-schwarz I currently have quite some time constraints, but I plan to have a look next week.

@jerhard jerhard self-requested a review November 14, 2023 13:14
@michael-schwarz
Copy link
Member

As I have been delayed with #1076 and #1118, I think it might make sense to merge this before those. Given that this does not change the behavior for SV-COMP, I'd be open to merging it even before Nov 22.

@sim642 sim642 added this to the v2.4.0 milestone Nov 20, 2023
@sim642 sim642 merged commit d5163c9 into master Nov 27, 2023
19 checks passed
@sim642 sim642 deleted the string-unit-domain branch November 27, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarking cleanup Refactoring, clean-up feature performance Analysis time, memory usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants