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

Feature request: circumvent naming clashes when including models #831

Open
Kjarar opened this issue Aug 15, 2024 · 0 comments
Open

Feature request: circumvent naming clashes when including models #831

Kjarar opened this issue Aug 15, 2024 · 0 comments

Comments

@Kjarar
Copy link

Kjarar commented Aug 15, 2024

From the docs, emphasis by me:

4.1.5.1. Model Instance Files

MiniZinc models can be constructed from multiple files using include items (see Include Items). MiniZinc has no module system as such; all the included files are simply concatenated and processed as a whole, exactly as if they had all been part of a single file. Rationale: We have not found much need for one so far. If bigger models become common and the single global namespace becomes a problem, this should be reconsidered.

We definitely have a need for that!

Assume you have different models, each complex enough so that different people build different models, and you want to join these models together with some more constraints. How are you supposed to do that with the current naming clash issue? You could force everyone to add a certain, globally unique pre-/suffix to each and every variable, parameter, enum and enum value in their models. But this is not a good solution as it is prone to errors and hinders readability.

If an include could be used inside a let, that would be a solution to the problem. But any other solution would be great as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants