Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett committed Nov 1, 2024
1 parent 6262a17 commit 054f205
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/asm_syntax.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ struct Assert {
struct IncrementLoopCounter {
label_t name;
bool operator==(const IncrementLoopCounter&) const = default;
// Maximum number of loop iterations allowed during verification.
// This prevents infinite loops while allowing reasonable bounded loops.
// When exceeded, the verifier will report that it cannot prove termination.
static constexpr int limit = 100000;
};

Expand Down
5 changes: 2 additions & 3 deletions src/crab_verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ static checks_db generate_report(cfg_t& cfg, const crab::invariant_table_t& pre_
}

if (thread_local_options.check_termination) {
const auto last_inv = post_invariants.at(cfg.exit_label());

// Find the max loop count from any post-invariant.
// Calculate the maximum loop count across all post-invariants to detect potential
// infinite loops or excessive iterations in any part of the program.
for (auto [label, inv] : post_invariants) {
if (inv.is_bottom()) {
continue;
Expand Down

0 comments on commit 054f205

Please sign in to comment.