Skip to content

Conversation

@davidGG271
Copy link
Collaborator

Summary

This PR introduces a generic builder for CP models that allows constructing a MiniZinc model directly from a list of components and their associated CP constraint generators.

Changes

  • Added build_generic_cp_model_from_dictionary to MznModel, enabling generic construction of CP models from component–model mappings.
  • Added a unit test that validates the new builder using MznXorDifferentialModelARXOptimized.
  • The test applies fixed input/output constraints and solves the resulting CP model to ensure correctness.

Notes

  • The generic builder is model-agnostic and does not assume ARX-specific initialization.
  • ARX-specific constraints (init_constraints) are applied explicitly in the test where required.
  • This keeps the builder reusable for future CP models beyond ARX.

This change improves modularity and reusability of CP model construction, making it easier to extend support for additional CP-based models without duplicating build logic.

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.

3 participants