Skip to content

Commit ad3e568

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 a086fd3 commit ad3e568

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

src/goto-checker/all_properties_verifier.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ 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(
43+
incremental_goto_checker(properties).progress
44+
!= incremental_goto_checkert::resultt::progresst::DONE)
4445
{
4546
// loop until we are done
4647
}

src/goto-checker/incremental_goto_checker.cpp

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

src/goto-checker/incremental_goto_checker.h

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,36 @@ 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;
53+
54+
/// Changed properties since the last call to
55+
/// `incremental_goto_checkert::operator()`
56+
std::vector<irep_idt> updated_properties;
57+
58+
resultt();
59+
resultt(
60+
progresst progress, const std::vector<irep_idt> &updated_properties);
4861
};
4962

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

0 commit comments

Comments
 (0)