Skip to content

Commit 93651cf

Browse files
committed
Temp changes
1 parent e891d9b commit 93651cf

File tree

9 files changed

+43
-22
lines changed

9 files changed

+43
-22
lines changed

src/reach/avr_config.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int Config::g_fineness = 0;
2727
int Config::g_lazy_assume = 0;
2828

2929
bool Config::g_uf_unordered = false;
30-
bool Config::g_uf_mult_only = false;
30+
bool Config::g_uf_heavy_only = false;
3131
bool Config::g_uf_no_bitwise = false;
3232
bool Config::g_uf_no_sext = false;
3333
bool Config::g_uf_no_shift = false;
@@ -249,8 +249,8 @@ void Config::set_abstraction(string& name) {
249249
{
250250
if (name.find(NAME_UF_UNORDERED) != string::npos)
251251
g_uf_unordered = !g_uf_unordered;
252-
if (name.find(NAME_UF_MULT_ONLY) != string::npos)
253-
g_uf_mult_only = !g_uf_mult_only;
252+
if (name.find(NAME_UF_HEAVY_ONLY) != string::npos)
253+
g_uf_heavy_only = !g_uf_heavy_only;
254254
if (name.find(NAME_UF_NO_BITWISE) != string::npos)
255255
g_uf_no_bitwise = !g_uf_no_bitwise;
256256
if (name.find(NAME_UF_NO_SEXT) != string::npos)
@@ -287,19 +287,19 @@ void Config::set_abstraction(string& name) {
287287
}
288288
}
289289

290-
if (g_uf_mult_only) {
290+
if (g_uf_heavy_only) {
291291
g_ab_interpret = true;
292292
g_ab_interpret_limit = 0;
293-
g_ab_interpret_excc = LEVEL_EXCC_ALL;
294-
g_uf_unordered = true;
293+
// g_ab_interpret_excc = LEVEL_EXCC_NONE;
294+
// g_uf_unordered = false;
295295
}
296296

297297
cerr << "\t(abstraction: " << (g_ab_interpret?"sa":"sa+uf")
298298
<< (g_ab_interpret_limit == 0?"":to_string(g_ab_interpret_limit))
299299
<< ((g_ab_interpret_excc != LEVEL_EXCC_DEFAULT)?"+ec"+to_string(g_ab_interpret_excc):"")
300300
<< (g_fineness != FINENESS_DEFAULT?"+l"+to_string(g_fineness):"")
301301
<< (g_uf_unordered?"+unordered":"")
302-
<< (g_uf_mult_only?"+mult":"")
302+
<< (g_uf_heavy_only?"+heavy":"")
303303
<< (g_uf_no_bitwise?"+nobitwise":"")
304304
<< (g_uf_no_sext?"+nosignex":"")
305305
<< (g_uf_no_shift?"+noshift":"")

src/reach/avr_config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
#define NAME_EXCC "ec"
177177

178178
#define NAME_UF_UNORDERED "+unordered"
179-
#define NAME_UF_MULT_ONLY "+mult"
179+
#define NAME_UF_HEAVY_ONLY "+heavy"
180180
#define NAME_UF_NO_BITWISE "+nobitwise"
181181
#define NAME_UF_NO_SEXT "+nosignex"
182182
#define NAME_UF_NO_SHIFT "+noshift"
@@ -264,7 +264,7 @@ class Config {
264264
static int g_fineness;
265265
static int g_lazy_assume;
266266
static bool g_uf_unordered;
267-
static bool g_uf_mult_only;
267+
static bool g_uf_heavy_only;
268268
static bool g_uf_no_bitwise;
269269
static bool g_uf_no_sext;
270270
static bool g_uf_no_shift;

src/reach/avr_word_netlist.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,6 +1882,26 @@ bool OpInst::is_unordered_uf() {
18821882
}
18831883
#endif
18841884

1885+
bool OpInst::is_heavy_uf() {
1886+
bool result = false;
1887+
switch (m_op) {
1888+
case Mult:
1889+
case Div:
1890+
case SDiv:
1891+
case Rem:
1892+
case SRem:
1893+
case SMod:
1894+
// case ArrayConst:
1895+
// case ArraySelect:
1896+
case ArrayStore:
1897+
result = (get_size() > 4);
1898+
break;
1899+
default:
1900+
;
1901+
}
1902+
return result;
1903+
}
1904+
18851905
Inst* OpInst::create(OpType op, Inst* exp1, Inst* exp2, Inst* exp3, int o_size, bool to_simplify, Inst* wire, SORT sort) {
18861906
if (op == OpInst::LogNot) {
18871907
OpInst* opt = OpInst::as(exp1);

src/reach/avr_word_netlist.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,6 +2560,7 @@ class OpInst: public Inst {
25602560
int get_simple_version();
25612561
bool is_unordered_uf();
25622562
#endif
2563+
bool is_heavy_uf();
25632564

25642565
protected:
25652566
OpType m_op;

src/reach/reach_bt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ void bt_API::inst2yices(Inst*e, bool bvAllConstraints) {
16911691

16921692
#ifdef INTERPRET_EX_CC
16931693
if (m_allow_ex_cc) {
1694-
if (Config::g_uf_mult_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
1694+
if (Config::g_uf_heavy_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
16951695
(m_mapper->fetch_op(e->t_simple) == TheoryMapper::EUF_OP)) {
16961696
Inst* simplified = e->t_simple;
16971697
if (OpInst::as(e) && e != simplified) {
@@ -2323,11 +2323,11 @@ void bt_API::inst2yices(Inst*e, bool bvAllConstraints) {
23232323
InstL::const_iterator ve_it = ch->begin(), ve_it2 = ch->begin();
23242324
ve_it2++;
23252325
NumInst* num = NumInst::as(*ve_it2);
2326-
cout << "Rotate: " << *e << endl;
2326+
// cout << "Rotate: " << *e << endl;
23272327
if (num != 0)
23282328
{
23292329
int rotate_amount = num->get_mpz()->get_si() % e->get_size();
2330-
cout << "rotate_amount: " << rotate_amount << endl;
2330+
// cout << "rotate_amount: " << rotate_amount << endl;
23312331
if (rotate_amount != 0) {
23322332
if (o == OpInst::RotateL)
23332333
{
@@ -2682,7 +2682,7 @@ void bt_API::inst2yices(Inst*e, bool bvAllConstraints) {
26822682

26832683
#ifdef INTERPRET_EX_CC
26842684
if (m_allow_ex_cc) {
2685-
if (Config::g_uf_mult_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
2685+
if (Config::g_uf_heavy_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
26862686
(m_mapper->fetch_op(e->t_simple) == TheoryMapper::EUF_OP)) {
26872687
Inst* simplified = e->t_simple;
26882688
if (e != simplified) {

src/reach/reach_cegar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void Reach::retrieve_ab_sol(Solver* solver, Inst* e, InstS& relSig, InstS& relCo
9494

9595
#ifdef INTERPRET_EX_CC
9696
if (solver->m_allow_ex_cc) {
97-
if (Config::g_uf_mult_only || (_abstract_mapper->fetch_op(e) == Solver::TheoryMapper::EUF_OP) ||
97+
if (Config::g_uf_heavy_only || (_abstract_mapper->fetch_op(e) == Solver::TheoryMapper::EUF_OP) ||
9898
(_abstract_mapper->fetch_op(e->t_simple) == Solver::TheoryMapper::EUF_OP)) {
9999
Inst* simplified = e->t_simple;
100100
if (e != simplified)
@@ -170,7 +170,7 @@ void Reach::retrieve_cex_val(Inst* e, Solver*solver, bool abstract, bool init_vi
170170
e->set_visit();
171171

172172
#ifdef INTERPRET_EX_CC
173-
if (Config::g_uf_mult_only || solver->m_allow_ex_cc && abstract && evalSimple)
173+
if (Config::g_uf_heavy_only || solver->m_allow_ex_cc && abstract && evalSimple)
174174
{
175175
if ((_abstract_mapper->fetch_op(e) == Solver::TheoryMapper::EUF_OP) ||
176176
(_abstract_mapper->fetch_op(e->t_simple) == Solver::TheoryMapper::EUF_OP)) {

src/reach/reach_core.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,10 @@ class UFBV_Mapper: public Solver::TheoryMapper {
683683
if (e) {
684684
e = e->get_port();
685685

686-
if (Config::g_uf_mult_only) {
686+
if (Config::g_uf_heavy_only) {
687687
if (e->get_type() == Op) {
688688
OpInst* op = OpInst::as(e);
689-
if (op->get_op() == OpInst::Mult)
689+
if (op->is_heavy_uf())
690690
return Solver::TheoryMapper::EUF_OP;
691691
}
692692
return Solver::TheoryMapper::BV_OP;
@@ -709,7 +709,7 @@ class UFBV_Mapper: public Solver::TheoryMapper {
709709
return Solver::TheoryMapper::EUF_OP;
710710
}
711711
virtual Solver::TheoryMapper::VarType fetch_var(Inst*e) {
712-
if (Config::g_uf_mult_only)
712+
if (Config::g_uf_heavy_only)
713713
return Solver::TheoryMapper::BV_VAR;
714714
else if (Config::g_ab_interpret_excc >= LEVEL_EXCC_ALL)
715715
return Solver::TheoryMapper::BV_VAR;

src/reach/reach_m5.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ void m5_API::inst2yices(Inst*e, bool bvAllConstraints) {
24162416

24172417
#ifdef INTERPRET_EX_CC
24182418
if (m_allow_ex_cc) {
2419-
if (Config::g_uf_mult_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
2419+
if (Config::g_uf_heavy_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
24202420
(m_mapper->fetch_op(e->t_simple) == TheoryMapper::EUF_OP)) {
24212421
Inst* simplified = e->t_simple;
24222422
if (OpInst::as(e) && e != simplified) {
@@ -3508,7 +3508,7 @@ void m5_API::inst2yices(Inst*e, bool bvAllConstraints) {
35083508

35093509
#ifdef INTERPRET_EX_CC
35103510
if (m_allow_ex_cc) {
3511-
if (Config::g_uf_mult_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
3511+
if (Config::g_uf_heavy_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
35123512
(m_mapper->fetch_op(e->t_simple) == TheoryMapper::EUF_OP)) {
35133513
Inst* simplified = e->t_simple;
35143514
if (e != simplified) {

src/reach/reach_y2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6191,7 +6191,7 @@ void y2_API::inst2yices(Inst*e, bool bvAllConstraints)
61916191
#ifdef INTERPRET_EX_CC
61926192
if (m_allow_ex_cc)
61936193
{
6194-
if (Config::g_uf_mult_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
6194+
if (Config::g_uf_heavy_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
61956195
(m_mapper->fetch_op(e->t_simple) == TheoryMapper::EUF_OP)) {
61966196
Inst* simplified = e->t_simple;
61976197
if (OpInst::as(e) && e != simplified)
@@ -7820,7 +7820,7 @@ void y2_API::inst2yices(Inst*e, bool bvAllConstraints)
78207820
#ifdef INTERPRET_EX_CC
78217821
if (m_allow_ex_cc)
78227822
{
7823-
if (Config::g_uf_mult_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
7823+
if (Config::g_uf_heavy_only || (m_mapper->fetch_op(e) == TheoryMapper::EUF_OP) ||
78247824
(m_mapper->fetch_op(e->t_simple) == TheoryMapper::EUF_OP)) {
78257825
Inst* simplified = e->t_simple;
78267826
if (e != simplified)

0 commit comments

Comments
 (0)