Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k_induction(...) now returns property_checker_resultt #940

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/ebmc/k_induction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,20 @@ Function: k_induction

\*******************************************************************/

void k_induction(
property_checker_resultt k_induction(
std::size_t k,
const transition_systemt &transition_system,
ebmc_propertiest &properties,
const ebmc_propertiest &properties,
const ebmc_solver_factoryt &solver_factory,
message_handlert &message_handler)
{
// copy
auto properties_copy = properties;

k_inductiont(
k, transition_system, properties, solver_factory, message_handler)();
k, transition_system, properties_copy, solver_factory, message_handler)();

return property_checker_resultt{properties_copy};
}

/*******************************************************************\
Expand Down Expand Up @@ -150,10 +155,8 @@ property_checker_resultt k_induction(

auto solver_factory = ebmc_solver_factory(cmdline);

k_induction(
return k_induction(
k, transition_system, properties, solver_factory, message_handler);

return property_checker_resultt{properties};
}

/*******************************************************************\
Expand Down
8 changes: 4 additions & 4 deletions src/ebmc/k_induction.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ Author: Daniel Kroening, [email protected]
class transition_systemt;
class ebmc_propertiest;

property_checker_resultt k_induction(
[[nodiscard]] property_checker_resultt k_induction(
const cmdlinet &,
transition_systemt &,
ebmc_propertiest &,
message_handlert &);

// Basic k-induction. The result is stored in the ebmc_propertiest argument.
void k_induction(
// Basic k-induction, for given k and given solver.
[[nodiscard]] property_checker_resultt k_induction(
std::size_t k,
const transition_systemt &,
ebmc_propertiest &,
const ebmc_propertiest &,
const ebmc_solver_factoryt &,
message_handlert &);

Expand Down
6 changes: 4 additions & 2 deletions src/ebmc/property_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,13 @@ property_checker_resultt engine_heuristic(
// First try 1-induction, word-level
message.status() << "Attempting 1-induction" << messaget::eom;

k_induction(
auto k_induction_result = k_induction(
1, transition_system, properties, solver_factory, message_handler);

properties.properties = k_induction_result.properties;

if(!properties.has_unfinished_property())
return property_checker_resultt{properties}; // done
return k_induction_result; // done

properties.reset_failure();
properties.reset_inconclusive();
Expand Down
Loading