mirror of
https://github.com/Z3Prover/z3
synced 2025-08-06 03:10:25 +00:00
fixup compiled patterns
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
1c694fd42f
commit
3afe081f62
5 changed files with 54 additions and 44 deletions
|
@ -80,13 +80,7 @@ class expr_pattern_match {
|
|||
}
|
||||
|
||||
void operator()(var* v) {
|
||||
var* b = nullptr;
|
||||
if (m_bound.find(v, b)) {
|
||||
m_memoize.insert(v, b);
|
||||
}
|
||||
else {
|
||||
UNREACHABLE();
|
||||
}
|
||||
m_memoize.insert(v, m_bound[v]);
|
||||
}
|
||||
|
||||
void operator()(app * n) {
|
||||
|
@ -98,15 +92,9 @@ class expr_pattern_match {
|
|||
if (m_subst.find(decl, r)) {
|
||||
decl = to_app(m_regs[r])->get_decl();
|
||||
}
|
||||
for (unsigned i = 0; i < num_args; ++i) {
|
||||
expr* arg = nullptr;
|
||||
if (m_memoize.find(n->get_arg(i), arg)) {
|
||||
SASSERT(arg);
|
||||
args.push_back(arg);
|
||||
}
|
||||
else {
|
||||
UNREACHABLE();
|
||||
}
|
||||
for (expr* arg : *n) {
|
||||
arg = m_memoize[arg];
|
||||
args.push_back(arg);
|
||||
}
|
||||
if (m_manager.is_pattern(n)) {
|
||||
result = m_manager.mk_pattern(num_args, reinterpret_cast<app**>(args.c_ptr()));
|
||||
|
@ -116,7 +104,6 @@ class expr_pattern_match {
|
|||
}
|
||||
m_pinned.push_back(result);
|
||||
m_memoize.insert(n, result);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue