3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-26 10:35:33 +00:00

Fix uninterpreted sort definition. There was a mismatch in the behavior of the API and SMT front-ends. The SMT front-ends were using user_sorts to be able to support parametric uninterpreted sorts. After this fix, the API also creates user_sorts.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-02-12 14:34:31 -08:00
parent 3b8d72beeb
commit 3a15db5244
8 changed files with 23 additions and 14 deletions

View file

@ -1816,6 +1816,12 @@ sort * ast_manager::mk_sort(symbol const & name, sort_info * info) {
return register_node(new_node);
}
sort * ast_manager::mk_uninterpreted_sort(symbol const & name, unsigned num_parameters, parameter const * parameters) {
user_sort_plugin * plugin = get_user_sort_plugin();
decl_kind kind = plugin->register_name(name);
return plugin->mk_sort(kind, num_parameters, parameters);
}
func_decl * ast_manager::mk_func_decl(symbol const & name, unsigned arity, sort * const * domain, sort * range,
bool assoc, bool comm, bool inj) {
func_decl_info info(null_family_id, null_decl_kind);
@ -2058,7 +2064,7 @@ sort * ast_manager::mk_fresh_sort(char const * prefix) {
string_buffer<32> buffer;
buffer << prefix << "!" << m_fresh_id;
m_fresh_id++;
return mk_sort(symbol(buffer.c_str()));
return mk_uninterpreted_sort(symbol(buffer.c_str()));
}
symbol ast_manager::mk_fresh_var_name(char const * prefix) {