-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
847aec1
commit e3e2c21
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/*++ | ||
Copyright (c) 2022 Microsoft Corporation | ||
Module Name: | ||
cnf_nnf.h | ||
Abstract: | ||
pull nested quantifiers | ||
Author: | ||
Nikolaj Bjorner (nbjorner) 2022-11-24 | ||
--*/ | ||
|
||
#pragma once | ||
|
||
#include "ast/simplifiers/dependent_expr_state.h" | ||
#include "ast/normal_forms/pull_quant.h" | ||
|
||
|
||
class cnf_nnf_simplifier : public dependent_expr_simplifier { | ||
|
||
defined_names m_defined_names; | ||
|
||
public: | ||
cnf_nnf_simplifier(ast_manager& m, params_ref const& p, dependent_expr_state& fmls): | ||
dependent_expr_simplifier(m, fmls), | ||
m_pull(m) { | ||
} | ||
|
||
char const* name() const override { return "cnf-nnf"; } | ||
|
||
void reduce() override { | ||
nnf apply_nnf(m, m_defined_names); | ||
expr_ref_vector push_todo(m); | ||
proof_ref_vector push_todo_prs(m); | ||
proof_ref pr(m); | ||
expr_ref r(m); | ||
unsigned sz = qtail(); | ||
for (unsigned i = qhead(); i < sz && m.inc(); ++i) { | ||
auto d = m_fmls[idx]; | ||
push_todo.reset(); | ||
push_todo_prs.reset(); | ||
apply_nnf(d.fml(), push_todo, push_todo_prs, r, pr); | ||
m_fmls.update(i, dependent_expr(m, r, d.dep())); | ||
for (expr* f : m_push_todo) { | ||
if (!m.inc()) | ||
break; | ||
m_rewriter(f, r, pr); | ||
m_fmls.add(i, depdendent_expr(m, r, d.dep())); | ||
} | ||
} | ||
} | ||
}; |