Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to set/override constants #155

Open
lorin opened this issue May 25, 2020 · 2 comments
Open

Document how to set/override constants #155

lorin opened this issue May 25, 2020 · 2 comments

Comments

@lorin
Copy link

lorin commented May 25, 2020

I'm not sure how to set or override constant values.

I've figured out how to set model values in the .cfg file, for example:

CONSTANT APPROVED = APPROVED

However, if I want to set a constant value (e.g., set the constant Vmax to 3), or override the value of Nat to 0..(Vmax+1), I'm not sure how to do that.

The TLA+ Toolbox creates two files: mc.cfg and mc.tla, and puts something like this in mc.cfg:

\* CONSTANT definitions
CONSTANT
Vmax <- const_158915461269331000
\* CONSTANT definition
CONSTANT
Nat <- def_ov_158915461269332000

And then puts this in mc.tla:

---- MODULE MC ----
EXTENDS mymodulename, TLC

\* CONSTANT definitions @modelParameterConstants:8Vmax
const_158915461269331000 ==
3
----

\* CONSTANT definition @modelParameterDefinitions:0
def_ov_158915461269332000 ==
0..(Vmax+1)
----
=============================================================================

But I don't know what the equivalent of the mc.tla file is for the vscode plugin. I can put those definitions directly in my .tla file, but that feels gross. Putting the constants directly in the cfg file itself doesn't work.

@lemmy
Copy link
Member

lemmy commented May 25, 2020

@lorin AFAIK the prototype of a model editor is the only way to automatically generate the MC.tla/MC.cfg combi.

@lemmy
Copy link
Member

lemmy commented Nov 3, 2021

Related: #219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants