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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4f956fd
feat: add new abstract operations for calls [ci skip]
caballa Jan 13, 2023
06ea736
feat(domains): added implementation of decoupled domains
gretadolcetti Feb 17, 2023
e5927e4
fix(test): enable inter operations for apron/elina
caballa Apr 4, 2023
a3a721f
perf(varname): avoid calls to + and copies with std::string
caballa Apr 6, 2023
82fb84b
chore: added comments
caballa Apr 6, 2023
b5f62da
perf(domains): use of stats
caballa Apr 14, 2023
ea29513
chore: remove use of std::strlen
caballa Apr 14, 2023
4f1d7ec
chore: rename domain name
caballa Apr 14, 2023
38348a5
perf: avoid unnecessary copies
caballa Apr 18, 2023
93f3356
feat(small-range): add missing api for kind ExactlyOne (#56)
LinerSu Apr 18, 2023
92dfc60
perf(fixpoint): more move magic to reduce copies
caballa Apr 20, 2023
c618526
fix(apron): silent warning in to_disjunctive_linear_system
caballa Jun 2, 2023
d871224
perf: use T&& instead of const T&&
caballa Jun 5, 2023
bf6d7b0
fix: missing header file
caballa Jun 6, 2023
2b4daf9
fix(domains): macro CRAB_DOMAIN_SCOPED_STATS
caballa Jun 8, 2023
7414f75
refactor(fixpo): minor design improvements
caballa Jun 19, 2023
b8be261
chore(analysis): split files
caballa Jun 19, 2023
8b96a3c
perf(domains): avoid useless reductions
caballa Jun 20, 2023
57826e1
refactor(cfg): switch cfg simplify to non-recursive version
caballa Jun 22, 2023
ff8d7cb
chore(domain): pretty printing
caballa Jun 23, 2023
5e36fed
chore(domains): remove compiler warnings
caballa Jun 26, 2023
6576b5b
chore(test): remove compiler warning
caballa Jun 28, 2023
053f789
chore: remove return move(...) to allow RVO
caballa Jun 28, 2023
6ca7e8a
fix(apron_domain): adapt to new pplite 0.11 api
caballa Jun 28, 2023
6ee2c37
chore: big cleanup in bottom_up_inter_analyzer
caballa Jul 14, 2023
355cc73
perf: return const& in get_pre/get_post/get_summary
caballa Jul 14, 2023
dac73f7
fix(wto): add const&
caballa Jul 14, 2023
f24db97
tests: adapt expected format
caballa Sep 16, 2023
0c2fb25
fix(test): instantiate only if APRON/PPLITE enabled
caballa Sep 19, 2023
40c5a28
feat(domain): a new abstract domain for inferring equalities
LinerSu Sep 21, 2023
1b3ea0f
feat(object-domain): add a new map like abstract domain to keep
LinerSu Sep 21, 2023
b52597f
feat(domain): add a new abstract domain to infer object's properties
LinerSu Sep 21, 2023
403ab26
test(object): add unit tests for object domain
LinerSu Sep 21, 2023
e6d21aa
test(symb-var-eq): add unit tests for symbolic variable equality domain
LinerSu Sep 21, 2023
9177d8f
feat(params): add object domain parameters
LinerSu Sep 21, 2023
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
Prev Previous commit
Next Next commit
perf: avoid unnecessary copies
  • Loading branch information
caballa committed Sep 18, 2023
commit 38348a546665c9ce45b4dcc79eabc555f69ff97f
7 changes: 4 additions & 3 deletions include/crab/analysis/bwd_analyzer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ class necessary_preconditions_fixpoint_iterator
}

virtual void process_pre(const bb_label_t & /*node*/,
AbsDom /*postcond*/) override {}
const AbsDom &/*postcond*/) override {}

/**
* Store necessary preconditions
**/
virtual void process_post(const bb_label_t &node, AbsDom precond) override {
m_preconditions.insert(std::make_pair(node, precond));
virtual void process_post(const bb_label_t &node, const AbsDom &precond) override {
AbsDom copy_precond(precond);
m_preconditions.insert({node, std::move(copy_precond)});
}

public:
Expand Down
4 changes: 2 additions & 2 deletions include/crab/analysis/fwd_analyzer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ class fwd_analyzer : public ikos::interleaved_fwd_fixpoint_iterator<
return res;
}

