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

A run command with growing scopes should stop once an instance is found #231

Open
SteveZhangBit opened this issue Feb 1, 2024 · 2 comments

Comments

@SteveZhangBit
Copy link

Here is a minimal test scenario:

sig A {}

run {} for 3..5 A

My question is what is the expected semantic for a scoped command? I expect that the model gradually increases the bound for A to find a solution. This is useful when I don't know the possible minimum bound for a signature.

So I expect that when 3 atoms of A would be satisfiable, the solver returns a solution. However, the actual behavior is it searches for 3, 4, and 5 As.

This is the line of code that I think causes this "issue":
https://github.com/AlloyTools/org.alloytools.alloy/blame/654e00b0338985c85457b246d154a9457c4a3299/org.alloytools.alloy.core/src/main/java/edu/mit/csail/sdg/translator/TranslateAlloyToKodkod.java#L509

@nmacedo
Copy link
Contributor

nmacedo commented Mar 28, 2024

This feature was never officially documented (as far as I know), so I'm not sure what was the initial intention. But I agree that a run command with growing scopes should stop once an instance is found. That's actually what happens in check commands with growing scopes, it stops at the first counter-example found.

@grayswandyr grayswandyr changed the title What's the correct behavior of scoped run command A run command with growing scopes should stop once an instance is found Apr 19, 2024
@grayswandyr
Copy link
Contributor

Renamed the issue.
Setting it as a possible enhancement.

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

3 participants