tlaplus / Examples

A collection of TLA⁺ specifications of varying complexities
Other
1.25k stars 192 forks source link

Towards beginner friendly examples #15

Open lemmy opened 4 years ago

lemmy commented 4 years ago

The current README does not order examples that make it easy to pick beginner-friendly examples.

TLA+ concepts by which to cluster (tag?) specs:

Categories

Math: https://github.com/tlaplus/Examples/tree/master/specifications/SpecifyingSystems/SimpleMath https://github.com/tlaplus/Examples/tree/master/specifications/SpecifyingSystems/MoreMath https://github.com/tlaplus/Examples/tree/master/specifications/TransitiveClosure https://github.com/tlaplus/CommunityModules/blob/master/modules/Graphs.tla https://github.com/tlaplus/Examples/issues/23

Logic Puzzles: https://github.com/tlaplus/Examples/blob/master/specifications/Stones/ https://github.com/tlaplus/Examples/tree/master/specifications/DieHard (there are also PlusCal versions somewhere) https://github.com/tlaplus/Examples/tree/master/specifications/CarTalkPuzzle https://github.com/tlaplus/Examples/tree/master/specifications/MissionariesAndCannibals https://github.com/tlaplus/Examples/tree/master/specifications/N-Queens https://github.com/tlaplus/Examples/tree/master/specifications/Prisoners

Beginner specs based on popular problems in CS: https://github.com/tlaplus/Examples/tree/master/specifications/tower_of_hanoi https://github.com/tlaplus/Examples/tree/master/specifications/GameOfLife https://github.com/tlaplus/Examples/tree/master/specifications/CigaretteSmokers https://github.com/tlaplus/Examples/tree/master/specifications/SlidingPuzzles

Non-common concepts in TLA+: https://github.com/tlaplus/Examples/tree/master/specifications/SpecifyingSystems/Syntax (BNF grammar)

Specs of basic concurrent/distributed systems: https://github.com/tlaplus/Examples/tree/master/specifications/Chameneos https://github.com/tlaplus/Examples/tree/master/specifications/echo (PlusCal) https://github.com/tlaplus/Examples/tree/master/specifications/Tla-tortoise-hare (PlusCal) https://github.com/lemmy/BlockingQueue/ (tutorial) https://github.com/tlaplus/Examples/tree/master/specifications/dijkstra-mutex https://github.com/tlaplus/Examples/tree/master/specifications/ewd840 https://github.com/tlaplus/Examples/tree/master/specifications/ewd998

TLAPS: https://github.com/tlaplus/Examples/tree/master/specifications/sums_even https://github.com/tlaplus/Examples/tree/master/specifications/LoopInvariance https://github.com/tlaplus/Examples/tree/master/specifications/TeachingConcurrency

Technical

ahelwer commented 1 year ago

@lemmy do you actually want to add all these feature tags? It's definitely doable in the manifest with tree-sitter queries.

lemmy commented 1 year ago

The intent of this issue is to allow the community to tag and categorize examples. Github Blocks (technical preview) look like a possible solution.

ahelwer commented 5 months ago

PR #105 added beginner flags to the spec table, enforced via CI to correspond to the beginner tag in the manifest.json.

ahelwer commented 5 months ago

Although I guess this doesn't address all the category-related stuff or provide something like a track for people to look at. @lemmy do you think the latest changes suffice or we should do more?

lemmy commented 5 months ago

Thanks for tackling this issue. Tbh, I don't understand the use case for splitting the tables into local and elsewhere? I'd find it more relevant for users if the tables would be categories by complexity levels, such as beginner, intermediate, and real-world? However, I'm not sure there is an audience for intermediate, which is why we could also keep a single lookup table for advanced users and include a beginner-friendly section at the top of the Readme that introduces the specs suitable for beginners.

PS: I believe my BlockingQueue example is very beginner friendly, but it is now at the very bottom.

ahelwer commented 5 months ago

The local/elsewhere split is mostly just very helpful for CI checking; every spec in the local table must correspond to an entry in the manifest, and vice-versa. It also highlights the elsewhere specs as sort of a to-do list for us to bring them into the repo itself.

We can add a beginner flag to your BlockingQueue example and move it near the top! I broadly ordered the specs so that the more "features" they have flagged the higher their position in the table.

lemmy commented 5 months ago

Ideally, the table would be ordered based on community feedback, i.e., the number of stars/votes that specs gets over time. I assume that is not possible with Github flavored markdown?

ahelwer commented 5 months ago

Hmmm yeah I'm not sure how that could really be implemented

lemmy commented 5 months ago

It's the opposite of the direction in which we've been moving and I'm not saying it should be done, but moving each spec into its own Github repo in, perhaps, a dedicated github org would give us stars.