Skip to content

opt_solver: clarify model member names#10042

Merged
levnach merged 1 commit into
masterfrom
levnach/rename-opt-solver-model-members
Jul 5, 2026
Merged

opt_solver: clarify model member names#10042
levnach merged 1 commit into
masterfrom
levnach/rename-opt-solver-model-members

Conversation

@levnach

@levnach levnach commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Small readability refactor in opt_solver, no behavioral change.

Rename

  • m_modelsm_objective_models
  • m_last_modelm_model

Rationale

m_models is the per-objective vector of witnessing models, indexed by the objective index i exactly like m_objective_vars, m_objective_values, and m_objective_terms. It was the only member of that parallel family not following the m_objective_* naming, so m_objective_models makes the intent self-documenting.

m_last_model is the single, transient model most recently obtained from the context and handed back to callers via get_model_core. Renaming it to m_model reads more naturally, and the two now-distinct names (m_model vs m_objective_models) avoid the previous one-letter m_model/m_models clash hazard.

Both are private members of opt_solver, so the change is fully self-contained within opt_solver.{h,cpp}. A stale TRACE label ("last model") was updated to "current model" to match.

Testing

  • Builds clean (CMake/Ninja, Release).
  • test-z3 /a: 92 passed, 0 failed.
  • Spot-checked optimization behavior (single-objective minimize with large distinct, box mode) — unchanged.

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>
@levnach levnach merged commit 557a0ca into master Jul 5, 2026
38 checks passed
@levnach levnach deleted the levnach/rename-opt-solver-model-members branch July 5, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant