mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 09:20:22 +00:00
ensure that seq rewriter gets invoked during pre-processing
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
eae17a43a2
commit
5b50d98b89
9 changed files with 130 additions and 41 deletions
39
src/ast/simplifier/seq_simplifier_plugin.cpp
Normal file
39
src/ast/simplifier/seq_simplifier_plugin.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*++
|
||||
Copyright (c) 2016 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
seq_simplifier_plugin.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Simplifier for the floating-point theory
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2016-02-05
|
||||
|
||||
--*/
|
||||
#include"seq_simplifier_plugin.h"
|
||||
|
||||
seq_simplifier_plugin::seq_simplifier_plugin(ast_manager & m, basic_simplifier_plugin & b) :
|
||||
simplifier_plugin(symbol("seq"), m),
|
||||
m_util(m),
|
||||
m_rw(m) {}
|
||||
|
||||
seq_simplifier_plugin::~seq_simplifier_plugin() {}
|
||||
|
||||
bool seq_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_FAILED;
|
||||
}
|
||||
|
||||
bool seq_simplifier_plugin::reduce_eq(expr * lhs, expr * rhs, expr_ref & result) {
|
||||
set_reduce_invoked();
|
||||
|
||||
return m_rw.mk_eq_core(lhs, rhs, result) != BR_FAILED;
|
||||
}
|
||||
|
39
src/ast/simplifier/seq_simplifier_plugin.h
Normal file
39
src/ast/simplifier/seq_simplifier_plugin.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*++
|
||||
Copyright (c) 2016 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
seq_simplifier_plugin.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Simplifier for the sequence theory
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2016-02-05
|
||||
|
||||
--*/
|
||||
#ifndef SEQ_SIMPLIFIER_PLUGIN_H_
|
||||
#define SEQ_SIMPLIFIER_PLUGIN_H_
|
||||
|
||||
#include"basic_simplifier_plugin.h"
|
||||
#include"seq_decl_plugin.h"
|
||||
#include"seq_rewriter.h"
|
||||
|
||||
class seq_simplifier_plugin : public simplifier_plugin {
|
||||
seq_util m_util;
|
||||
seq_rewriter m_rw;
|
||||
|
||||
public:
|
||||
seq_simplifier_plugin(ast_manager & m, basic_simplifier_plugin & b);
|
||||
~seq_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 /* SEQ_SIMPLIFIER_PLUGIN_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue