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

Remove get_first_interpretation adn get_every_interpretation #1299

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

Halbaroth
Copy link
Collaborator

As noticed by Basile, this feature is broken in presence of optimization and no one used it. This PR removes these options.

I kept the cli option but it is now a no-op.

As noticed by Basile, this feature is broken in presence of optimization
and no one used it. This PR removes these options.

I kept the cli option but it is now a no-op.
@Halbaroth Halbaroth added frontend models This issue is related to model generation. labels Feb 19, 2025
@Halbaroth Halbaroth mentioned this pull request Feb 19, 2025
let doc =
Fmt.str
"This option allowed choosing when the model generation occurs. \
It have been removed in Alt-Ergo 2.7.0. If model generation is \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It have been removed in Alt-Ergo 2.7.0. If model generation is \
It has been removed in Alt-Ergo 2.7.0. If model generation is \

match interpretation with
| INone when produce_models || dump_models -> ILast
| interpretation -> interpretation
let mk_interpretation _interpretation produce_models dump_models =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let mk_interpretation _interpretation produce_models dump_models =
let mk_model_generation _interpretation produce_models dump_models =

const mk_interpretation $ interpretation $
produce_models $ dump_models
),
const mk_interpretation $ interpretation $ produce_models $ dump_models),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const mk_interpretation $ interpretation $ produce_models $ dump_models),
const mk_model_generation $ interpretation $ produce_models $ dump_models),

if not updated then (
if Options.get_model_generation () then update_model env;
Options.Time.unset_timeout ();
(* may becomes ModelGen *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it can become ModelGen anymore — if the unknown-reason becomes ModelGen it should be set by update_model, not i_dont_know.

Comment on lines 201 to 202
(** Set [produce_models] accessible with {!val:get_produce_models} *)
val set_model_generation : bool -> unit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either the comment should be updated to say model_generation and get_model_generation, or the code should be updated to be called set_produce_models and get_produce_models (I think the second option makes more sense --- might as well standardise on the SMT-LIB names).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I named it set_produce_models first, I have no strong opinion on its name.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When in doubt about naming and there is an appropriate name for the SMT-LIB standard we should pick that one I think, so let's go with set_produce_models even if that is a slightly awkward name.

env.last_saved_objectives <- Some objectives;
with
| Ex.Inconsistent (_expl, _classes) as e -> raise e
| Util.Timeout -> i_dont_know env (Timeout ModelGen)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this line was removed because if we raise I_dont_know here the solver ends up in an inconsistent state and performing further commands can lead to incorrect output or crashes — is there a reason to add it back?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On next, if Timeout is raised during model generation, we catch it in unsat_rec and raise I_dont_know with Timeout ProofSearch as unknown reason, so the solver already ends up in an inconsistent state.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that is true — we actually check for timeout outside of the solver, from the frontend (which is a design wart we should fix someday, but it does mean this line is OK).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it because you pointed out that we cannot change the unknown reason as suggested by Steven. I don't understand what is wrong here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm, I see. It is because of the lazy value again...

@Halbaroth Halbaroth merged commit 76deb5a into OCamlPro:next Feb 19, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend models This issue is related to model generation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants