3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-02 09:20:22 +00:00

pull unstable

Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
This commit is contained in:
Nikolaj Bjorner 2015-04-01 14:57:11 -07:00
commit 52619b9dbb
337 changed files with 24943 additions and 30606 deletions

View file

@ -343,6 +343,7 @@ lbool array_simplifier_plugin::eq_default(expr* def, unsigned arity, unsigned nu
return l_undef;
}
bool array_simplifier_plugin::insert_table(expr* def, unsigned arity, unsigned num_st, expr*const* const* st, arg_table& table) {
for (unsigned i = 0; i < num_st; ++i ) {
for (unsigned j = 0; j < arity; ++j) {
@ -419,18 +420,19 @@ bool array_simplifier_plugin::reduce_eq(expr * lhs, expr * rhs, expr_ref & resul
set_reduce_invoked();
expr* c1, *c2;
ptr_vector<expr*const> st1, st2;
unsigned arity = 0;
get_stores(lhs, arity, c1, st1);
get_stores(rhs, arity, c2, st2);
if (is_const_array(c1) && is_const_array(c2)) {
unsigned arity1 = 0;
unsigned arity2 = 0;
get_stores(lhs, arity1, c1, st1);
get_stores(rhs, arity2, c2, st2);
if (arity1 == arity2 && is_const_array(c1) && is_const_array(c2)) {
c1 = to_app(c1)->get_arg(0);
c2 = to_app(c2)->get_arg(0);
if (c1 == c2) {
lbool eq = eq_stores(c1, arity, st1.size(), st1.c_ptr(), st2.size(), st2.c_ptr());
lbool eq = eq_stores(c1, arity2, st1.size(), st1.c_ptr(), st2.size(), st2.c_ptr());
TRACE("array_simplifier",
tout << mk_pp(lhs, m_manager) << " = "
<< mk_pp(rhs, m_manager) << " := " << eq << "\n";
tout << "arity: " << arity << "\n";);
tout << "arity: " << arity1 << "\n";);
switch(eq) {
case l_false:
result = m_manager.mk_false();

View file

@ -148,7 +148,7 @@ void distribute_forall::operator()(expr * f, expr_ref & result) {
while (!m_todo.empty()) {
expr * e = m_todo.back();
if (visit_children(e)) {
if (visit_children(e)) {
m_todo.pop_back();
reduce1(e);
}

View file

@ -0,0 +1,39 @@
/*++
Copyright (c) 2015 Microsoft Corporation
Module Name:
fpa_simplifier_plugin.cpp
Abstract:
Simplifier for the floating-point theory
Author:
Christoph (cwinter) 2015-01-14
--*/
#include"fpa_simplifier_plugin.h"
fpa_simplifier_plugin::fpa_simplifier_plugin(ast_manager & m, basic_simplifier_plugin & b) :
simplifier_plugin(symbol("fpa"), m),
m_util(m),
m_rw(m) {}
fpa_simplifier_plugin::~fpa_simplifier_plugin() {}
bool fpa_simplifier_plugin::reduce(func_decl * f, unsigned num_args, expr * const * args, expr_ref & result) {
set_reduce_invoked();
SASSERT(f->get_family_id() == get_family_id());
return m_rw.mk_app_core(f, num_args, args, result) == BR_DONE;
}
bool fpa_simplifier_plugin::reduce_eq(expr * lhs, expr * rhs, expr_ref & result) {
set_reduce_invoked();
return m_rw.mk_eq_core(lhs, rhs, result) == BR_DONE;
}

View file

@ -0,0 +1,39 @@
/*++
Copyright (c) 2015 Microsoft Corporation
Module Name:
fpa_simplifier_plugin.h
Abstract:
Simplifier for the floating-point theory
Author:
Christoph (cwinter) 2015-01-14
--*/
#ifndef _FPA_SIMPLIFIER_PLUGIN_H_
#define _FPA_SIMPLIFIER_PLUGIN_H_
#include"basic_simplifier_plugin.h"
#include"fpa_decl_plugin.h"
#include"fpa_rewriter.h"
class fpa_simplifier_plugin : public simplifier_plugin {
fpa_util m_util;
fpa_rewriter m_rw;
public:
fpa_simplifier_plugin(ast_manager & m, basic_simplifier_plugin & b);
~fpa_simplifier_plugin();
virtual bool reduce(func_decl * f, unsigned num_args, expr * const * args, expr_ref & result);
virtual bool reduce_eq(expr * lhs, expr * rhs, expr_ref & result);
};
#endif /* _FPA_SIMPLIFIER_PLUGIN_H_ */