Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mcsat ufnra model fix #518

Merged
merged 5 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/mcsat/uf/uf_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ void uf_plugin_build_model(plugin_t* plugin, model_t* model) {
break;
default:
app_construct = false;
continue;
break;
}

composite_term_t* app_comp = composite_term_desc(terms, app_term);
Expand Down Expand Up @@ -869,10 +869,10 @@ void uf_plugin_build_model(plugin_t* plugin, model_t* model) {

// Since we make functions when we see a new one, we also construct the last function
if (app_terms.size > 0 && mappings.size > 0 && app_construct) {
type_t tau = get_function_application_type(terms, prev_app_kind, prev_app_f);
type_t tau = get_function_application_type(terms, app_kind, app_f);
type_t range_tau = function_type_range(terms->types, tau);
value_t f_value = vtbl_mk_function(vtbl, tau, mappings.size, mappings.data, vtbl_mk_default(terms->types, vtbl, range_tau));
switch (prev_app_kind) {
switch (app_kind) {
case ARITH_RDIV:
vtbl_set_zero_rdiv(vtbl, f_value);
break;
Expand All @@ -883,7 +883,7 @@ void uf_plugin_build_model(plugin_t* plugin, model_t* model) {
vtbl_set_zero_mod(vtbl, f_value);
break;
case APP_TERM:
model_map_term(model, prev_app_f, f_value);
model_map_term(model, app_f, f_value);
break;
default:
assert(false);
Expand Down
16 changes: 16 additions & 0 deletions tests/regress/mcsat/uf/ufnra_07.smt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(set-option :print-success false)
(set-option :produce-models true)
(set-logic QF_UFNRA)
(declare-sort x4 0)
(declare-fun x2 () x4)
(declare-fun x1 () x4)
(declare-fun x6 () Real)
(declare-fun x3 (Real) Real)
(declare-fun x5 () Real)
(assert (> (* x5 2.0) x6))
(assert (< x5 x6))
(assert (not (= (x3 (- x6 x5)) 0.0)))
(assert (not (not (= (x3 x6) 0.0))))
(assert (not (= x2 x1)))
(check-sat)
(exit)
1 change: 1 addition & 0 deletions tests/regress/mcsat/uf/ufnra_07.smt2.gold
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sat
1 change: 1 addition & 0 deletions tests/regress/mcsat/uf/ufnra_07.smt2.options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--mcsat --trace mcsat::model::check
Loading