Skip to content

Commit e1a9f82

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 6df204e commit e1a9f82

3 files changed

Lines changed: 22 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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--smt2 --z3 --outfile formula.smt2
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
will not contain any assertions
7+
--
8+
^warning: ignoring

src/goto-checker/bmc_util.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ 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(symex.get_remaining_vccs() == 0 && !options.get_option("outfile").empty())
216+
{
217+
msg.warning() << "All properties were simplified to true before solving. "
218+
<< "The formula written to " << options.get_option("outfile")
219+
<< " will not contain any assertions." << messaget::eom;
220+
}
214221
}
215222

216223
void update_properties_status_from_symex_target_equation(

0 commit comments

Comments
 (0)