Overview of

The filter (ascii <-) is the dual of . As with we can divide usages of into binary, ternary, and n-ary forms.

A filter is true exactly when the filter formed by reversing all the arrows and the order of the constituent filters is true:

      yx
is true exactly when
      yx
is true.

      zyx
is true exactly when
      xyz
is true.

value returned by

The reason to use rather than is that the value returned by the filters is different.

The value returned by yx is all squares in y that are attacked by x.

In general, if Z is a set filter, then the value of a chain of filters is loosely speaking, all the squares in the first filter in the chain that make the filter true.

, binary case

The filter
    xy
is true exactly when
    yx
is true.

However, the value of

    yx
is the set of squares in y that are attacked by a piece in x.

For example, if the current position is the start position, then

    
    
    [e2,d2]

chains

zyz
matches a position if and only if
xyz
matches the position.

The value returned by

zyz
is the set of squares Z in z such that
Zyx
matches the position.

Likewise,

x1x2x3...xn
matches a position if and only if
      xnxn-1...x1
matches the position.

As before, the value of

          xnxn-1...x1
is the set of X in xn such that
          Xxn-1...x1

Examples

The black king's field, which is the set of squares attacked by the black king, is
      

Thus, to check that a white pawn is guarding an empty square in the black king's field, use:

      ()

To check that the maximum 27 squares are attacked by a white queen, use

      ==27
(As in maxqueenattack.cql).