-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Engine heuristic: fix for assumptions unsupported by k-induction
The k-induction engine now correctly reports unsupported assumptions, and is then skipped by the engine selection heuristic. Fixes #921.
- Loading branch information
Showing
16 changed files
with
208 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CORE | ||
basic1.sv | ||
|
||
^\[main\.a0\] always not s_eventually !main\.x: ASSUMED$ | ||
^\[main\.p0\] always main\.x: PROVED up to bound 5$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module main(input clk, input x); | ||
|
||
// not supported by k-induction | ||
a0: assume property (not s_eventually !x); | ||
|
||
p0: assert property (x); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CORE | ||
basic2.sv | ||
|
||
^\[main\.a0\] always not s_eventually !main\.y: UNSUPPORTED: unsupported by k-induction$ | ||
^\[main\.a1\] always !main\.x: ASSUMED$ | ||
^\[main\.p0\] always !main\.z: PROVED$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module main(input clk, input x, input y); | ||
|
||
reg z = 0; | ||
always_ff @(posedge clk) z <= z || x; | ||
|
||
// unsupported assumption | ||
a0: assume property (not s_eventually !y); | ||
|
||
// supported assumption | ||
a1: assume property (!x); | ||
|
||
// inductive property | ||
p0: assert property (!z); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
KNOWNBUG | ||
CORE | ||
k-induction6.sv | ||
|
||
--k-induction | ||
^\[main\.a0\] always not s_eventually !main\.x: UNSUPPORTED: unsupported by k-induction$ | ||
^\[main\.p0\] always main\.x: INCONCLUSIVE$ | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring | ||
-- | ||
The property should hold, but is reported as refuted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CORE | ||
k-induction7.sv | ||
--k-induction | ||
^\[main\.a0\] always not s_eventually !main\.y: UNSUPPORTED: unsupported by k-induction$ | ||
^\[main\.a1\] always !main\.x: ASSUMED$ | ||
^\[main\.p0\] always !main\.z: PROVED$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module main(input clk, input x, input y); | ||
|
||
reg z = 0; | ||
always_ff @(posedge clk) z <= z || x; | ||
|
||
// unsupported assumption | ||
a0: assume property (not s_eventually !y); | ||
|
||
// supported assumption | ||
a1: assume property (!x); | ||
|
||
// inductive property | ||
p0: assert property (!z); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
std::string ebmc_propertiest::propertyt::status_as_string() const | ||
{ | ||
auto suffix = failure_reason.has_value() ? ": " + failure_reason.value() : ""; | ||
|
||
switch(status) | ||
{ | ||
case statust::ASSUMED: | ||
|
@@ -31,14 +33,15 @@ std::string ebmc_propertiest::propertyt::status_as_string() const | |
case statust::REFUTED_WITH_BOUND: | ||
return "REFUTED up to bound " + std::to_string(bound); | ||
case statust::UNKNOWN: | ||
return "UNKNOWN"; | ||
return "UNKNOWN" + suffix; | ||
case statust::UNSUPPORTED: | ||
return "UNSUPPORTED" + suffix; | ||
case statust::INCONCLUSIVE: | ||
return "INCONCLUSIVE"; | ||
return "INCONCLUSIVE" + suffix; | ||
case statust::FAILURE: | ||
return failure_reason.has_value() ? "FAILURE: " + failure_reason.value() | ||
: "FAILURE"; | ||
return "FAILURE" + suffix; | ||
case statust::DROPPED: | ||
return "DROPPED"; | ||
return "DROPPED" + suffix; | ||
case statust::DISABLED: | ||
default: | ||
UNREACHABLE; | ||
|
@@ -78,9 +81,9 @@ ebmc_propertiest ebmc_propertiest::from_transition_system( | |
id2string(symbol.location.get_comment()); | ||
|
||
// Don't try to prove assumption properties. | ||
if(symbol.value.id() == ID_sva_assume) | ||
if(properties.properties.back().is_assumption()) | ||
{ | ||
properties.properties.back().status = propertyt::statust::ASSUMED; | ||
properties.properties.back().assumed(); | ||
properties.properties.back().normalized_expr = | ||
normalize_property(to_sva_assume_expr(symbol.value).op()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.