[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlaplus] TLC tool Help



TLA+ is mainly intended for describing state machines. You apparently want to specify functional expressions. A syntactically correct version of your definition (ignoring leap years) could be represented as follows in TLA+:

-------- MODULE Test ---------

IsDayOfMonth(m,d) ==
  IF m = 2 THEN d = 28
  ELSE IF m \in {1,3,5,7,8,10,12} THEN d \in 1 .. 31
  ELSE d \in 1 .. 30

=======================

Using the Toolbox, you can check such a definition by creating a model, checking the box "No Behavior Spec" in the Model Overview pane, then switch to the "Model Checking Results" pane and enter expressions such as

IsDayOfMonth(7, 30)       or       IsDayOfMonth(2, 30)

in the "_expression_" field of the sub-window "Evaluate Constant _expression_". Clicking on the triangle on green background makes TLC evaluate the _expression_ and display the result.

Evaluating constant expressions in this way is useful for debugging your specification, but it is not what TLA+ is mainly useful for.

Regards,
Stephan

On 29 Jun 2019, at 13:40, MK Bug <android.ruba@xxxxxxxxx> wrote:

Hi,

I am new in TLA+, I want to write specification in TLA+ but the issue is I am confused about the tool TLC. 
My specification is as follows (without keeping in view the syntax just sharing you the logic)

For example:
---------------------------------------------------------------------
 Constant Month, Day

if Month \in 1,3,5,7,8,10,12 then
 1<Day<31
else
1<Day<30
end if

----------------------------------------------------------------------

Above is the specification but I am confused in Model where should i write this.




Please do share the understanding or difference between these, if possible.


But still confused.

Thanks,
Malaika

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to tlaplus@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/tlaplus.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CA%2BkanULzFNZeh00h18PoJg8QAEbUHM4n1po_XD7r8O-5ytitBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to tlaplus@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/tlaplus.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CF557722-0464-4BE6-9876-427869244791%40gmail.com.
For more options, visit https://groups.google.com/d/optout.