# xor function

True when an odd number of conditions are true.

## How to write it

### xor(p, q, ...)

**p**

A condition. Takes a condition, true or false.

**q**

A condition. Takes a condition, true or false.

## Examples

- $\displaystyle \operatorname{xor}(\operatorname{true}, \operatorname{false}) = \operatorname{true}$

  `xor(true, false)`

  In the solver, `xor(true, false)` gives `true`.

  [Open in the solver](https://hilberon.com/?q=xor%28true%2C%20false%29)

## Related functions

- [boolean_minimize](https://hilberon.com/library/boolean_minimize)

  A shortest equivalent form of a condition.
- [unequal](https://hilberon.com/library/unequal)

  True when two values differ: the function form of !=.
- [conflicting_rules](https://hilberon.com/library/conflicting_rules)

  Every set of rules that cannot hold together, each a list of the rules it needs; \[\] when all can hold.
- [truth_table](https://hilberon.com/library/truth_table)

  The truth table of a condition: a row for each choice of values.
- [cylindrical_decomposition](https://hilberon.com/library/cylindrical_decomposition)

  Describe where a condition holds as bounds on each variable in turn.
- [satisfiability_instances](https://hilberon.com/library/satisfiability_instances)

  The assignments of its variables that make a condition true.

---
Source: https://hilberon.com/library/xor
