# Boolean operators

Boolean operators are used to combine two operands that can range from simple attributes to complex expressions.
In order for the combination to be true, the two operands must either match or not match, based on the operator:

Operator The combination is true when:
`AND` Both operands match
`AND NOT` The first operand matches and the second doesn't
`OR` At least one operand matches
`XOR` One operand matches and the other doesn't
`NEXT` The first operand matches and the second matches too, but in a subsequent sentence
`NEXT NOT` The first operand matches while the second doesn't match in all the subsequent sentences
`PREV` The first operand matches and the second matches too, but in a preceding sentence
`PREV NOT` The first operand matches while the second doesn't match in all the preceding sentences

The scope of the combination always coincides with that of the rule: hits and misses can occur anywhere within that scope (for `AND`, `AND NOT`, `OR` and `XOR`), in subsequent sentences (for `NEXT` and `NEXT NOT`) or in preceding sentences (for `PREV` and `PREV NOT`).