Skip to content

Commit

Permalink
fix #2489
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Aug 16, 2019
1 parent 3074e2b commit fcc7bd3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/api/api_ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ extern "C" {
func_decl* d = mk_c(c)->m().mk_fresh_func_decl(prefix,
domain_size,
reinterpret_cast<sort*const*>(domain),
to_sort(range));
to_sort(range), false);

mk_c(c)->save_ast_trail(d);
RETURN_Z3(of_func_decl(d));
Expand All @@ -216,7 +216,7 @@ extern "C" {
if (prefix == nullptr) {
prefix = "";
}
app* a = mk_c(c)->m().mk_fresh_const(prefix, to_sort(ty));
app* a = mk_c(c)->m().mk_fresh_const(prefix, to_sort(ty), false);
mk_c(c)->save_ast_trail(a);
RETURN_Z3(of_ast(a));
Z3_CATCH_RETURN(nullptr);
Expand Down
8 changes: 4 additions & 4 deletions src/ast/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2346,10 +2346,10 @@ app * ast_manager::mk_app(func_decl * decl, unsigned num_args, expr * const * ar


func_decl * ast_manager::mk_fresh_func_decl(symbol const & prefix, symbol const & suffix, unsigned arity,
sort * const * domain, sort * range) {
sort * const * domain, sort * range, bool skolem) {
func_decl_info info(null_family_id, null_decl_kind);
info.m_skolem = true;
SASSERT(info.is_skolem());
info.m_skolem = skolem;
SASSERT(skolem == info.is_skolem());
func_decl * d;
if (prefix == symbol::null && suffix == symbol::null) {
d = mk_func_decl(symbol(m_fresh_id), arity, domain, range, &info);
Expand All @@ -2368,7 +2368,7 @@ func_decl * ast_manager::mk_fresh_func_decl(symbol const & prefix, symbol const
}
m_fresh_id++;
SASSERT(d->get_info());
SASSERT(d->is_skolem());
SASSERT(skolem == d->is_skolem());
return d;
}

Expand Down
18 changes: 11 additions & 7 deletions src/ast/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1921,20 +1921,24 @@ class ast_manager {
}

func_decl * mk_fresh_func_decl(symbol const & prefix, symbol const & suffix, unsigned arity,
sort * const * domain, sort * range);
sort * const * domain, sort * range, bool skolem = true);

func_decl * mk_fresh_func_decl(unsigned arity, sort * const * domain, sort * range) { return mk_fresh_func_decl(symbol::null, symbol::null, arity, domain, range); }
func_decl * mk_fresh_func_decl(unsigned arity, sort * const * domain, sort * range, bool skolem = true) {
return mk_fresh_func_decl(symbol::null, symbol::null, arity, domain, range, skolem);
}

func_decl * mk_fresh_func_decl(char const * prefix, char const * suffix, unsigned arity,
sort * const * domain, sort * range) {
return mk_fresh_func_decl(symbol(prefix), symbol(suffix), arity, domain, range);
sort * const * domain, sort * range, bool skolem = true) {
return mk_fresh_func_decl(symbol(prefix), symbol(suffix), arity, domain, range, skolem);
}

func_decl * mk_fresh_func_decl(char const * prefix, unsigned arity, sort * const * domain, sort * range) {
return mk_fresh_func_decl(symbol(prefix), symbol::null, arity, domain, range);
func_decl * mk_fresh_func_decl(char const * prefix, unsigned arity, sort * const * domain, sort * range, bool skolem = true) {
return mk_fresh_func_decl(symbol(prefix), symbol::null, arity, domain, range, skolem);
}

app * mk_fresh_const(char const * prefix, sort * s) { return mk_const(mk_fresh_func_decl(prefix, 0, nullptr, s)); }
app * mk_fresh_const(char const * prefix, sort * s, bool skolem = true) {
return mk_const(mk_fresh_func_decl(prefix, 0, nullptr, s, skolem));
}

symbol mk_fresh_var_name(char const * prefix = nullptr);

Expand Down

0 comments on commit fcc7bd3

Please sign in to comment.