Skip to content

What is the recommended method of getting the Apalache/Option/Variants specs so a module can be parsed by SANY alone? #2824

Answered by konnov
ahelwer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ahelwer!

The answer depends on how you run TLC.

Command line

Consider the example spec t.tla:

---- MODULE t ----
EXTENDS Integers, Variants

VARIABLE
    \* @type: A(Int) | B(Str);
    v

Init == v = Variant("A", 0)

Next ==
    LET old == VariantGetUnsafe("A", v) IN
    v' = Variant("A", old + 1)

Inv == VariantGetUnsafe("A", v) < 10
==================

and the accompanying TLC config:

INIT Init
NEXT Next
INVARIANT Inv

Assuming that you have apalache.jar and tla2tools.jar in ~/Downloads, you could run TLC as follows:

java -cp ~/Downloads/tla2tools.jar:~/Downloads/apalache.jar tlc2.TLC t.tla

TLA+ Toolbox

In case of the TLA+ Toolbox, you could probably add apalache.jar to the libraries…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ahelwer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants