--
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/c6213ec6-1261-4cc9-b646-9cda6c8d81d3n%40googlegroups.com.
Sum types are subtly different from union types. To represent union types in TLC, I usually do something like this:
CONSTANT NotAnInt
ASSUME NotAnInt \notin Int
TypeInv ==
OptionalVal \in Int \union {NotAnInt}
To represent optionals as a sum type, I'd instead used a tagged
struct:
TypeInv ==
OptionVal \in [type: {"some"}, val: Nat] \union [type:
{"none"}]
H
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/57aff553-fb2d-486f-8dc6-54524be0c034n%40googlegroups.com.