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

[tlaplus] Re: Sets with mixed type elements



Does that mean that it wouldn't be possible switch based on type?
For example:

doTheThing(x) ==
    IF x \in Nat
    THEN \* Do something
    ELSE IF x = "none"
    THEN \* Do something else
    ELSE \* Something else as well

On Saturday, February 8, 2020 at 5:03:45 AM UTC+1 Shiyao MA wrote:
Elements of different types cannot be compared (or to say, unspecified).

Therefore, you cannot compare integer 1 with string "a".

Since a set requires unique elements, hence each element should be comparable against with each other.

There is one exception that, an element of "type" model value can be compared against other elements regardless of their type. The value is always false.

EGYM GmbH, Einsteinstraße 172, 81677 München
Geschäftsführer: Patrick Meininger, Philipp Roesch-Schlanderer, Florian Sauter, Christoph Bischoff

Gerichtsstand München | Amtsgericht München HRB 186394 | USt.-Id. DE275313632

--
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/113da86d-8323-4614-8f80-ab34f4262cf3n%40googlegroups.com.