mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
parent
c6135a40d5
commit
872fd5e9ff
9 changed files with 125 additions and 43 deletions
|
@ -18,7 +18,7 @@ Author:
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "sat/smt/sat_smt.h"
|
||||
#include "sat/smt/sat_th.h"
|
||||
#include "sat/ba/ba_solver.h"
|
||||
#include "ast/pb_decl_plugin.h"
|
||||
|
||||
|
|
|
@ -23,10 +23,8 @@ namespace euf {
|
|||
|
||||
model_converter* solver::get_model() {
|
||||
sat::th_dependencies deps;
|
||||
#if 0
|
||||
collect_dependencies(deps);
|
||||
sort_dependencies(deps);
|
||||
#endif
|
||||
// deps.sort();
|
||||
expr_ref_vector values(m);
|
||||
dependencies2values(deps, values);
|
||||
return nullptr;
|
||||
|
@ -36,9 +34,6 @@ namespace euf {
|
|||
|
||||
}
|
||||
|
||||
void solver::sort_dependencies(sat::th_dependencies& deps) {
|
||||
|
||||
}
|
||||
|
||||
void solver::dependencies2values(sat::th_dependencies& deps, expr_ref_vector& values) {
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ Author:
|
|||
#include "sat/sat_extension.h"
|
||||
#include "ast/euf/euf_egraph.h"
|
||||
#include "ast/ast_translation.h"
|
||||
#include "sat/smt/sat_smt.h"
|
||||
#include "sat/smt/atom2bool_var.h"
|
||||
#include "sat/smt/sat_th.h"
|
||||
#include "tactic/model_converter.h"
|
||||
|
||||
namespace euf {
|
||||
|
|
|
@ -19,7 +19,6 @@ Author:
|
|||
|
||||
#pragma once
|
||||
#include "ast/ast.h"
|
||||
#include "ast/euf/euf_egraph.h"
|
||||
#include "sat/sat_solver.h"
|
||||
|
||||
namespace sat {
|
||||
|
@ -47,38 +46,6 @@ namespace sat {
|
|||
virtual void cache(app* t, literal l) = 0;
|
||||
};
|
||||
|
||||
class th_internalizer {
|
||||
public:
|
||||
virtual literal internalize(sat_internalizer& si, expr* e, bool sign, bool root) = 0;
|
||||
virtual ~th_internalizer() {}
|
||||
};
|
||||
|
||||
class th_dependencies {
|
||||
public:
|
||||
th_dependencies() {}
|
||||
euf::enode * const* begin() const { return nullptr; }
|
||||
euf::enode * const* end() const { return nullptr; }
|
||||
};
|
||||
|
||||
|
||||
class th_model_builder {
|
||||
public:
|
||||
|
||||
virtual ~th_model_builder() {}
|
||||
|
||||
/**
|
||||
\brief compute the value for enode \c n and store the value in \c values
|
||||
for the root of the class of \c n.
|
||||
*/
|
||||
virtual void add_value(euf::enode* n, expr_ref_vector& values) = 0;
|
||||
|
||||
/**
|
||||
\brief compute dependencies for node n
|
||||
*/
|
||||
virtual void add_dep(euf::enode* n, th_dependencies& dep) = 0;
|
||||
};
|
||||
|
||||
|
||||
class index_base {
|
||||
extension* ex;
|
||||
public:
|
||||
|
|
37
src/sat/smt/sat_th.cpp
Normal file
37
src/sat/smt/sat_th.cpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*++
|
||||
Copyright (c) 2020 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
sat_th.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Theory plugins
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2020-08-25
|
||||
|
||||
--*/
|
||||
#include "sat/smt/sat_th.h"
|
||||
#include "util/top_sort.h"
|
||||
|
||||
namespace sat {
|
||||
|
||||
/*
|
||||
* \brief add dependency: dst depends on src.
|
||||
*/
|
||||
void th_dependencies::add(euf::enode* src, euf::enode* dst) {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* \brief sort dependencies.
|
||||
*/
|
||||
void th_dependencies::sort() {
|
||||
top_sort<euf::enode> top;
|
||||
|
||||
}
|
||||
|
||||
}
|
66
src/sat/smt/sat_th.h
Normal file
66
src/sat/smt/sat_th.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*++
|
||||
Copyright (c) 2020 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
sat_th.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Theory plugins
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2020-08-25
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include "sat/smt/sat_smt.h"
|
||||
#include "ast/euf/euf_egraph.h"
|
||||
|
||||
namespace sat {
|
||||
|
||||
|
||||
class th_dependencies {
|
||||
public:
|
||||
th_dependencies() {}
|
||||
euf::enode * const* begin() const { return nullptr; }
|
||||
euf::enode * const* end() const { return nullptr; }
|
||||
|
||||
/*
|
||||
* \brief add dependency: dst depends on src.
|
||||
*/
|
||||
void add(euf::enode* src, euf::enode* dst);
|
||||
|
||||
/*
|
||||
* \brief sort dependencies.
|
||||
*/
|
||||
void sort();
|
||||
};
|
||||
|
||||
class th_internalizer {
|
||||
public:
|
||||
virtual literal internalize(sat_internalizer& si, expr* e, bool sign, bool root) = 0;
|
||||
virtual ~th_internalizer() {}
|
||||
};
|
||||
|
||||
class th_model_builder {
|
||||
public:
|
||||
|
||||
virtual ~th_model_builder() {}
|
||||
|
||||
/**
|
||||
\brief compute the value for enode \c n and store the value in \c values
|
||||
for the root of the class of \c n.
|
||||
*/
|
||||
virtual void add_value(euf::enode* n, expr_ref_vector& values) = 0;
|
||||
|
||||
/**
|
||||
\brief compute dependencies for node n
|
||||
*/
|
||||
virtual void add_dep(euf::enode* n, th_dependencies& dep) = 0;
|
||||
};
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue