Skip to content

Commit 9f6a733

Browse files
add hook for induction
1 parent fd911a5 commit 9f6a733

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

src/smt/smt_context.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,18 +270,14 @@ namespace smt {
270270
}
271271
d.m_phase_available = true;
272272
d.m_phase = !l.sign();
273-
CTRACE("assign_core", l.var() == 13, tout << (decision?"decision: ":"propagating: ") << l << " ";
274-
/*display_literal(tout, l);*/
275-
tout << "relevant: " << is_relevant_core(l) << " level: " << m_scope_lvl << " is atom " << d.is_atom() << "\n";
276-
/*display(tout, j);*/
277-
);
273+
TRACE("assign_core", tout << (decision?"decision: ":"propagating: ") << l << " ";
274+
display_literal_smt2(tout, l) << "\n";
275+
tout << "relevant: " << is_relevant_core(l) << " level: " << m_scope_lvl << " is atom " << d.is_atom() << "\n";
276+
/*display(tout, j);*/
277+
);
278278
TRACE("phase_selection", tout << "saving phase, is_pos: " << d.m_phase << " l: " << l << "\n";);
279279

280-
CTRACE("relevancy", l.var() == 13,
281-
tout << "is_atom: " << d.is_atom() << " is relevant: "
282-
<< is_relevant_core(l) << " relevancy-lvl: " << relevancy_lvl() << "\n";);
283280
if (d.is_atom() && (relevancy_lvl() == 0 || (relevancy_lvl() == 1 && !d.is_quantifier()) || is_relevant_core(l))) {
284-
CTRACE("assign_core", l.var() == 13, tout << "propagation queue\n";);
285281
m_atom_propagation_queue.push_back(l);
286282
}
287283

@@ -1655,6 +1651,16 @@ namespace smt {
16551651
!m_th_diseq_propagation_queue.empty();
16561652
}
16571653

1654+
/**
1655+
\brief retrieve facilities for creating induction lemmas.
1656+
*/
1657+
induction& context::get_induction() {
1658+
if (!m_induction) {
1659+
m_induction = alloc(induction, *this, get_manager());
1660+
}
1661+
return *m_induction;
1662+
}
1663+
16581664
/**
16591665
\brief unit propagation.
16601666
Cancelation is not safe during propagation at base level because

src/smt/smt_context.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Revision History:
3434
#include "smt/smt_statistics.h"
3535
#include "smt/smt_conflict_resolution.h"
3636
#include "smt/smt_relevancy.h"
37+
#include "smt/smt_induction.h"
3738
#include "smt/smt_case_split_queue.h"
3839
#include "smt/smt_almost_cg_table.h"
3940
#include "smt/smt_failure.h"
@@ -185,6 +186,7 @@ namespace smt {
185186
unsigned m_simp_qhead;
186187
int m_simp_counter; //!< can become negative
187188
scoped_ptr<case_split_queue> m_case_split_queue;
189+
scoped_ptr<induction> m_induction;
188190
double m_bvar_inc;
189191
bool m_phase_cache_on;
190192
unsigned m_phase_counter; //!< auxiliary variable used to decide when to turn on/off phase caching
@@ -848,7 +850,7 @@ namespace smt {
848850
void remove_lit_occs(clause const& cls, unsigned num_bool_vars);
849851

850852
void add_lit_occs(clause const& cls);
851-
public:
853+
public:
852854

853855
void ensure_internalized(expr* e);
854856

@@ -1267,6 +1269,8 @@ namespace smt {
12671269
public:
12681270
bool can_propagate() const;
12691271

1272+
induction& get_induction();
1273+
12701274
// Retrieve arithmetic values.
12711275
bool get_arith_lo(expr* e, rational& lo, bool& strict);
12721276
bool get_arith_up(expr* e, rational& up, bool& strict);

src/smt/smt_induction.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ void create_induction_lemmas::create_lemmas(expr* t, expr* sk, abstraction& a, l
240240
sort* s = m.get_sort(sk);
241241
if (!m_dt.is_datatype(s))
242242
return;
243-
family_id fid = s->get_family_id();
244243
expr_ref alpha = a.m_term;
245244
auto const& eqs = a.m_eqs;
246245
literal_vector common_literals;

0 commit comments

Comments
 (0)