-
Notifications
You must be signed in to change notification settings - Fork 277
Stop propt inheriting from messaget [blocks: #3800] #3249
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,10 +21,11 @@ Author: Daniel Kroening, [email protected] | |
|
||
/*! \brief TO_BE_DOCUMENTED | ||
*/ | ||
class propt:public messaget | ||
class propt | ||
{ | ||
public: | ||
propt() { } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, don't you need to consume a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't there before so adding one instead of constructing a new one could potentially change the behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it makes things safer, so I'd happily take that change. |
||
|
||
virtual ~propt() { } | ||
|
||
// boolean operators | ||
|
@@ -113,12 +114,14 @@ class propt:public messaget | |
// Resource limits: | ||
virtual void set_time_limit_seconds(uint32_t) | ||
{ | ||
warning() << "CPU limit ignored (not implemented)" << eom; | ||
log.warning() << "CPU limit ignored (not implemented)" << messaget::eom; | ||
} | ||
|
||
protected: | ||
// to avoid a temporary for lcnf(...) | ||
bvt lcnf_bv; | ||
|
||
messaget log; | ||
}; | ||
|
||
#endif // CPROVER_SOLVERS_PROP_PROP_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,11 @@ dimacs_cnft::dimacs_cnft():break_lines(false) | |
{ | ||
} | ||
|
||
dimacs_cnft::dimacs_cnft(message_handlert &message_handler) : dimacs_cnft() | ||
{ | ||
log.set_message_handler(message_handler); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is going to be a bit painful, but let's please try to use the constructor all the way, i.e., it would be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds like a good idea but this would go a bit beyond scope of a refactoring PR, and my initial statement "No functional changes." wouldn't be strictly true anymore. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, if we have no bugs (surely true) then it wouldn't entail any functional changes, because each time we construct a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It we leave it initialized, doesn't it just means that some messages wouldn't get printed? This would be difficult to detect. It's also a bit difficult to manually check, as a lot of classes inherit from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think any introduced functional change is a strict improvement here. Any class deriving should be forced to call a constructor that takes a message handler. |
||
} | ||
|
||
void dimacs_cnft::set_assignment(literalt, bool) | ||
{ | ||
UNIMPLEMENTED; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ class dimacs_cnft:public cnf_clause_listt | |
{ | ||
public: | ||
dimacs_cnft(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this constructor. |
||
explicit dimacs_cnft(message_handlert &); | ||
virtual ~dimacs_cnft() { } | ||
|
||
virtual void write_dimacs_cnf(std::ostream &out); | ||
|
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.
This change (inside a
#if 0
block) looks suspicious: I believe this should be justerror()
.