-
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.
This relieves the user of the dec_solve(assumption) interface from the need to obtain a handle for the assumption. The typing of the assumptions member is strengthened; instead of maintaining the invariant that the expression stored is a literal_exprt, the vector now stores literals directly.
- Loading branch information
Showing
3 changed files
with
20 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ Author: Daniel Kroening, [email protected] | |
#include <util/run.h> | ||
#include <util/tempfile.h> | ||
|
||
#include <solvers/prop/literal_expr.h> | ||
|
||
#include "smt2irep.h" | ||
|
||
std::string smt2_dect::decision_procedure_text() const | ||
|
@@ -44,10 +46,20 @@ decision_proceduret::resultt smt2_dect::dec_solve(const exprt &assumption) | |
const auto write_problem_to_file = [&](std::ofstream problem_out) { | ||
cached_output << stringstream.str(); | ||
stringstream.str(std::string{}); | ||
write_footer(); | ||
|
||
if(assumption.is_nil()) | ||
write_footer(); | ||
else | ||
{ | ||
assumptions.push_back(convert(assumption)); | ||
write_footer(); | ||
assumptions.pop_back(); | ||
} | ||
|
||
problem_out << cached_output.str() << stringstream.str(); | ||
stringstream.str(std::string{}); | ||
}; | ||
|
||
write_problem_to_file(std::ofstream( | ||
temp_file_problem(), std::ios_base::out | std::ios_base::trunc)); | ||
|
||
|