Skip to content

Commit 7250057

Browse files
authored
Merge pull request #2 from diffblue/fix/named_properties_ebmc_ic3
support named properties in EBMC/ic3
2 parents 46d6b87 + b07902d commit 7250057

File tree

3 files changed

+53
-10
lines changed

3 files changed

+53
-10
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// this example is a representation of the circuit in
2+
// "SAT-Based Verification without State Space Traversal"
3+
// by Per Bjesse & Koen Claessen (FMCAD 2000)
4+
module main(clock, s3, out);
5+
input clock;
6+
input s3;
7+
output out;
8+
9+
wire s5= s4 | s3;
10+
wire s6= ~s4 |~s3;
11+
wire s9= ~s8 |~s7;
12+
wire s10= s9 |~s3;
13+
wire s11=(~s6 | s10)&( s6 |~s10);
14+
15+
reg s4;
16+
reg s7;
17+
reg s8;
18+
19+
initial s4=0;
20+
initial s7=0;
21+
initial s8=0;
22+
23+
always @ (posedge clock) s4 <= ~s5;
24+
always @ (posedge clock) s7 <= ~s3;
25+
always @ (posedge clock) s8 <= s9;
26+
assign out=s11;
27+
// not inductive for any k
28+
p0: assert property (s11);
29+
p1: assert property ((s7 |~s4) & s11);
30+
// 3-inductive
31+
p2: assert property ((s8 |~s4) & s11);
32+
// 2-inductive
33+
p3: assert property ((~s8 | ~s7 | s4) & s11);
34+
p4: assert property ((s8 |~s4) & (s7 |~s4) & s11);
35+
p5: assert property ((s7 |~s4) & (~s8 | ~s7 | s4) & s11);
36+
p6: assert property ((s8 |~s4) & (~s8 | ~s7 | s4) & s11);
37+
// inductive
38+
p7: assert property ((s7 |~s4) & (s8 |~s4) & (~s8 | ~s7 | s4) & s11);
39+
endmodule
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
non_inductive.sv
3+
--ic3 --prop 0
4+
^property HOLDS$
5+
^verification is ok
6+
--

src/ic3/r6ead_input.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,18 @@ bool ic3_enginet::find_prop(propertyt &Prop)
9090
std::cout << properties.size() << " properties\n";
9191
exit(100);
9292
}
93-
94-
for(const auto &p : properties) {
95-
std::string Sn;
96-
irep_idt Nm = p.name;
97-
short_name(Sn,Nm);
98-
int ind = stoi(Sn);
99-
if (ind-1 == Ci.prop_ind) {
93+
94+
size_t idx=0;
95+
for(const auto &p : properties)
96+
{
97+
if(idx == Ci.prop_ind)
98+
{
10099
Prop = p;
101100
return(true);
102101
}
102+
idx++;
103103
}
104-
105-
return(false);
106-
104+
return false;
107105
} /* end of function find_prop */
108106

109107
/*==================================

0 commit comments

Comments
 (0)