-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8406 from tautschnig/dimacs_cnft-no-dynamic_cast
Remove dynamic_cast from bv_dimacst
- Loading branch information
Showing
4 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,17 @@ Author: Daniel Kroening, [email protected] | |
#include <fstream> // IWYU pragma: keep | ||
#include <iostream> | ||
|
||
bv_dimacst::bv_dimacst( | ||
const namespacet &_ns, | ||
dimacs_cnft &_prop, | ||
message_handlert &message_handler, | ||
const std::string &_filename) | ||
: bv_pointerst(_ns, _prop, message_handler), | ||
filename(_filename), | ||
dimacs_cnf_prop(_prop) | ||
{ | ||
} | ||
|
||
bool bv_dimacst::write_dimacs() | ||
{ | ||
if(filename.empty() || filename == "-") | ||
|
@@ -34,7 +45,7 @@ bool bv_dimacst::write_dimacs() | |
|
||
bool bv_dimacst::write_dimacs(std::ostream &out) | ||
{ | ||
dynamic_cast<dimacs_cnft &>(prop).write_dimacs_cnf(out); | ||
dimacs_cnf_prop.write_dimacs_cnf(out); | ||
|
||
// we dump the mapping variable<->literals | ||
for(const auto &s : get_symbols()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,16 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "bv_pointers.h" | ||
|
||
class dimacs_cnft; | ||
|
||
class bv_dimacst : public bv_pointerst | ||
{ | ||
public: | ||
bv_dimacst( | ||
const namespacet &_ns, | ||
propt &_prop, | ||
dimacs_cnft &_prop, | ||
message_handlert &message_handler, | ||
const std::string &_filename) | ||
: bv_pointerst(_ns, _prop, message_handler), filename(_filename) | ||
{ | ||
} | ||
const std::string &_filename); | ||
|
||
virtual ~bv_dimacst() | ||
{ | ||
|
@@ -33,6 +32,8 @@ class bv_dimacst : public bv_pointerst | |
|
||
protected: | ||
const std::string filename; | ||
const dimacs_cnft &dimacs_cnf_prop; | ||
|
||
bool write_dimacs(); | ||
bool write_dimacs(std::ostream &); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters