-
Notifications
You must be signed in to change notification settings - Fork 5
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
Reliable extraction of counterexample traces #58
Comments
I'd be strongly in favor of (2), for the following reasons:
|
Thank you, for the thoughtful comments, @shonfeder! I agree, we should reuse as much of the common functionality as possible. And, as this case shows, doing some ad-hoc solutions (especially for TLA+) is not a good idea. The good approach for now looks to me as follows:
The only complication I see on this path is that Apalache will complain about types; so the generated TLA+ will need to extend the original model... What I think would be nice to have on the Apalache side, btw., is to allow passing untyped TLA+ into the |
I think we should be able to adapt to untyped specs, but I wonder what the downside is of requiring typed specs on the modelator side? iiuc, at stake in this decision is whether we push Apalache to accommodate a less-disciplined TLA or whether we push a requirement for greater discipline into the specs which Modelator can consume. I am generally in favor of pursuing the latter kinds of adjustments, since it ends up propagating more robust structure up through the ecosystem. If it's not too out of band here, could you give some pointers on why Modelator must support untyped specs? |
The main point is the increased user base. While we all agree Apalache is great, the user base of TLC is still much larger. So if we offer some services that work transparently both for Apalache and TLC, we will be able to win some users gradually, by allowing them to just use their specs as they are, not to reject them right away because their specs are untyped. And later, when they see the benefits of typing, they will want the types themselves. Apalache does require types to do model checking, of course, no question. But may be there is a possibility to do parsing without types? This would also serve as a low-effort entrance point to Apalache for TLC users -- if they want only to transform to JSON, for example. |
My main questions on this account would be:
I think what I'd like to understand is whether support for parsing untyped TLA+ is something Modelator needs in order to satisfy its current and immanent usage, or if this is an "optimization" for an anticipated benefit which isn't actually pressing. I'd be happy to sync up on this at some point when other involved stake holders are available. To be clear: I'm not questioning here because it seems impossible or too difficult to accommodate in Apalache. Rather, I want to make sure we correctly evaluate the tradeoffs between principled practice and compromises for the sake of short-term convenience. |
It is actually a usage scenario from ourselves. All current instantiations of MBT use untyped specs, but with an ad-hoc, project-specific tooling. Upgrading those to use modelator as the tooling should be relatively easy; but requiring the specs to be typed introduces an additional step. It might be that we need to do this step anyway, but it is a substantial additional time investment upfront, compared to the gradual transition. |
I'd be willing to take on the work of annotating the specs. |
I agree with most of the points made by both sides above, somehow, but wanted to highlight this point made by @shonfeder
I think it would be great if people used typed specs, and were able to introduce types to existing untyped specs very easily in all cases, however I don't think that's realistic. From my own experience so far I think that certain types of TLC-TLA specs that use very 'dynamic' implicit typing and polymorphism will be quite hard for people to retrofit types to. |
The outcome of today's discussion with @rnbguy and @danwt; it seems that the best way to move forward is this:
The plan is this:
The benefits are multiple: we get rid of an ad-hoc parsing; standardise the output between model-checkers, and simplify the whole toolchain. @shonfeder, @Kukovec , would be great to hear your opinion on that. |
My initial thought is that we do not want two different ways of serializing TLA+, especially if one is incomplete. Why couldn't we just convert the TLC counterexamples to Apalache's Json serialization format? |
Tho if we can reuse the linked tlatools code, then it would just be matter of some basic plumbing, and we wouldn't have to maintain two different serialization formats. |
The point of the simplified format is that is is directly deserializable into (a sequence of) structs corresponding to the state of a TLA+ model. This makes interactions with model checkers for the tools interested in counterexamples very straightforward, compared to importing from the full Apalache TLA+ JSON. |
Prior to final decision, could we interpose an evaluation here where we compare the TLC output of its counter examples with the output from Apalache, with an eye to how much of an obstacle the serialization would be? Apalache's JSON counter examples also give an array of states, and it might be good to compare the relative difficulty of ser/de with concrete examples. This is also with an eye towards interop by RPC with Apalache's planned server mode. I expect it would be nice from a maintenance and design perspective to not have to maintain to parallel, but somewhat different encodings? |
yes, sure, @rnbguy is working now on that comparison (see point 1 above). Ranadeep, would be great indeed to compare Apalache CE JSON vs TLC CE JSON side by side, as Shon suggests; could you please do it? |
Thanks! Let me know how I can help. |
Sorry for the late reply. Here is the comparison on an
ApalacheApalache's
tla2toolsUsing tla2tools, one has to add some extra operators to the invariant.
Calling tla2tools for
|
To add more to this,
|
@rnbguy thanks! What we also need is to test the TLC behaviour on various kinds of examples:
|
Given the need to write special specs for TLC to get JSON serialization, it seems like it might indeed be handy if we could just run TLC counterexamples through Apalache serialization. Tho I don't readily know whether that would give consistently structured data between Apalache and TLC counter examples. |
For the time being we decided to rework the ad-hoc parser, and to generalise it a bit (see #67)-- this is the fastest way to move forward. The more general approach is to be addressed later. |
Closed via #67. We will discuss the generalised solution with the Apalache team. |
As demonstrated by #56, our extraction of traces from counterexamples is incomplete.
The way it works now, is via an ad-hoc TLA+ parser, that is specific to the simple variant of TLA+ encountered in counterexamples.
Strategically, the requirement is that we support both Apalache and TLC in the near future, though for the nearest future (couple of weeks / a month) having only Apalache might be enough.
We need to weigh on a number of alternatives on how to proceed:
Any further ideas are welcome! We should keep in mind that we can ask Apalache team to implement some features if needed, but can't easily do so for TLC.
The text was updated successfully, but these errors were encountered: