-
Notifications
You must be signed in to change notification settings - Fork 262
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
Adding large-step encoding for CHCs in CProver (no [required] changes to the solver) #8465
base: develop
Are you sure you want to change the base?
Conversation
yvizel
commented
Sep 22, 2024
- Each commit message has a non-empty body, explaining why the change was made.
- Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
- The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
- Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
- My commit message includes data points confirming performance improvements (if claimed).
- My PR is restricted to a single feature or bugfix.
- White-space or formatting changes outside the feature-related changed lines are in commits of their own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of comments that each apply in several more places. More generally, however, it would be great to have comments. At bare minimum there should be high-level design comments in some place that explain how the various pieces fit together. Also, we need tests that demonstrate the new feature.
"(verbose)" | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick: no need for extra blank line.
|
||
#include "chc_db.h" | ||
|
||
#include <iostream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a debugging left-over?
src/cprover/chc_db.cpp
Outdated
|
||
for (auto & sp : m_db.get_state_preds()) | ||
{ | ||
std::set<exprt> outgoing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only use std::set
when ordering is important or needs to be stable, else use std::unordered_set
.
src/cprover/chc_db.cpp
Outdated
continue; | ||
} | ||
exprt func = to_function_application_expr(*r.head()).function(); | ||
m_head_idx[func].insert(&r); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refrain from storing pointers into other data structures, this is prone to break (the code here really requires that m_clauses
will never change once build_indices
has been called. Either make copying cheap (like irept
does), or else store the index into m_clauses
(so that m_clauses
can still be added to).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically you're not supposed to add clauses after building the indices. If you do, you need to rebuild.
Does it still require a change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to do better than "good intentions." We need some way to ensure this cannot go wrong.
m_head_idx[func].insert(&r); | ||
|
||
std::vector<symbol_exprt> use; | ||
r.used_relations(*this,std::back_inserter(use)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest that used_relations
just return a std::vector<symbol_exprt>
(which is cheap with copy elision).
src/cprover/cutpoint_graph.h
Outdated
friend class cutpoint_graph; | ||
|
||
const cutpoint_graph &m_graph; | ||
unsigned m_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsigned
will hardly ever be the right type. Should it perhaps be std::size_t
?
src/cprover/cutpoint_graph.h
Outdated
const goto_programt::instructiont & m_inst; | ||
|
||
typedef std::vector<cutpoint_edge_ptr> EdgeVec; | ||
EdgeVec m_succ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use snake_case rather than CamelCase.