mirror of
https://github.com/Z3Prover/z3
synced 2025-04-07 09:55:19 +00:00
46 lines
774 B
C++
46 lines
774 B
C++
/*++
|
|
Copyright (c) 2019 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
func_decl_replace.h
|
|
|
|
Abstract:
|
|
|
|
Replace functions in expressions.
|
|
|
|
Author:
|
|
|
|
Nikolaj Bjorner (nbjorner) 2019-03-28
|
|
|
|
Revision History:
|
|
|
|
|
|
--*/
|
|
|
|
#ifndef FUNC_DECL_REPLACE_H_
|
|
#define FUNC_DECL_REPLACE_H_
|
|
|
|
#include "ast/ast.h"
|
|
|
|
class func_decl_replace {
|
|
ast_manager& m;
|
|
obj_map<func_decl, func_decl*> m_subst;
|
|
obj_map<expr, expr*> m_cache;
|
|
ptr_vector<expr> m_todo, m_args;
|
|
expr_ref_vector m_refs;
|
|
|
|
public:
|
|
func_decl_replace(ast_manager& m): m(m), m_refs(m) {}
|
|
|
|
void insert(func_decl* src, func_decl* dst) { m_subst.insert(src, dst); }
|
|
|
|
expr_ref operator()(expr* e);
|
|
|
|
void reset();
|
|
|
|
bool empty() const { return m_subst.empty(); }
|
|
};
|
|
|
|
#endif /* FUNC_DECL_REPLACE_H_ */
|