-
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.
add recfun rewriting, remove quantifier based recfun
- Loading branch information
1 parent
7f1b147
commit f919380
Showing
13 changed files
with
94 additions
and
143 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
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
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,39 @@ | ||
/*++ | ||
Copyright (c) 2018 Microsoft Corporation | ||
Module Name: | ||
recfun_rewriter.cpp | ||
Abstract: | ||
Rewriter recursive function applications to values | ||
Author: | ||
Nikolaj Bjorner (nbjorner) 2020-04-26 | ||
--*/ | ||
|
||
|
||
#include "ast/rewriter/recfun_rewriter.h" | ||
#include "ast/rewriter/var_subst.h" | ||
|
||
br_status recfun_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * const * args, expr_ref & result) { | ||
if (m_rec.is_defined(f)) { | ||
for (unsigned i = 0; i < num_args; ++i) { | ||
if (!m.is_value(args[i])) | ||
return BR_FAILED; | ||
} | ||
recfun::def const& d = m_rec.get_def(f); | ||
var_subst sub(m); | ||
result = sub(d.get_rhs(), num_args, args); | ||
return BR_REWRITE_FULL; | ||
} | ||
else { | ||
return BR_FAILED; | ||
} | ||
} | ||
|
||
|
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,36 @@ | ||
/*++ | ||
Copyright (c) 2018 Microsoft Corporation | ||
Module Name: | ||
recfun_rewriter.h | ||
Abstract: | ||
Rewriter recursive function applications to values | ||
Author: | ||
Nikolaj Bjorner (nbjorner) 2020-04-26 | ||
--*/ | ||
|
||
#pragma once | ||
|
||
#include "ast/recfun_decl_plugin.h" | ||
#include "ast/rewriter/rewriter.h" | ||
|
||
class recfun_rewriter { | ||
ast_manager& m; | ||
recfun::util m_rec; | ||
public: | ||
recfun_rewriter(ast_manager& m): m(m), m_rec(m) {} | ||
~recfun_rewriter() {} | ||
|
||
br_status mk_app_core(func_decl * f, unsigned num_args, expr * const * args, expr_ref & result); | ||
|
||
family_id get_fid() const { return m_rec.get_family_id(); } | ||
|
||
}; | ||
|
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
Oops, something went wrong.