So it turns out that you need a separate .tla
file for that. Suppose you have "Main.tla" as you source file. You want MyConst
to have value <<1,2,3>>
. TLA+ toolbox generates MC.tla
where it puts the constants:
---- MODULE MC ----
EXTENDS Main, TLC
const_uniq12345 = <<1,2,3>>
====
in MC.cfg
, there will be the line
CONSTANT MyConst <- const_uniq12345
Note that MyConst = const_uniq12345
won't work -- if you use =
instead of <-
, MyConst
will contain model value const_uniq12345
instead of <<1, 2, 3>>
I used https://github.com/hwayne/tlacli to be able to run TLC from command line (TLA toolbox has awful UX), and I was able to supply a tuple constant with help of extra .tla
file like this. I used meaningful name instead of const_uniq12345
too, of course. Had to call java -cp /path/to/tla2tools.jar ...
manually, though (got the full command using --show-script
option of tlacli
), because currently tlacli
doesn't handle <-
in the config.