-
Notifications
You must be signed in to change notification settings - Fork 35
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 generate
operator
#1455
base: main
Are you sure you want to change the base?
Add generate
operator
#1455
Conversation
❌ Deploy Preview for quint-docs failed. Why did it fail? →
|
Hi! Thanks Igor, I'll take a look when I can. Please ignore the Netlify bot, I'm still not done setting it up |
Hey @konnov, I finally took a look at these and I feel like I need more context here. I don't think the name "generate" is very informative, and maybe we should have something more tuned to the particular use case where it is necessary. A couple of months ago, I introduced an operator called |
Hey @bugarela, yeah, I can see how |
Ok, so that makes me even more in favor of having the current: nondet a = Int.allListsUpTo(10).oneOf() and, in addition, the Set version: nondet a = Int.allSetsUpTo(10).oneOf() I'm using the infinite set |
Well, this would definitely play nice for the set of all integers, as it is a built-in set. Imagine you would like to generate a set of structures, e.g., of the shape |
I have to thoughts here:
Of course, this doesn't work. But I'd like to try and get closer to this intuition than introducing a magical
|
This looks really complicated. I agree that this is similar to how one would do it in a property-based framework, since most of them are functional. However, we don't have to do complicated things just because someone did them in the past. Thinking about with a fresh head, I would say that the most natural way for a non-TLA+ person to write this would be something like:
I am kind of making up keywords here. The point is that we essentially have to declare a fresh variable and limit its scope.
Yes, this would be great. As an alternative, we could have this form:
|
bumped the version of apalache to 0.45.3 |
Hi! I guess we agreed on a solution at the end of the last discussion. However, I'm having trouble picturing the use case for this and therefore assessing the priority here, as this doesn't seem trivial to implement. IIRC, we talked over zoom and you said you'd try to come up with an example to demonstrate where you need this. Are you still willing to do this? We could also jump into a call sometime, whatever works best. |
There is a link to the WIP example in my reply. Sure, happy to jump on a call! |
@bugarela I have just described the need for value generators in detail in Apalache: apalache-mc/apalache#3014 I agree that what we currently have in Apalache is a hack, though it's hard to tell how long it would take to implement a better version (proposed there). |
Hello !
I would like to add an experimental contribution, namely, the operator
generate
that mirrorsApalache!Gen
. This operator should unlock the feature of Apalache that is sometimes used to reason about inductive invariants. This PR:generate
generate
in the simulator, as it is not clear to me how one would implement that in the simulatorgenerate
apalache-mc/apalache#2916CHANGELOG.md
for any new functionality