Skip to content

Commit 66aae3b

Browse files
authored
Merge pull request #940 from diffblue/k-induction-property-checker-result
`k_induction(...)` now returns `property_checker_resultt`
2 parents 26f366e + 04f1ae8 commit 66aae3b

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

src/ebmc/k_induction.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,20 @@ Function: k_induction
9494
9595
\*******************************************************************/
9696

97-
void k_induction(
97+
property_checker_resultt k_induction(
9898
std::size_t k,
9999
const transition_systemt &transition_system,
100-
ebmc_propertiest &properties,
100+
const ebmc_propertiest &properties,
101101
const ebmc_solver_factoryt &solver_factory,
102102
message_handlert &message_handler)
103103
{
104+
// copy
105+
auto properties_copy = properties;
106+
104107
k_inductiont(
105-
k, transition_system, properties, solver_factory, message_handler)();
108+
k, transition_system, properties_copy, solver_factory, message_handler)();
109+
110+
return property_checker_resultt{properties_copy};
106111
}
107112

108113
/*******************************************************************\
@@ -150,10 +155,8 @@ property_checker_resultt k_induction(
150155

151156
auto solver_factory = ebmc_solver_factory(cmdline);
152157

153-
k_induction(
158+
return k_induction(
154159
k, transition_system, properties, solver_factory, message_handler);
155-
156-
return property_checker_resultt{properties};
157160
}
158161

159162
/*******************************************************************\

src/ebmc/k_induction.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ Author: Daniel Kroening, [email protected]
1818
class transition_systemt;
1919
class ebmc_propertiest;
2020

21-
property_checker_resultt k_induction(
21+
[[nodiscard]] property_checker_resultt k_induction(
2222
const cmdlinet &,
2323
transition_systemt &,
2424
ebmc_propertiest &,
2525
message_handlert &);
2626

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

src/ebmc/property_checker.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,13 @@ property_checker_resultt engine_heuristic(
383383
// First try 1-induction, word-level
384384
message.status() << "Attempting 1-induction" << messaget::eom;
385385

386-
k_induction(
386+
auto k_induction_result = k_induction(
387387
1, transition_system, properties, solver_factory, message_handler);
388388

389+
properties.properties = k_induction_result.properties;
390+
389391
if(!properties.has_unfinished_property())
390-
return property_checker_resultt{properties}; // done
392+
return k_induction_result; // done
391393

392394
properties.reset_failure();
393395
properties.reset_inconclusive();

0 commit comments

Comments
 (0)