Skip to content

Commit 97d19e2

Browse files
Warn when --outfile produces an empty formula
When all properties are simplified to true before solving, the formula file written via --outfile contains only the solver header and no assertions. This can be confusing to users. Add a warning message explaining why the file is nearly empty. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
1 parent cadd0a6 commit 97d19e2

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <assert.h>
2+
int main()
3+
{
4+
int x = 5;
5+
assert(x == 5);
6+
return 0;
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.c
3+
--smt2 --outfile formula.smt2
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
will not contain any assertions
7+
--

src/goto-checker/bmc_util.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ void slice(
211211
msg.statistics() << "Generated " << symex.get_total_vccs() << " VCC(s), "
212212
<< symex.get_remaining_vccs()
213213
<< " remaining after simplification" << messaget::eom;
214+
215+
if(
216+
symex.get_total_vccs() > 0 && symex.get_remaining_vccs() == 0 &&
217+
!options.get_option("outfile").empty())
218+
{
219+
const std::string outfile = options.get_option("outfile");
220+
msg.warning() << "All properties were simplified to true before solving. "
221+
<< "The formula written to " << outfile
222+
<< " will not contain any assertions." << messaget::eom;
223+
}
214224
}
215225

216226
void update_properties_status_from_symex_target_equation(

0 commit comments

Comments
 (0)