3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-08 00:05:46 +00:00

move to util

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-04-26 21:22:14 -07:00
parent 6d4bd37e15
commit decd69ac73
3 changed files with 32 additions and 34 deletions

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#include "ast/ast_util.h"
#include "ast/ast_pp.h"
#include "ast/for_each_expr.h"
#include "ast/arith_decl_plugin.h"
app * mk_list_assoc_app(ast_manager & m, func_decl * f, unsigned num_args, expr * const * args) {
@ -372,3 +374,22 @@ static app_ref plus(ast_manager& m, expr* a, expr* b) {
app_ref operator+(expr_ref& a, expr_ref& b) {
return plus(a.m(), a.get(), b.get());
}
bool has_uninterpreted(ast_manager& m, expr* _e) {
expr_ref e(_e, m);
arith_util au(m);
func_decl_ref f_out(m);
for (expr* arg : subterms(e)) {
if (!is_app(arg))
continue;
app* a = to_app(arg);
func_decl* f = a->get_decl();
if (a->get_num_args() == 0)
continue;
if (m.is_considered_uninterpreted(f))
return true;
if (au.is_considered_uninterpreted(f, a->get_num_args(), a->get_args(), f_out))
return true;
}
return false;
}