-
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.
Merge pull request #133 from diffblue/ebmc-cegar
ebmc CEGAR
- Loading branch information
Showing
11 changed files
with
126 additions
and
157 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,6 @@ | ||
CORE | ||
basic1.sv | ||
--cegar | ||
^VERIFICATION SUCCESSFUL -- PROPERTY HOLDS$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ |
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,12 @@ | ||
module top(input clk); | ||
|
||
reg important; | ||
reg not_important; | ||
|
||
initial important = 1; | ||
always @(posedge clk) | ||
important = important; | ||
|
||
assert property (important == 1); | ||
|
||
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,6 @@ | ||
KNOWNBUG | ||
basic2.sv | ||
--cegar | ||
^VERIFICATION FAILED -- PROPERTY REFUTED$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ |
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,13 @@ | ||
module top(input clk); | ||
|
||
reg important; | ||
reg not_important; | ||
|
||
initial important = 1; | ||
always @(posedge clk) | ||
important = 0; | ||
|
||
// should fail after one transition | ||
assert property (important == 1); | ||
|
||
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
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 |
---|---|---|
|
@@ -6,59 +6,69 @@ Author: Daniel Kroening, [email protected] | |
\*******************************************************************/ | ||
|
||
#include <util/std_expr.h> | ||
#ifndef EBMC_CEGAR_BMC_CEGAR_H | ||
#define EBMC_CEGAR_BMC_CEGAR_H | ||
|
||
#include <util/message.h> | ||
#include <util/namespace.h> | ||
#include <util/std_expr.h> | ||
|
||
#include <ebmc/ebmc_properties.h> | ||
#include <ebmc/transition_system.h> | ||
#include <trans-netlist/bmc_map.h> | ||
#include <trans-netlist/netlist.h> | ||
|
||
class cnft; | ||
|
||
class bmc_cegart:public messaget | ||
{ | ||
public: | ||
bmc_cegart( | ||
symbol_table_baset &_symbol_table, | ||
const irep_idt &_main_module, | ||
message_handlert &_message_handler, | ||
const std::list<exprt> &_properties) | ||
const netlistt &_netlist, | ||
ebmc_propertiest &_properties, | ||
const namespacet &_ns, | ||
message_handlert &_message_handler) | ||
: messaget(_message_handler), | ||
symbol_table(_symbol_table), | ||
ns(_symbol_table), | ||
main_module(_main_module), | ||
properties(_properties) | ||
properties(_properties), | ||
concrete_netlist(_netlist), | ||
ns(_ns) | ||
{ | ||
} | ||
|
||
void bmc_cegar(); | ||
|
||
protected: | ||
symbol_table_baset &symbol_table; | ||
const namespacet ns; | ||
const irep_idt &main_module; | ||
const std::list<exprt> &properties; | ||
|
||
ebmc_propertiest &properties; | ||
bmc_mapt bmc_map; | ||
netlistt concrete_netlist, abstract_netlist; | ||
const namespacet &ns; | ||
|
||
bool initial_abstraction; | ||
|
||
typedef std::set<literalt> cut_pointst; | ||
cut_pointst cut_points; | ||
|
||
void make_netlist(); | ||
|
||
|
||
void cegar_loop(); | ||
|
||
void abstract(); | ||
void refine(); | ||
bool verify(unsigned bound); | ||
bool simulate(unsigned bound); | ||
unsigned compute_ct(); | ||
|
||
void unwind( | ||
unsigned bound, | ||
const netlistt &netlist, | ||
propt &prop); | ||
|
||
std::list<bvt> prop_bv; | ||
bool verify(std::size_t bound); | ||
bool simulate(std::size_t bound); | ||
std::size_t compute_ct(); | ||
|
||
void unwind(std::size_t bound, const netlistt &netlist, cnft &solver); | ||
|
||
std::map<irep_idt, bvt> prop_bv_map; | ||
}; | ||
|
||
class ebmc_propertiest; | ||
class message_handlert; | ||
class netlistt; | ||
|
||
int do_bmc_cegar( | ||
const netlistt &, | ||
ebmc_propertiest &, | ||
const namespacet &, | ||
message_handlert &); | ||
|
||
#endif // EBMC_CEGAR_BMC_CEGAR_H |
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
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.