mirror of
https://github.com/Z3Prover/z3
synced 2026-07-04 14:26:10 +00:00
arrays (#4684)
* arrays Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * arrays Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * arrays Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * fill Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * update drat and fix euf bugs Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * const qualifiers Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * reorg ba Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * reorg Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * build warnings Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d56dd1db7b
commit
796e2fd9eb
79 changed files with 2571 additions and 1850 deletions
|
|
@ -20,7 +20,7 @@ Author:
|
|||
namespace euf {
|
||||
|
||||
class justification {
|
||||
enum kind_t {
|
||||
enum class kind_t {
|
||||
axiom_t,
|
||||
congruence_t,
|
||||
external_t
|
||||
|
|
@ -29,20 +29,20 @@ namespace euf {
|
|||
bool m_comm;
|
||||
void* m_external;
|
||||
justification(bool comm):
|
||||
m_kind(congruence_t),
|
||||
m_kind(kind_t::congruence_t),
|
||||
m_comm(comm),
|
||||
m_external(nullptr)
|
||||
{}
|
||||
|
||||
justification(void* ext):
|
||||
m_kind(external_t),
|
||||
m_kind(kind_t::external_t),
|
||||
m_comm(false),
|
||||
m_external(ext)
|
||||
{}
|
||||
|
||||
public:
|
||||
justification():
|
||||
m_kind(axiom_t),
|
||||
m_kind(kind_t::axiom_t),
|
||||
m_comm(false),
|
||||
m_external(nullptr)
|
||||
{}
|
||||
|
|
@ -51,24 +51,43 @@ namespace euf {
|
|||
static justification congruence(bool c) { return justification(c); }
|
||||
static justification external(void* ext) { return justification(ext); }
|
||||
|
||||
bool is_external() const { return m_kind == external_t; }
|
||||
bool is_congruence() const { return m_kind == congruence_t; }
|
||||
bool is_external() const { return m_kind == kind_t::external_t; }
|
||||
bool is_congruence() const { return m_kind == kind_t::congruence_t; }
|
||||
bool is_commutative() const { return m_comm; }
|
||||
template <typename T>
|
||||
T* ext() const { SASSERT(is_external()); return static_cast<T*>(m_external); }
|
||||
|
||||
justification copy(std::function<void*(void*)>& copy_justification) const {
|
||||
switch (m_kind) {
|
||||
case external_t:
|
||||
case kind_t::external_t:
|
||||
return external(copy_justification(m_external));
|
||||
case axiom_t:
|
||||
case kind_t::axiom_t:
|
||||
return axiom();
|
||||
case congruence_t:
|
||||
case kind_t::congruence_t:
|
||||
return congruence(m_comm);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return axiom();
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream& display(std::ostream& out, std::function<void (std::ostream&, void*)> const& ext) const {
|
||||
switch (m_kind) {
|
||||
case kind_t::external_t:
|
||||
if (ext)
|
||||
ext(out, m_external);
|
||||
else
|
||||
out << "external";
|
||||
return out;
|
||||
case kind_t::axiom_t:
|
||||
return out << "axiom";
|
||||
case kind_t::congruence_t:
|
||||
return out << "congruence";
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return out;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue