Skip to content

Commit be514e3

Browse files
Return updated properties in incremental goto checker result
The goto verifier might want to know which properties have been updated in the last call to the incremental goto checker, e.g. to output status information or report results continuously.
1 parent 7f59f24 commit be514e3

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

src/goto-checker/all_properties_verifier.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class all_properties_verifiert : public goto_verifiert
3939
if(!has_properties_to_check(properties))
4040
return resultt::PASS;
4141

42-
while(incremental_goto_checker(properties) !=
43-
incremental_goto_checkert::resultt::DONE)
42+
while(incremental_goto_checker(properties).progress !=
43+
incremental_goto_checkert::resultt::progresst::DONE)
4444
{
4545
// loop until we are done
4646
}

src/goto-checker/incremental_goto_checker.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ incremental_goto_checkert::incremental_goto_checkert(
1919
log(ui_message_handler)
2020
{
2121
}
22+
23+
incremental_goto_checkert::resultt::resultt(
24+
progresst progress,
25+
const std::vector<irep_idt> &updated_properties)
26+
: progress(progress), updated_properties(updated_properties)
27+
{
28+
}

src/goto-checker/incremental_goto_checker.h

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,37 @@ class incremental_goto_checkert
3737
incremental_goto_checkert(const incremental_goto_checkert &) = delete;
3838
virtual ~incremental_goto_checkert() = default;
3939

40-
enum class resultt
40+
struct resultt
4141
{
42-
/// The goto checker may be able to find another FAILed property
43-
/// if operator() is called again.
44-
FOUND_FAIL,
45-
/// The goto checker has returned all results for the given set
46-
/// of properties.
47-
DONE
42+
enum class progresst
43+
{
44+
/// The goto checker may be able to find another FAILed property
45+
/// if operator() is called again.
46+
FOUND_FAIL,
47+
/// The goto checker has returned all results for the given set
48+
/// of properties.
49+
DONE
50+
};
51+
52+
progresst progress = progresst::DONE;
53+
54+
/// Changed properties since the last call to
55+
/// `incremental_goto_checkert::operator()`
56+
std::vector<irep_idt> updated_properties;
57+
58+
resultt() = default;
59+
resultt(
60+
progresst progress,
61+
const std::vector<irep_idt> &updated_properties);
4862
};
4963

5064
/// Check whether the given properties with status NOT_CHECKED, UNKNOWN or
5165
/// properties newly discovered by `goto_checkert` hold.
5266
/// \param [out] properties: Properties updated to whether their status
5367
/// have been determined. Newly discovered properties are added.
5468
/// \return whether the goto checker found a violated property (FOUND_FAIL) or
55-
/// whether it is DONE with the given properties.
69+
/// whether it is DONE with the given properties, together with
70+
/// the properties whose status changed since the last call to operator().
5671
/// After returning DONE, another call to operator() with the same
5772
/// properties will return DONE and leave the properties' status unchanged.
5873
/// If there is a property with status FAIL then its counterexample

0 commit comments

Comments
 (0)