Nesting/Unnesting Sets

16 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Amir Hossein Sayyad Abdi

ungelesen,
31.07.2019, 18:56:2331.07.19
an tla...@googlegroups.com
Hi everyone,

I woud like to know is there a way to unnest a set in TLA+?

The reason I am asking is because I have a set, say {a, b, c} which its elements are constants, and when I perform a union on this set with another set that contains the same elements I will get: {a, b, c, {a, b, c}}. But I expect the result to be {a, b, c}.

Best Regards
AmirHossein

Hillel Wayne

ungelesen,
31.07.2019, 22:35:0231.07.19
an tla...@googlegroups.com

The reason I am asking is because I have a set, say {a, b, c} which its elements are constants, and when I perform a union on this set with another set that contains the same elements I will get: {a, b, c, {a, b, c}}. But I expect the result to be {a, b, c}.

That shouldn't happen. If S = {a, b, c}, then S \union S = {a, b, c}. Are you accidentally writing S \union {S}?

If you have S = {{a}, {b}, {c}}, then UNION S = {a, b, c}.

H


Best Regards
AmirHossein

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/CAKxfy0sdTWMRETZEJkqUAVvVNspbC9VpRmXRtJJYa56-RkNNhA%40mail.gmail.com.

Amir Hossein Sayyad Abdi

ungelesen,
01.08.2019, 00:20:2201.08.19
an tla...@googlegroups.com
Correct, thanks for your help.

AmirHossein

Amir Hossein Sayyad Abdi

ungelesen,
01.08.2019, 00:34:2001.08.19
an tla...@googlegroups.com
Is there a way to unnest this set?

S = {{a, b, c}}

I mean for S to be as follows:
S = {a, b, c}


I have tried using SUBSET with cardinality equal to 1, but no luck so far.

Best Regards
AmirHossein

Stephan Merz

ungelesen,
01.08.2019, 02:37:3001.08.19
an tla...@googlegroups.com
UNION {{a,b,c}} = {a,b,c}

Regards,
Stephan

Amir Hossein Sayyad Abdi

ungelesen,
01.08.2019, 03:24:1401.08.19
an tla...@googlegroups.com
Thank you very much. Sorry I did not understand it earlier from Hillel's answer.

Best Regards,
AmirHossein


Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten