tlaplus / Examples

A collection of TLA⁺ specifications of varying complexities
Other
1.29k stars 200 forks source link

Classify specifications by TLA+ / PlusCal #8

Closed nrinaudo closed 1 year ago

nrinaudo commented 5 years ago

As discussed on twitter.

nrinaudo commented 5 years ago

My first instinct is that all PlusCal specifications can be found through:

grep -lri -- "--\(fair\s\+\)\?algorithm" | grep -v toolbox | grep \.tla

Finding all TLA+ specifications is achieved by flipping the first test to exclude PlusCal files:

grep -lriv -- "--\(fair\s\+\)\?algorithm" | grep -v toolbox | grep \.tla 

I've confirmed that this worked by comparing the output of the first command with a manually crafted list of all PlusCal specifications (grepped on algorithm, opened all corresponding files to check whether they were PlusCal or TLA+).

The advantage of this approach over manually tagging the specifications (such as with comments) is that it needs no special maintenance - our commands do not need files to be tagged in any specific way.

The two flaws I can think of are:

If this is an acceptable solution, I'd be happy to submit a PR that includes the commands in the README.md, as well as list the categories somehow - in the large table, maybe with a new PlusCal column?

lemmy commented 5 years ago

The no maintenance of no tags is certainly appealing but does it work for other (non-technical) tags such as [beginner|intermediate|advanced]?

nrinaudo commented 5 years ago

Err... I'm not sure what you mean. The two grep commands I've listed work specifically and only for identifying PlusCal or TLA+ specifications. So if you're asking whether they'll pick other tags: no, they won't, they're not at all designed for that.

Looking at a couple of specifications, I'm not seeing the beginner|intermediate|advanced tag. Is this something that already exists, or something you'd like to add? If the later:

lemmy commented 5 years ago

There is no additional metadata yet. I was just wondering if we can envision a tagging scheme that works for all metadata (let it be technical s.a. [tla|pcal|tlaps| or non-tech s.a. [beginner|intermediate|advanced]. It is not meant as a request to tag specifications.

nrinaudo commented 5 years ago

Sure, that'd work as well. It'd be more work to maintain, but it'd also be potentially more useful.

Additional work:

Benefit:

You could still use the commands I listed above to help you with tagging tla or pcal, it might be slightly faster than doing it manually, I suppose.

This sounds like a lot of work to me, is this repository popular enough to warrant this amount of efforts?

hwayne commented 5 years ago

What if for now we put PlusCal and raw TLA+ in separate folders?

lemmy commented 5 years ago

I'm reluctant to change the directory layout because others might rely on the current layout. E.g. Apalache runs benchmarks based on the examples and likely has scripts setup for that.

lemmy commented 4 years ago

@konnov Does https://github.com/konnov/apalache depend on the directory structure of the TLA+ examples?

konnov commented 4 years ago

No, Apalache does not use the directory structure of tlaplus-examples. Perhaps, a few links somewhere in the docs might break, but that is not a big deal.

jonesmartins commented 2 years ago

Any new thoughts on this tagging system?