Closed lemmy closed 3 years ago
Just some notes as I use this bug report as an opportunity to dig into the code a bit.
So here's the error being raised:
I suspect it's coming from this part of the lexer:
After including the parser location in the error message, it became clear the parser is failing on the last line here, at the opening {
:
\* SPECIFICATION
CONSTANTS
BufCapacity = 3
Producers = {p1,p2,p3,p4}
(See https://github.com/lemmy/BlockingQueue/blob/3a66f46f6f5703f2863f71baaf0aedaaee58836f/BlockingQueue.cfg#L1-L4 for the source.)
Indeed, the lexer defined in TlcConfigLexer.scala
is not equipped to recognize sets at all. Presumably this pertains to the "limited syntax" noted in the manual https://github.com/informalsystems/apalache/blob/unstable/docs/manual.md#54-tlc-configuration-file ?
If this is currently a necessary limitation, then we can at least improve the documentation and the error reporting to help guide the user. If this is not a necessary limitation, I'd be interested in adding the support for handling sets in cfg
files.
Why wasn't it possible to reuse TLC's config parser?
Our conjecture was that the users are not writing .cfg files by hand. Rather they use whatever is produced by the TLA+ Toolbox. This obviously does not apply to the power users :-)
It looks to me that the ability to define sets in .cfg is redundant, as one can do that directly in TLA+. That is what TLA+ Toolbox is doing, right?
@lemmy, could you point us to the TLC's config parser, so we could evaluate the efforts of integrating with it?
The VScode extension that appears to be popular, especially amongst new users, requires users to write the config file by hand. I believe it's considered a feature.
tlc2.tool.impl.ModelConfig
(it has few dependencies)
@lemmy, I am looking at ModelConfig
right now. The following statements are not specified in Leslie's book:
ALIAS
POSTCONDITION
CHECK_DEADLOCK
Are they documented anywhere? I can guess what CHECK_DEADLOCK
is supposed to mean, but what about the other two?
CHECK_DEADLOCK
is (just) documented in https://github.com/tlaplus/tlaplus/issues/408 (https://github.com/tlaplus/tlaplus/commit/6b4ed51d71d8920e7d46cc6082d74a49ddd9c4a2#diff-07401e8655448b2206c966598d56fd732a5fd7943cac5d437971cc989e9c2047R1377-R1381)POSTCONDITION
is documented in https://lamport.azurewebsites.net/tla/current-tools.pdfALIAS
in (just) documented in https://github.com/tlaplus/tlaplus/issues/485I find ALIAS
to be really useful (to e.g. do trace expressions).
I guess, ALIAS
is supposed to be similar to alias
in shell? From what I see in the description, it is more like DISPLAY
or SHOW
. But if it is already in production, that is not important.
ALIAS
is actually inspired by SQL's ALIAS, but VIEW
would have been the best term. Unfortunately, VIEW
was already taken.