void process_pre(const basic_block_label_t &node, abs_dom_t inv) override {}
void process_pre(const basic_block_label_t &node, const abs_dom_t &inv) override {}

void process_post(const basic_block_label_t &node, abs_dom_t inv) override {}
void process_post(const basic_block_label_t &node, const abs_dom_t &inv) override {}

void init_fwd_analyzer() {
assert(m_abs_tr);
Expand Down
4 changes: 2 additions & 2 deletions include/crab/fixpoint/fixpoint_iterators_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ template <typename CFG, typename AbstractValue> class fixpoint_iterator {
virtual AbstractValue analyze(const basic_block_label_t &,
AbstractValue &&) = 0;

virtual void process_pre(const basic_block_label_t &, AbstractValue) = 0;
virtual void process_pre(const basic_block_label_t &, const AbstractValue&) = 0;

virtual void process_post(const basic_block_label_t &, AbstractValue) = 0;
virtual void process_post(const basic_block_label_t &, const AbstractValue&) = 0;

virtual ~fixpoint_iterator() {}

Expand Down
20 changes: 9 additions & 11 deletions include/crab/fixpoint/interleaved_fixpoint_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ class interleaved_fwd_fixpoint_iterator
}
}

inline AbstractValue get(const invariant_table_t &table,
basic_block_label_t node) const {
inline const AbstractValue& get(const invariant_table_t &table,
basic_block_label_t node) const {
FIXPOINT_SCOPED_STATS("Fixpo.invLookup");
return table.at(node);
}
Expand Down Expand Up @@ -265,10 +265,10 @@ class interleaved_fwd_fixpoint_iterator
const wto_t &get_wto() const { return m_wto; }

/* Begin access methods for getting invariants */
AbstractValue get_pre(basic_block_label_t node) const {
const AbstractValue &get_pre(basic_block_label_t node) const {
return get(m_pre, node);
}
AbstractValue get_post(basic_block_label_t node) const {
const AbstractValue &get_post(basic_block_label_t node) const {
return get(m_post, node);
}
const invariant_table_t &get_pre_invariants() const { return m_pre; }
Expand Down Expand Up @@ -405,7 +405,7 @@ class wto_iterator : public wto_component_visitor<CFG> {

inline AbstractValue make_bottom() const { return m_absval_fac.make_bottom(); }

inline AbstractValue strengthen(basic_block_label_t n, AbstractValue inv) {
inline void strengthen(AbstractValue &inv, basic_block_label_t n) {
FIXPOINT_SCOPED_STATS("Fixpo.strengthen");

if (m_assumptions) {
Expand All @@ -414,12 +414,11 @@ class wto_iterator : public wto_component_visitor<CFG> {
CRAB_VERBOSE_IF(3, crab::outs() << "Before assumption at " << n << ":"
<< inv << "\n");

inv = inv & it->second;
inv &= it->second;
CRAB_VERBOSE_IF(3, crab::outs() << "After assumption at " << n << ":"
<< inv << "\n");
}
}
return inv;
}

inline void compute_post(basic_block_label_t node, AbstractValue inv) {
Expand Down Expand Up @@ -503,7 +502,7 @@ class wto_iterator : public wto_component_visitor<CFG> {
pre = m_iterator->get_pre(node);
if (m_assumptions && !m_assumptions->empty()) {
// no necessary but it might avoid copies
pre = strengthen(node, pre);
strengthen(pre, node);
m_iterator->set_pre(node, pre);
}
} else {
Expand All @@ -517,7 +516,7 @@ class wto_iterator : public wto_component_visitor<CFG> {
}
if (m_assumptions && !m_assumptions->empty()) {
// no necessary but it might avoid copies
pre = strengthen(node, pre);
strengthen(pre, node);
}
m_iterator->set_pre(node, pre);
}
Expand Down Expand Up @@ -590,8 +589,7 @@ class wto_iterator : public wto_component_visitor<CFG> {
}
}
if (m_assumptions && !m_assumptions->empty()) {
// no necessary but it might avoid copies
pre = strengthen(head, pre);
strengthen(pre, head);
}

for (unsigned int iteration = 1;; ++iteration) {
Expand Down