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

Add the option to specify a number of (counter)examples to generate #1360

Open
shonfeder opened this issue Feb 7, 2024 Discussed in #1138 · 3 comments
Open

Add the option to specify a number of (counter)examples to generate #1360

shonfeder opened this issue Feb 7, 2024 Discussed in #1138 · 3 comments
Assignees
Labels
product-audits This feature was requested by the audits team simulator Quint simulator

Comments

@shonfeder
Copy link
Contributor

Discussed in #1138

Originally posted by ivan-gavran September 1, 2023
I would like to start a discussion on a feature that would enable specifying a number of (different) counterexamples to be generated for quint run and quint verify.

The motivation comes from the usage of Quint in testing: with a specified model, I am interested in generating a (large) number of traces satisfying a property (given as a negated invariant).
I believe the proposed feature could already be achieved for quint verify by passing the Apalache parameter --max-error. I don't see how to accomplish the same for quint run with current options.

A more general view of this feature request would be to make sampling a first-class citizen of Quint (whereas now it can be accomplished by repeatedly looking for a counterexample). This functionality was one of the features of (now not actively developed) Modelator. The question is whether such feature belongs to Quint, or rather to wrappers of Quint (such as Modelator).

@shonfeder shonfeder added simulator Quint simulator product-audits This feature was requested by the audits team labels Feb 7, 2024
@shonfeder
Copy link
Contributor Author

shonfeder commented Feb 7, 2024

@ivan-gavran mentioned this would save time and help with audits. It is possible to do this with just scripting, but this is an obviously valuable feature for MBT.

As an extension of this, we should include a feature to generate N traces that produce a property, so take care of negating invariants.

This is not currently blocking any work as far as we know but would be a clear benefit.

As @p-offtermatt pointed out, one of the principle challenges with a user script is being able to identify duplicate traces.

As a separate, related concern, we should determine how easy it is to get this from apalache.

@josef-widder
Copy link
Member

It would definitely be useful to have this feature for MBT and audits. Actually I was surprised that it is not possible at the moment. I thought that because the help of quint run tells me

  --max-samples  the maximum on the number of traces to try
                                                       [number] [default: 10000]

there should be a way for me to access these 10000 traces. I really think it is important working on this feature.

@ivan-gavran
Copy link
Contributor

ivan-gavran commented Feb 12, 2024

--max-samples the maximum on the number of traces to try [number] [default: 10000]

there should be a way for me to access these 10000 traces. I really think it is important working on this feature.

Nitpicking, but have to in order to be on the safe side: just accessing those 10000 traces would not suffice: if a property is defined, the run stops immediately once a trace that satisfies the property is found (thus, all prior traces are not the ones we're interested in).
With no property defined, I believe it suffices to access the 10000 traces (and this too would be a valuable feature).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-audits This feature was requested by the audits team simulator Quint simulator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants