‹ BackHN Continuity

Thread

What TLA+ can and can't check

243 points · 51 comments · b-man

  1. IshKebab · · focus · HN ↗
    IMO TLA+ is not very good. It has super weird syntax, and a whole separate DSL (PlusCal) to give it workable syntax for programs. You can really tell it was created by the same mind as LaTeX.

    What is the Typst of formal modeling?

    Another issue is that you end up with a formal model that passes, but then you have still have to convert that to a real language by hand and not make any mistakes.

    1. Jtsummers · · focus · HN ↗
      > What is the Typst of formal modeling?

      I'm not sure there is one, but you can start exploring here:

      <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Category:Formal_specification_languages" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Category:Formal_specification_...

      For TLA+-styled model checking, though, there is Quint: <a href="https:&#x2F;&#x2F;quint.sh&#x2F;docs&#x2F;why" rel="nofollow">https:&#x2F;&#x2F;quint.sh&#x2F;docs&#x2F;why

    2. ahelwer · · focus · HN ↗
      It&#x27;s a reasonable question. There are novel things I like about the syntax - like vertically-aligned conjunction &amp; disjunction lists - but I don&#x27;t really want to defend syntax that still uses all-caps KEYWORDS like it&#x27;s the COBOL era and makes you use string values for enums. The underlying formalism is, however, amazing for thinking in, and it&#x27;s used by P, Quint, and FizBee which all to varying degrees paint themselves as TLA+ successor languages.

      I agree that spec&#x2F;implementation conformance checking is also an issue. P has apparently had some success with PObserve for trace validation (checking whether the log of a running system is a valid execution of a P spec) but it is still not a well-known method with these tools in the same way that fuzzing or property-based testing have become. This requires some real product-level thinking to make usable and possibly full ownership of the system execution environment inside a VM or something like that.

    3. tombert · · focus · HN ↗
      I feel like PlusCal and TLA+ operate at a different level. I use PlusCal primarily when what I&#x27;m modeling has a lot of sequential &quot;A then B then C...&quot; steps. With PlusCal a program counter is implied and it maps more directly to sequential algorithms.

      When I write regular TLA+, it&#x27;s usually for things that aren&#x27;t nearly as &quot;order-dependent&quot;.

    4. beu5a · · focus · HN ↗
      You should look into Quint: <a href="https:&#x2F;&#x2F;github.com&#x2F;quint-co&#x2F;quint" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;quint-co&#x2F;quint. It comes with simple syntax and very good developer tooling. Quint to TLA+ is what Typst is to Latex.
    5. pjmlp · · focus · HN ↗
      I like how PlusCal looks, however I vouch for the same sentiment as you.

      As already expressed multiple times, if it isn&#x27;t like Dafny, Lean, FStar, SPARK, Frama-C, possibly others, where the formal model can be directly mapped to code, I don&#x27;t see what was actually proven, other than a theoretical exercise.

      1. ahelwer · · focus · HN ↗
        Many TLA+ users will tell you the greatest value of writing a spec was it forced them to think clearly about their system. However, thinking is very hard to sell, so we tend to center the razzle-dazzle about model-checking properties of your state space. Which is a great capability, don&#x27;t get me wrong! Most non-trivial systems have a state space far larger than can be assessed for finding bugs via thinking.
    6. NooneAtAll3 · · focus · HN ↗
      &gt; What is the Typst of formal modeling?

      better question is &quot;what&#x27;s the markdown of formal modeling?&quot;

      the best outcome for everyone is to have something that&#x27;s so easy it&#x27;s ubiquitous

      1. Revanche1367 · · focus · HN ↗
        The closest thing I’ve come across to this is Z (“Zed”) notation. It’s from the late 70s, quite influential and pretty easy to read with a bit of logic symbolism. The same designer (Jean-Raymond Abrial) and colleagues also made the B method which can also do program refinement. Several other “well-known” (relative to other formal methods) formal specification systems were influenced by Z, including possibly TLA+ as I’ve read somewhere (but cannot confirm). Z and B both have free tooling available online.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.