@[reducible, inline]
Boolean “exclusive or”. xor x y
can be written x ^^ y
.
x ^^ y
is true
when precisely one of x
or y
is true
. Unlike and
and or
, it does not
have short-circuiting behavior, because one argument's value never determines the final value. Also
unlike and
and or
, there is no commonly-used corresponding propositional connective.
Examples:
false ^^ false = false
true ^^ false = true
false ^^ true = true
true ^^ true = false
Conventions for notations in identifiers:
- The recommended spelling of
^^
in identifiers isxor
.
Instances For
Boolean “exclusive or”. xor x y
can be written x ^^ y
.
x ^^ y
is true
when precisely one of x
or y
is true
. Unlike and
and or
, it does not
have short-circuiting behavior, because one argument's value never determines the final value. Also
unlike and
and or
, there is no commonly-used corresponding propositional connective.
Examples:
false ^^ false = false
true ^^ false = true
false ^^ true = true
true ^^ true = false
Conventions for notations in identifiers:
- The recommended spelling of
^^
in identifiers isxor
.
Equations
- Bool.«term_^^_» = Lean.ParserDescr.trailingNode `Bool.«term_^^_» 33 33 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ^^ ") (Lean.ParserDescr.cat `term 34))
Instances For
Equations
- x.instDecidableLe y = inferInstanceAs (Decidable (x = true → y = true))
Equations
- x.instDecidableLt y = inferInstanceAs (Decidable ((!x && y) = true))