Skip to content

Commit 2d5738f

Browse files
committed
ebmc: simplify IC3/ebmc interface
This changes the interface between the IC3 implementation and ebmc by switching from ebmc_baset to directly calling the relevant APIs.
1 parent b68cedf commit 2d5738f

File tree

2 files changed

+47
-21
lines changed

2 files changed

+47
-21
lines changed

src/ic3/ebmc_ic3_interface.hh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@ typedef std::vector<std::string> GateNames;
22
typedef std::map<int,int> LatchVal;
33
typedef std::map<int,int> NondetVars;
44
//
5-
class ic3_enginet:public ebmc_baset
5+
class ic3_enginet
66
{
77
public:
88
ic3_enginet(
9-
const cmdlinet &cmdline,
10-
ui_message_handlert &ui_message_handler):
11-
ebmc_baset(cmdline, ui_message_handler)
9+
const cmdlinet &_cmdline,
10+
ui_message_handlert &_ui_message_handler)
11+
: cmdline(_cmdline), message(_ui_message_handler)
1212
{
1313
}
1414

15+
protected:
16+
const cmdlinet &cmdline;
17+
messaget message;
18+
19+
using propertyt = ebmc_propertiest::propertyt;
20+
ebmc_propertiest properties;
21+
netlistt netlist;
22+
23+
public:
1524
CompInfo Ci;
1625
GateNames Gn;
1726
literalt prop_l;
@@ -61,11 +70,6 @@ public:
6170
void print_lit(std::ostream& out,literalt a);
6271
std::string print_string(const irep_idt &id);
6372
void add_verilog_conv_constrs();
64-
65-
protected:
66-
netlistt netlist;
67-
68-
6973
};
7074

7175
//

src/ic3/m1ain.cc

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,32 @@ Module: Main
55
Author: Eugene Goldberg, [email protected]
66
77
******************************************************/
8-
#include <queue>
9-
#include <set>
10-
#include <map>
8+
9+
// clang-format off
10+
// The order of these matter.
11+
#include <util/cmdline.h>
12+
#include <util/ui_message.h>
13+
14+
#include <ebmc/ebmc_properties.h>
15+
16+
#include <trans-netlist/netlist.h>
17+
#include <trans-netlist/trans_to_netlist.h>
18+
1119
#include <algorithm>
1220
#include <iostream>
13-
14-
#include <ebmc/ebmc_base.h>
21+
#include <map>
22+
#include <queue>
23+
#include <set>
1524

1625
#include "minisat/core/Solver.h"
1726
#include "minisat/simp/SimpSolver.h"
27+
1828
#include "dnf_io.hh"
1929
#include "ccircuit.hh"
2030
#include "m0ic3.hh"
2131

22-
#include <util/cmdline.h>
2332
#include "ebmc_ic3_interface.hh"
33+
// clang-format off
2434

2535
hsh_tbl htable_lits;
2636
long long gcount = 0;
@@ -53,13 +63,21 @@ int ic3_enginet::operator()()
5363
read_parameters();
5464

5565
try {
56-
transition_system =
66+
auto transition_system =
5767
get_transition_system(cmdline, message.get_message_handler());
5868

59-
if(make_netlist(netlist)) {
60-
message.error() << "Failed to build netlist" << messaget::eom;
61-
return 2;
62-
}
69+
// make net-list
70+
message.status() << "Generating Netlist" << messaget::eom;
71+
72+
convert_trans_to_netlist(
73+
transition_system.symbol_table,
74+
transition_system.main_symbol->name,
75+
netlist,
76+
message.get_message_handler());
77+
78+
message.statistics() << "Latches: " << netlist.var_map.latches.size()
79+
<< ", nodes: " << netlist.number_of_nodes()
80+
<< messaget::eom;
6381

6482
properties = ebmc_propertiest::from_command_line(
6583
cmdline, transition_system, message.get_message_handler());
@@ -70,7 +88,11 @@ int ic3_enginet::operator()()
7088
return 1;
7189
}
7290
}
73-
91+
catch(const std::string &error_str)
92+
{
93+
message.error() << error_str << messaget::eom;
94+
return 1;
95+
}
7496
catch(const char *error_msg) {
7597
message.error() << error_msg << messaget::eom;
7698
return 1;

0 commit comments

Comments
 (0)