or
Anor
filter has two arguments, a left clause and a right clause. The word or
is between them:
or-filter := left-clause 'or' right-clause left-clause := filter right-clause := filterThe
or
filter is true in a position if either of its clauses is true in that position. For example:
check or Ra3is true in a position if either one side is in check in the position or if a white R is on a3 or both.
or
clauses can be strung together:
check or Ra3 or next (. Qa2) or hascomment "eh?"is true in a position if either the position is a check, or a white rook is on a3, or if the following position has a Q on a2, or if the current position has a comment containing the string "eh?".
(Technically the above or
filter is a single or
filter whose left clause is check
and whose right clause is the or
filter whose left clause is next (. Qa2)
and whose right clause is hascomment "eh?".
)
or filters as sets
If both of its clauses are sets, then theor
filter is a set as well. For example,
Aa-h8 or attack (a a-h8)is an
or
filter that is a set filter whose associated set in a position is the set of squares on the eight rank that either have a white piece on them or are attacked by a black piece. These can also be chained:
Aa-h8 or attack (a a-h8) or move from Ris an
or
filter that is a set filter whose associated set in a position is the union of the set of squares of the or
filter of its first two clauses (the or
filter discussed above) with the set of all destination squares of moves from a white Rook in the current position. (Note that technically this is a single or
filter whose left clause is Aa-h8
and whose right clause is the or
filter whose left clause is attack (a a-h8)
and whose right clause is move from R.
Examples