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

also enable nra learning when using interpolation mode #509

Merged
merged 6 commits into from
Apr 18, 2024
Merged
Changes from 1 commit
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
29 changes: 17 additions & 12 deletions src/mcsat/nra/nra_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2158,18 +2158,16 @@ void nra_plugin_learn(plugin_t* plugin, trail_token_t* prop) {

// Approximate the value
const mcsat_value_t* constraint_value = NULL;
if (!nra->ctx->options->model_interpolation) {
constraint_value = poly_constraint_db_approximate(nra->constraint_db, constraint_var, nra);
if (ctx_trace_enabled(nra->ctx, "mcsat::nra::learn")) {
ctx_trace_printf(nra->ctx, "nra_plugin_learn(): value = ");
FILE* out = ctx_trace_out(nra->ctx);
if (constraint_value != NULL) {
mcsat_value_print(constraint_value, out);
} else {
fprintf(out, "no value");
}
fprintf(out, "\n");
constraint_value = poly_constraint_db_approximate(nra->constraint_db, constraint_var, nra);
if (ctx_trace_enabled(nra->ctx, "mcsat::nra::learn")) {
ctx_trace_printf(nra->ctx, "nra_plugin_learn(): value = ");
ahmed-irfan marked this conversation as resolved.
Show resolved Hide resolved
FILE* out = ctx_trace_out(nra->ctx);
if (constraint_value != NULL) {
mcsat_value_print(constraint_value, out);
} else {
fprintf(out, "no value");
}
fprintf(out, "\n");
}
if (constraint_value != NULL) {
if (has_value) {
Expand All @@ -2181,7 +2179,14 @@ void nra_plugin_learn(plugin_t* plugin, trail_token_t* prop) {
break;
}
} else {
prop->add(prop, constraint_var, constraint_value);
if (!nra->ctx->options->model_interpolation) {
prop->add(prop, constraint_var, constraint_value);
} else {
if (ctx_trace_enabled(nra->ctx, "nra::learn")) {
ctx_trace_printf(nra->ctx, "nra: hinting variable = %d\n", constraint_var);
}
nra->ctx->hint_next_decision(nra->ctx, constraint_var);
}
}
}
}
Expand Down
Loading