opt_solver: clarify model member names#10042
Merged
Merged
Conversation
Rename two members of opt_solver for readability: - m_models -> m_objective_models - m_last_model -> m_model m_objective_models is the per-objective vector of witnessing models, indexed by objective i just like m_objective_vars / m_objective_values / m_objective_terms; the new name makes it a consistent member of that family and removes the one-letter clash with the (renamed) single-model member. m_model is the single transient model most recently obtained from the context and returned to callers via get_model_core. Pure rename, no behavioral change. test-z3 /a passes (92/92). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small readability refactor in
opt_solver, no behavioral change.Rename
m_models→m_objective_modelsm_last_model→m_modelRationale
m_modelsis the per-objective vector of witnessing models, indexed by the objective indexiexactly likem_objective_vars,m_objective_values, andm_objective_terms. It was the only member of that parallel family not following them_objective_*naming, som_objective_modelsmakes the intent self-documenting.m_last_modelis the single, transient model most recently obtained from the context and handed back to callers viaget_model_core. Renaming it tom_modelreads more naturally, and the two now-distinct names (m_modelvsm_objective_models) avoid the previous one-letterm_model/m_modelsclash hazard.Both are private members of
opt_solver, so the change is fully self-contained withinopt_solver.{h,cpp}. A stale TRACE label ("last model") was updated to "current model" to match.Testing
test-z3 /a: 92 passed, 0 failed.distinct, box mode) — unchanged.