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

Adding large-step encoding for CHCs in CProver (no [required] changes to the solver) #8465

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

yvizel
Copy link

@yvizel 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.

Copy link
Collaborator

@tautschnig tautschnig left a 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)"


Copy link
Collaborator

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>
Copy link
Collaborator

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?


for (auto & sp : m_db.get_state_preds())
{
std::set<exprt> outgoing;
Copy link
Collaborator

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.

continue;
}
exprt func = to_function_application_expr(*r.head()).function();
m_head_idx[func].insert(&r);
Copy link
Collaborator

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).

m_head_idx[func].insert(&r);

std::vector<symbol_exprt> use;
r.used_relations(*this,std::back_inserter(use));
Copy link
Collaborator

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).


class cutpoint
{
friend class cutpoint_graph;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need friendhere?

friend class cutpoint_graph;

const cutpoint_graph &m_graph;
unsigned m_id;
Copy link
Collaborator

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?

const goto_programt::instructiont & m_inst;

typedef std::vector<cutpoint_edge_ptr> EdgeVec;
EdgeVec m_succ;
Copy link
Collaborator

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.

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.

2 participants