How to convert a Sequences to a set efficiently

20 views
Skip to first unread message

the anh pham

unread,
Jun 5, 2019, 8:12:23 AM6/5/19
to tlaplus
Dear all,

Does anyone know how to convert a Sequences to a Set effectively or/and quickly or/and simply?

Thank you very much. 
Best regards,
TA

Stephan Merz

unread,
Jun 5, 2019, 9:17:56 AM6/5/19
to tla...@googlegroups.com
Hi The Anh,

if you want to construct the set of the elements (i.e., the co-domain) of a sequence you can define

Range(s) == { s[i] : i \in DOMAIN s }

Of course, you lose the information on the order and the multiplicity of the elements in the original sequence.

Hope this helps,
Stephan

--
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...@googlegroups.com.
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/903b7595-fab3-4547-805a-56a494757bfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages