mirror of
https://github.com/Z3Prover/z3
synced 2025-08-14 06:45:25 +00:00
FPA theory additions
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
8b8cee7f64
commit
4a915f6528
2 changed files with 139 additions and 52 deletions
|
@ -20,17 +20,40 @@ Revision History:
|
|||
#define _THEORY_FPA_H_
|
||||
|
||||
#include"smt_theory.h"
|
||||
#include"trail.h"
|
||||
#include"fpa2bv_converter.h"
|
||||
#include"fpa2bv_rewriter.h"
|
||||
|
||||
namespace smt {
|
||||
|
||||
class theory_fpa : public theory {
|
||||
typedef trail_stack<theory_fpa> th_trail_stack;
|
||||
|
||||
|
||||
public:
|
||||
class atom {
|
||||
public:
|
||||
virtual ~atom() {}
|
||||
};
|
||||
|
||||
struct pred_atom : public atom {
|
||||
literal m_var;
|
||||
literal m_def;
|
||||
pred_atom(literal v, literal d) : m_var(v), m_def(d) {}
|
||||
virtual ~pred_atom() {}
|
||||
};
|
||||
|
||||
typedef ptr_vector<pred_atom> bool_var2atom;
|
||||
void insert_bv2a(bool_var bv, pred_atom * a) { m_bool_var2atom.setx(bv, a, 0); }
|
||||
void erase_bv2a(bool_var bv) { m_bool_var2atom[bv] = 0; }
|
||||
pred_atom * get_bv2a(bool_var bv) const { return m_bool_var2atom.get(bv, 0); }
|
||||
region & get_region() { return m_trail_stack.get_region(); }
|
||||
|
||||
protected:
|
||||
fpa2bv_converter m_converter;
|
||||
fpa2bv_rewriter m_rw;
|
||||
expr_map m_trans_map;
|
||||
th_trail_stack m_trail_stack;
|
||||
bool_var2atom m_bool_var2atom;
|
||||
|
||||
virtual final_check_status final_check_eh() { return FC_DONE; }
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
|
@ -40,6 +63,7 @@ namespace smt {
|
|||
virtual void new_diseq_eh(theory_var, theory_var);
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual void reset_eh();
|
||||
virtual theory* mk_fresh(context*) { return alloc(theory_fpa, get_manager()); }
|
||||
virtual char const * get_name() const { return "fpa"; }
|
||||
|
||||
|
@ -47,6 +71,7 @@ namespace smt {
|
|||
|
||||
void assign_eh(bool_var v, bool is_true);
|
||||
virtual void relevant_eh(app * n);
|
||||
|
||||
public:
|
||||
theory_fpa(ast_manager& m);
|
||||
virtual ~theory_fpa();
|
||||
|
@ -67,4 +92,3 @@ namespace smt {
|
|||
};
|
||||
|
||||
#endif /* _THEORY_FPA_H_ */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue