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

*From*: Anand Kumar <akkeshavan@xxxxxxxxx>*Date*: Tue, 16 Aug 2022 02:55:49 -0700 (PDT)*References*: <09b86764-7c37-4c9b-b120-982a0018d9dcn@googlegroups.com> <9B4878A6-3141-4D83-AA54-DF2762A26412@gmail.com>

Here are a couple fo examples:

ToSet(seq) ==

{ seq[i] : i \in **DOMAIN** seq }

BlockHasMessages(block,channel) ==

**IF** Len(channel) >0 **THEN**

\E message \in ToSet(channel) : block.id = message

**ELSE**

FALSE

In this example, if I remove the ToSet(channel), it gives an error. channel is a sequence. So \E in TLA+ seems to work on sets but not on sequences.

Second one

TypeOK ==

\A block \in Blocks: block.state \in StateSet

where Blocks is a structure , which is a sequence as per documentation

Blocks = [

a |-> [ id |-> "a", state |-> "waiting", inputs |->0, outputs|-> <<"b","c">>],

b |-> [ id |-> "b", state |-> "waiting", inputs |->1, outputs|-> <<"c","d">>],

c |-> [ id |-> "c", state |-> "waiting", inputs |->2, outputs|-> <<"d">>],

d |-> [ id |-> "d", state |-> "waiting", inputs |->2, outputs|-> <<>>]

];

This results in a usinga quantifier of a non-enumerable error.

On Sunday, 14 August 2022 at 18:06:07 UTC+5:30 Stephan Merz wrote:

Hello,PlusCal expressions are the same as those in TLA+, and if your question is if the formulas in the definitions below:Reverse(s) == [i \in 1 .. Len(s) |-> s[Len(s)-i+1]IsMirrorSeq(seq) == \E s \in Seq(Nat) : seq = s \o Reverse(s)are well-formed TLA+ formulas, the answer is yes.Tools for TLA+ impose different restrictions on what kind of formulas they can handle. For example, TLC will not be able to evaluate the formula IsMirrorSeq(<<0,1,1,0>>) out of the box, but you can override the Seq operator to impose a bound on the length of sequences. More information on how to do this is available in the Help pages.Hope this helps,StephanOn 14 Aug 2022, at 06:15, Anand Kumar <akkes...@xxxxxxxxx> wrote:I am new to this, and would appreciate any pointers in this matter.Thanks in advance--

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+u...@xxxxxxxxxxxxxxxx.

To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/09b86764-7c37-4c9b-b120-982a0018d9dcn%40googlegroups.com.

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 view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/c3ddcc2c-c36d-45a8-b9c3-3f936364f963n%40googlegroups.com.

**Follow-Ups**:

**References**:

- Prev by Date:
**Re: [tlaplus] Run TLC model checker in Azure** - Next by Date:
**Re: [tlaplus] IS there any way of applying \A and \E on sequences in PlusCa l? <EOM>** - Previous by thread:
**Re: [tlaplus] IS there any way of applying \A and \E on sequences in PlusCa l? <EOM>** - Next by thread:
**Re: [tlaplus] IS there any way of applying \A and \E on sequences in PlusCa l? <EOM>** - Index(es):