Skip to content

Commit

Permalink
Switch lack of termination to warning
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett committed Oct 22, 2024
1 parent 48d0043 commit 56956d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/crab_verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ static checks_db generate_report(cfg_t& cfg, const crab::invariant_table_t& pre_
if (last_inv.is_bottom()) {
m_db.add_warning(label_t::exit, "Exit is unreachable.");
}

const crab::number_t max_loop_count{100000};
if (m_db.max_loop_count > max_loop_count) {
m_db.add_warning(label_t::exit, "Could not prove termination.");
}
}

return m_db;
Expand Down Expand Up @@ -133,10 +138,6 @@ static void print_report(std::ostream& os, const checks_db& db, const Instructio
}
}
os << "\n";
const crab::number_t max_loop_count{100000};
if (db.max_loop_count > max_loop_count) {
os << "Could not prove termination.\n";
}
}

static checks_db get_analysis_report(std::ostream& s, cfg_t& cfg, const crab::invariant_table_t& pre_invariants,
Expand Down
2 changes: 1 addition & 1 deletion test-data/loop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ post:
- "pc[1]=[1, +oo]"

messages:
- "Could not prove termination."
- "exit: Could not prove termination."

---
test-case: realistic forward loop
Expand Down

0 comments on commit 56956d1

Please sign in to comment.