Exclusive-Or operator?

74 views
Skip to first unread message

Andrew Helwer

unread,
Oct 11, 2017, 6:08:59 PM10/11/17
to tlaplus
Quick question - does TLA+ have an xor infix operator?

Hillel Wayne

unread,
Oct 11, 2017, 6:14:24 PM10/11/17
to tlaplus
There's no native infix operator, but you can define it as

A ^^ B == (A \/ B) /\ ~(A /\ B)

I don't believe any of the standard modules define ^^.

Andrew Helwer

unread,
Oct 11, 2017, 6:25:19 PM10/11/17
to tlaplus
Thanks! I duplicated this question & answer to StackOverflow for easy future reference: https://stackoverflow.com/questions/46698480/is-there-an-xor-exclusive-or-infix-operator-in-tla

Might trawl through other common questions here and do the same for them.

Hillel Wayne

unread,
Oct 11, 2017, 8:04:26 PM10/11/17
to tlaplus
Between your QA and jakewin's Liveness question, there have now been as many TLA+ questions posted on StackOverflow today as there have been in the past four years.
Reply all
Reply to author
Forward
0 new messages