Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mcsat-ufnra-model-fix' into smtc…
Browse files Browse the repository at this point in the history
…omp2024
  • Loading branch information
Ahmed Irfan committed Jun 14, 2024
2 parents 0a43f68 + c5994af commit 9f786bd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
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

0 comments on commit 9f786bd

Please sign in to comment.