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

*From*: Y2i <yur...@xxxxxxxxx>*Date*: Tue, 30 Apr 2013 05:15:17 -0700 (PDT)*References*: <6ccc4957-05c0-4d92-bce0-f3038e29671b@googlegroups.com> <D3D65DA6-B6AE-4D93-B141-F6C229307D20@gmail.com> <ee0d1cfb-369a-42a6-8e56-180cf119b6cd@googlegroups.com> <cff4d4e3-a12e-4362-8863-db2acd819c8a@googlegroups.com> <f1e8d12c-50cf-48de-849f-892e552a034b@googlegroups.com> <e99011f3-80fb-49ad-b891-39c14c6e1dd1@googlegroups.com> <52645D41-1DF5-40B1-957B-02C645CDCB03@gmail.com>

Hi Stephan,

I'm sorry I meant to type { [x -> d] : x \in {1..n} } but typed { [x -> d] : x \in 1..n }.

Would { [x -> d] : x \in {1..n} } also be a set of functions whose domain is a set from 1..n and whose range is a subset of d? I was not concerned about double comprehension, I was just trying to understand the difference between Dominik's version and { [x -> d] : x \in {1..n} } and it seemed that the only difference is Dominik's version takes into account <<>> while { [x -> d] : x \in {1..n} } does not. I could be wrong again since I'm still really new to TLA.

Thank you,

Yuri

On Tuesday, April 30, 2013 4:55:56 AM UTC-7, Stephan Merz wrote:

On Tuesday, April 30, 2013 4:55:56 AM UTC-7, Stephan Merz wrote:

Hi Yuri,I am not sure I understand your suggestion. { [x -> d] : x \in {1..y : y \in 0..n} } is the set of functions whose domain is a set of the form 1..y, for some y \in 0 .. n, and whose range is a subset of d. Any function of that shape is a sequence over d whose length is at most n, and the union of all these function sets gives you the set of sequences over d whose length is at most n. In contrast, { [x -> d] : x \in 1..n } is a set of functions whose domain is some x \in 1 ..n (so x is a natural number, assuming n \in Nat). Although it is a well-formed TLA _expression_, it is not clear what such a value is.If you are concerned about the double set comprehension in Dominik's suggestion, you can easily get rid of it. In fact, I just typed the following into TLAPS, the TLA+ Proof System, and it is proved immediately.LEMMAASSUME NEW n \in Nat, NEW DataPROVE UNION{[x -> Data]: x \in {1..y : y \in 0..n}} = UNION {[(1..y) -> Data] : y \in 0..n}OBVIOUSBest regards,StephanOn Apr 30, 2013, at 3:31 AM, Y2i <yur...@xxxxxxxxx> wrote:Dear Dominik,I realized that a record or a tuple is a shortcut for a function but did not think that a function with domain 1..n can be treated as a sequence. This is a very cleaver technique, thank you for sharing it!And what about using { [x -> d] : x \in {1..y : y \in 0..n} } instead of { [x -> d] : x \in 1..n }? Was it in order to take into account sequences of length 0?Thank you again,Yuri

On Monday, April 29, 2013 1:54:50 AM UTC-7, Dominik Hansen wrote:Dear Yuri,in TLA+ a sequence of length n is a function with the Domain 1..n .Hence [1..n -> Data] defines the set of all sequences of length n.The UNION-operator is used to collect all sequences of different length (from 0 to n) in a set.Dominik--

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...@googlegroups.com .

To post to this group, send email to tla...@xxxxxxxxxxxxxxxx.

Visit this group at http://groups.google.com/group/tlaplus?hl=en .

For more options, visit https://groups.google.com/groups/opt_out .

**Follow-Ups**:

**References**:**In computing initial states, the right side of \IN is not enumerable***From:*Y2i

**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable***From:*Stephan Merz

**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable***From:*Y2i

**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable***From:*Dominik Hansen

**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable***From:*Y2i

**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable***From:*Stephan Merz

- Prev by Date:
**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable** - Next by Date:
**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable** - Previous by thread:
**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable** - Next by thread:
**Re: [tlaplus] In computing initial states, the right side of \IN is not enumerable** - Index(es):