pgo icon indicating copy to clipboard operation
pgo copied to clipboard

TLA+ data model observations

Open fhackett opened this issue 6 years ago • 1 comments

Here are some notes on invariants from TLA+ that might be useful when compiling to Go.

  • "functions" can never grow or shrink their domain. This means that records will never gain members. It is an error to try to add a member to a record in TLC.
  • this also applies to tuples, though the subtleties may make that situation a little more complex
  • only finite sets can be iterated over according to TLC. an infinite set can be compiled to a predicate with no penalty. TLA+ supports a small number of predefined infinite sets that may be used.

fhackett avatar May 23 '18 21:05 fhackett

Update:

  • sets of functions (generated using the [ a -> b ] syntax) are not iterable, and in fact cannot even be checked for membership if a or b is a non-enumerable set

fhackett avatar May 24 '18 20:05 fhackett

This has already been incorporated into PGo's design by this point.

fhackett avatar Nov 14 '22 23:11 fhackett