TLC doesn't like multiple types on function range

13 views
Skip to first unread message

JosEdu Solsona

unread,
Jun 14, 2020, 11:27:02 PM6/14/20
to tlaplus
Hello,

Is it possible to define a function with a multiple "type" range like [Nat -> Nat \union BOOLEANwithout TLC complaining about the type?.
When checking a type invariant will result in:

Attempted to check if the value:
FALSE
is in the integer interval 0..2

If "{a,b}" are untyped model values then there is no problem with [Nat -> Nat \union {a,b}], since "a" and "b" are by definition
unequal to anything but itself. But in the case of BOOLEAN, TLC refuses to compare with anything of different type.

Thanks!


Stephan Merz

unread,
Jun 15, 2020, 2:01:03 AM6/15/20
to tla...@googlegroups.com
The semantics of TLA+ doesn't specify if FALSE = 0 [1], for example, so TLC is rightly refusing to evaluate such expressions, and it is hard to see why it would be useful to use a function of type [Nat -> Nat \union BOOLEAN] in a specification.

Regards,
Stephan

[1] Note that this identity is true by convention in C.

--
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/a7fc436e-e2d6-4527-882e-3dcae49c8716o%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages