-
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.
bug fixes and cleanup in projection functions
spacer would drop variables of sorts not handled by main loop. - projection with witness needs to disable qel style preprocessing to ensure witnesses are returned. - add euf plugin to handle uninterpreted sorts (and then uninterpreted functions)
- Loading branch information
1 parent
0cf2b5f
commit eee96ec
Showing
12 changed files
with
248 additions
and
107 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,4 @@ | ||
# auto-generated | ||
genaiscript.d.ts | ||
tsconfig.json | ||
jsconfig.json |
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
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
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
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,85 @@ | ||
/*++ | ||
Copyright (c) 2025 Microsoft Corporation | ||
--*/ | ||
|
||
|
||
#include "ast/ast_util.h" | ||
#include "ast/for_each_expr.h" | ||
#include "qe/mbp/mbp_euf.h" | ||
#include "qe/mbp/mbp_term_graph.h" | ||
|
||
namespace mbp { | ||
euf_project_plugin::euf_project_plugin(ast_manager& m): project_plugin(m) { | ||
|
||
} | ||
|
||
euf_project_plugin::~euf_project_plugin() { | ||
|
||
} | ||
|
||
bool euf_project_plugin::project1(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits) { | ||
return false; | ||
} | ||
|
||
family_id euf_project_plugin::get_family_id() { | ||
return basic_family_id; | ||
} | ||
|
||
bool euf_project_plugin::operator()(model& model, app_ref_vector& vars, expr_ref_vector& lits) { | ||
return false; | ||
} | ||
|
||
bool euf_project_plugin::project(model& model, app_ref_vector& vars, expr_ref_vector& lits, vector<def>& defs) { | ||
if (vars.empty()) | ||
return false; | ||
flatten_and(lits); | ||
expr_mark var_set; | ||
auto is_pure = [&](expr_mark& var_set, expr* v) { | ||
return all_of(subterms::all(expr_ref(v, m)), [&](expr* w) { return !var_set.is_marked(w); }); | ||
}; | ||
for (auto v : vars) | ||
var_set.mark(v, true); | ||
unsigned has_def = false; | ||
#if 1 | ||
// solve trivial equations | ||
for (auto e : lits) { | ||
expr* x = nullptr, *y = nullptr; | ||
if (m.is_eq(e, x, y) && var_set.is_marked(x) && is_pure(var_set, y)) { | ||
vars.erase(to_app(x)); | ||
defs.push_back({ expr_ref(x, m), expr_ref(y, m) }); | ||
has_def = true; | ||
} | ||
else if (m.is_eq(e, y, x) && var_set.is_marked(x) && is_pure(var_set, y)) { | ||
vars.erase(to_app(x)); | ||
defs.push_back({ expr_ref(x, m), expr_ref(y, m) }); | ||
has_def = true; | ||
} | ||
} | ||
if (has_def) | ||
return true; | ||
#endif | ||
|
||
// check if there is a variable of uninterp sort | ||
if (all_of(vars, [&](expr* v) { return !m.is_uninterp(v->get_sort()); })) | ||
return has_def; | ||
|
||
term_graph tg(m); | ||
tg.add_lits(lits); | ||
for (auto v : vars) | ||
if (m.is_uninterp(v->get_sort())) | ||
tg.add_var(v); | ||
|
||
// | ||
// now what: | ||
/// walk all subterms of lits. | ||
// push in partitions by value. | ||
// add equations from model | ||
// compute repr from tg. | ||
// | ||
|
||
|
||
return has_def; | ||
} | ||
|
||
} |
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,30 @@ | ||
|
||
/*++ | ||
Copyright (c) 2025 Microsoft Corporation | ||
--*/ | ||
|
||
|
||
#pragma once | ||
|
||
#include "model/model.h" | ||
#include "qe/mbp/mbp_plugin.h" | ||
|
||
namespace mbp { | ||
|
||
class euf_project_plugin : public project_plugin { | ||
public: | ||
euf_project_plugin(ast_manager& m); | ||
~euf_project_plugin() override; | ||
|
||
bool project1(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits) override; | ||
bool solve(model& model, app_ref_vector& vars, expr_ref_vector& lits) override { return false; } | ||
family_id get_family_id() override; | ||
bool operator()(model& model, app_ref_vector& vars, expr_ref_vector& lits) override; | ||
bool project(model& model, app_ref_vector& vars, expr_ref_vector& lits, vector<def>& defs) override; | ||
void saturate(model& model, func_decl_ref_vector const& shared, expr_ref_vector& lits) override { UNREACHABLE(); } | ||
|
||
}; | ||
|
||
}; | ||
|
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
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
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
Oops, something went wrong.