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

Object domain #60

Open
wants to merge 35 commits into
base: dev
Choose a base branch
from
Open

Object domain #60

wants to merge 35 commits into from

Conversation

LinerSu
Copy link
Contributor

@LinerSu LinerSu commented Sep 21, 2023

A new abstract domain for the refinement of DSA. It keeps relational properties between the fields of memory objects shared in the same DSA node.

caballa and others added 30 commits September 18, 2023 09:51
The decoupled domain allows crab to use two different domains during
the two different phases of the analysis.  In the descending
(narrowing) phase it is possible to use an abstract domain which is
more precise than the domain used in the ascending (widening) phase.

The decoupled domains require two new abstract operations
is_asc_phase() and set_phase() in order to manage ascending and
descending phases. By default, start in *descending* (i.e., more
precise) phase. The interleaved fixpoint iterator has been also
modified to notify the underlying domains when there is change of
(ascending or descending) phase.

Implemented by Greta Dolcetti and Enea Zaffanella.
We minimize string allocation and copies.  Also, we add some macros
that allow each domain to turn on or off statistics collection which
adds a counter and a timer per operation. If stats collection is off
then no string allocation or string copy should take place.

For instance, the region domain enables stats by adding

And the interval domain disables stats by adding

The macro CRAB_DOMAIN_SCOPED_STATS is defined in
crab/domains/abstract_domain_macros.def

In spite of all optimizations, the most efficient thing is to disable
stats collection. By default, only the fixpoint solver and the region
domain turn on stats. This is okay because stats gathering is a
feature intended only for developers. If needed then the developer can
turn on more stats timers and counters and recompile the code.
The master branch is ok. This was introduced in commit
8c0e07f.
We were using const T&& instead of T&& in copy and assignment
operators.  As part of the commit, I also try to use default as much
as possible.

Thanks to Enea Zaffanella to point out the problem with move operators
This macro always used this but it needs to use other in assignment
constructors. The reason is that we can have

T o1;
T o2 = std::move(o1);
o1 = o2; <-- o1 was moved, so CRAB_DOMAIN_SCOPED_STATS should not access to o1.domain_name()

Thanks to Enea Zaffanella to find the problem and explain to me the issue
A symbolic equality domain is an abstract domain which represents
equalities used in analyses for allocation-site abstraction or
domain reduction. In short, giving two program variables are known
to hold equal values in concrete semantics if the analyzer determines
that the variables hold equal symbolic term.
A collection of key and object value pairs for inferring properties
based on DSA analysis. Basically, the domain keep three subdomains
named as cache, summary and equality of fields. The summary domain
keeps properties for all memory objects shared the same DSA node.
The cache domain, however, only keep the Most Recently Used memory
object by memory load / store instruction. The way to determine
which memory object uses cache domain is depended on object domain.
Meanwhile, an equality of fields abstract domain keeps equalities
between register (or scalars) and fields.
A new abstract domain followed by a new memory abstraction based on
DSA analysis to infer relational properties between fields. The domain
is split into several subdomains in order to reduce the complexity of
the anlysis. In terms of precision, the object domain maintain
equalities property between memory load and store to refine the relational
properties between fields. There also involves domain reduction for
precision refinement. Overall, This is a new abstract domain
for the refinement of DSA analysis to infer properties of memory objects.
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.

None yet

3 participants