Coder Social home page Coder Social logo

Comments (10)

konnov avatar konnov commented on July 17, 2024 1

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.

from examples.

nrinaudo avatar nrinaudo commented on July 17, 2024

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

grep -lri -- "--\(fair\s\+\)\?algorithm" | grep -v toolbox | grep \.tla
  • all PlusCall specifications must contain --algorithm or --fair algorithm
  • I believe anything that's in the toolbox subdirectory is to be ignored?
  • filter on tla files to avoid false-positives in README or such

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:

  • it's possible to craft a TLA+ file that'll fail these commands by including, for example, \* Don't look for --algorithm, this is raw tla.
  • it's probably not reasonable to expect people to be able to craft github queries to reproduce the commands' behaviour.

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?

from examples.

lemmy avatar lemmy commented on July 17, 2024

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

from examples.

nrinaudo avatar nrinaudo commented on July 17, 2024

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:

  • I do not feel qualified to help with that, as I'm utterly incapable of deciding the "level" of a specification. Everything looks expert level to me :)
  • I would suggest this is another, unrelated feature - whether a specification is PlusCal or TLA+ is a property of the file, what you're talking about is additional, handcrafted metadata.

from examples.

lemmy avatar lemmy commented on July 17, 2024

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.

from examples.

nrinaudo avatar nrinaudo commented on July 17, 2024

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

Additional work:

  • specify acceptable metadata key (language, level, ...) and the values each can take
  • go through all existing specifications to tag them
  • make sure each new specification is tagged
  • possibly have some sort of build step that fails a PR if a tla file is found without the proper tags, or with an invalid value for a known tag.

Benefit:

  • more powerful searches
  • potentially generate that massive README.md table automatically, ensuring it doesn't grow stale

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?

from examples.

hwayne avatar hwayne commented on July 17, 2024

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

from examples.

lemmy avatar lemmy commented on July 17, 2024

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.

from examples.

lemmy avatar lemmy commented on July 17, 2024

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

from examples.

jonesmartins avatar jonesmartins commented on July 17, 2024

Any new thoughts on this tagging system?

from examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.