CQL version 6.0.5 release notes
- Issues CQLI9.222-1 through CQLI9.222-5 have been fixed. We thank Robert Gamble for developing a meticulously programmed code suite, which found and helped fix these bugs.
- An experimental command line option
-outputbuffer
has been added. This option must be followed by a positive integer denoting the maximum number of bytes in a single output PGN game (the current default is 105000). This option is experimental and not supported. - The two-piece-cycle.cql CQL file, which illustrates regular expression usage in line , was added to the examples.
CQL version 6.0.4 release notes
- Issues CQLI9.218-1 and CQLI9.218-2 have been fixed
- The
-alwayscomment
command line option, which disables smart comments, has been documented - CQLI9.222-1 When
0
is specified as the command line argument to certain command line options for which0
is not a valid value, the error message printed is uninformative. For examplecql -g 0 foo.cql
results in an uninformative error message. - CQLI9.222-2 Certain missing command line arguments could result in unclear error messages. For example,
cql -i foo.pgn -result
would yield an unclear error message. - CQLI9.222-3 When the
-matchcount
was specified in conjunction with a matchcount parameter in the CQL header, an error with an unclear error message would be signaled. - CQLI9.222-4 When echo is used for its numeric value, the result can be incorrect. Specifically, in a filter E of the form
echo (x y) F
where F is a numeric filter and where theecho
filter E is used for its numeric value, the value of E at a position Z is the value of F whenx
has the value Z and wheny
is the position whose positionid is maximal among those positions for which F matches. In practice, this issue can affect the ordering of a few games when F is a consecutivemoves filter and when the E is sorted; we have not seen this issue affect other F in practice (most of the time whenecho
is used for its numeric value, it is used inside sort and the maximaly
coincides with the matchingy
with maximalpositionid
.) - CQLI9.222-5 When line is used with firstmatch, some constituent filters in the
line
may be evaluated even after the first match occurs. If evaluating such a constituent filter has side-effects (such as assigning to a variable), then theline
filter could thus produce unexpected side-effects. For the issue to manifest:- the variations parameter must be set;
- the
firstmatch
parameter must be specified; - the constituent filter must produce a side-effect whose evaluation affects the output;
- the constituent filter must contain a move filter;
- the constituent filter must be evaluated on a position that contains variations that should not be visited because a match of the
line
filter already occurred.
line
; only the side effects of the constituent filter are affected. We have not observed this issue affectcql
code in practice, but it does occur in testing.
CQL version 6.0.3 release notes
This version is primarily a bug-fix release. We thank Robert Gamble for his assistance with this release.- CQLI9.218-1 In certain very unusual situations, when a comment parameter to the move filter is used when variations is set, the comment string associated to that parameter will be output as a comment when it should not be. This issue does not affect which games or positions are matched, only the comments to otherwise matching positions.
- CQLI9.218-2 When the singlecolor parameter is used with a backward line <-- and when the arguments to the line filter include either the + or *, an error message will be printed.
- Issues CQLI9.198-1 through CQLI9.198-10 have been fixed.
- comment and message now accept filters that have no value as argument. If the filter has no value, then
<true>
or<false>
is output, depending on whether the filter matches. For examplecomment ("check is: " check)
- max and min now accept more than two arguments.
- Some generic improvements to smart comments were made.
- Transform filters are more efficient in many cases, and are much better at avoiding the generation of redundant transforms.
- Transforms are now documented as supporting the
count
keyword. The use of range parameters to transform filters is now deprecated. - The notransform filter was added.
- The currenttransform keyword in message and comment was added.
- Modified puremate.cql, modelmate.cql, idealmate.cql to account for issue fixing CQLI9.198-7.
- When a transform's argument is a numeric filter, then the transform filter itself is numeric with value equal to the maximum of the values of the matching transforms of its argument.
- The transform documentation has been substantially rewritten. In addition to the introduction to transforms, there is now a more formal description. Each transform filter now has its own page.
CQL version 6.0.2 Issues
- CQLI9.198-1 In a
max
filter, the comments associated to the first argument would still appear in the output PGN file even if the value associated to that first argument was smaller than the value associated to the second argument; and similarly with min. For example,0<=max({comment "foo" 4} {comment "bar" 5})
would output bothfoo
andbar
as comments, even though smart comments would be expected to omit thefoo
comment. - CQLI9.198-2 passedpawns, connectedpawns, isolatedpawns, and doubledpawns all behave in ways that, although documented, are unexpected when these filters are transformed under any transformation filter other than flipcolor and fliphorizontal. For example,
rotate90 passedpawns
would result in neither the set of passed pawns nor the rotations of that set. This is a consequence of the definition ofpassedpawns
, but was not clearly documented. - CQLI9.198-3 The o-o, o-o-o, and castle parameters to move could exhibit unexpected behavior under any transform other than flipcolor and fliphorizontal. These transforms behave as if the moving king's source and destination square were encoded as explicit square designators, which silently transformed under shift and flip. (The user more likely expects these parameters to be invariant under
shift
orflip
transforms.) - **CQLI9.198-4** Consider a filter
T sort E
whereT
is a transform filter andE
a numeric filter. SupposeT
contains distinct basic transformationsT1
,T2
such that(T1E)<(T2E)
in the current position. Then the valueT1E
rather than the correctT2E
might be used for sorting purposes. This could affect the order of games that were sorted within a transformation filter, although the output set of games themselves would not be changed. - CQLI9.198-5 Within a compound filter
F
, if the value ofF
is numeric and used for its numeric value, and if the final filter ofF
did not match, then comments withinF
would, in certain cases, appear within the output PGN file (assuming, of course, the game as a whole matched). That is, smart comments might not delete comments associated with an unmatched numeric compound filter if that compound filter was used as a number. - CQLI9.198-6 Within a compound filter
F
, if the value ofF
is a position and used for its position value, and if the final filter ofF
did not match, then comments withinF
would, in certain cases, still appear within the output PGN file (assuming, of course, the game as a whole matched). That is, smart comments might not delete comments associated with an unmatched positional compound filter if that compound filter was used or its position value. For exampleinitial {comment ("foo") true parent}:check or comment ("bar")
would output both the commentfoo
and the commentbar
to the PGN output file, when the smart comments feature should output onlybar
. - **CQLI9.198-7** Let
F
be a move filter that uses either the parameter legal or pseudolegal and that also uses the parameter to with argumentE
. LetF'
be the filter that results fromF
by replacingE
with the . filter . LetM
be a move in the current position that matches the filterF'
. IfM
is an enpassant move, thenM
will match the filterF
. - CQLI9.198-8 If the keyword
piece
appeared followed by an identified followed by a token other than=
orin
, the resulting error message assumed the user intended anin
, and would be confusing if the user had omitted=
rather than omittingin
. - CQLI9.198-9 An
if
filter could not be used for its position value even if both itsthen
filter and itselse
filter were position filters. For example,{if check then parent else child}:parent
would signal an error. - CQLI9.198-10 The documentation for max and min incorrectly stated that these filters would not match if either of their two arguments failed to match.
CQL version 6.0.2 release notes
- CQL 6.0 issues CQLI9.186-1 through CQLI9.186-10 have been fixed.
- persistent variables can be declared without assigning to them in their declaration.
- The experimental
-guipgnstdin
and-guipgnstdout
command line options have been added.
CQL version 6.0 Issues
- **[CQLI9.186-1]** The backward line filter can write an inaccurate comment to the output PGN file, or can signal an error, when it is used with the default comment level. To use the backward line filter, specify either silent or quiet in the CQL header.
- [CQLI9.186-2] When the position filter is used, but the resulting position is ignored (that is, the
position
filter is only used to determine if its argument is nonnegative and smaller than the the number of positions in a game), the filter will always match. The workaround is not to ignore the position returned by theposition
filter. - [CQLI9.186-3] The error message signalled if the result filter has an invalid argument is not grammatical.
- [CQLI9.186-4] The error message signalled when the filename of the file containing the CQL code is not the last argument on the command line is missing a space.
- [CQLI9.186-5] The error message signalled when when both 'previous' and 'legal' are used with the move filter is inaccurate.
- [CQLI9.186-6] The error message signalled when a numeric variable is used only for whether it matches, not for its value, is misleading.
- **[CQLI9.186-7]** The elo filter does not work correctly and should not be used.
- [CQLI9.186-8] In certain unusual cases the ray or xray filter works incorrectly. Specifically, a
ray
orxray
filter wil be inaccurate if:- the
ray
orxray
filter has 4 or more set filter arguments; - one of these arguments, say F, matches an empty square; and
- F is not the first, second, or last argument to the filter.
- the
- [CQLI9.186-9] The
southwest
andsoutheast
keywords will signal an error if used as either standalone direction filters (southwest, southeast) or as parameters to ray. - [CQLI9.186-10] When a function is invoked without arguments, the error message output by CQL is missing a space
Release Notes for CQL version 6.0
This table below is a partial list of changes from CQL version 5.2 to CQL version 6.0. It is not complete due to the large number of changes that were made.We thank Robert Gamble for his assistance in finding and fixing numerous bugs in version 6.0.
Note that there were also some important changes from CQL version 5.1 to CQL version 5.2. If you are still using CQL version 5.1, read the release notes for CQL 5.2 before reading these release notes. CQL 6 also runs much faster than previous versions, particularly on complex CQL files. (On an 8-core machine, we typically see speedups of a factor of between 10 and 80 compared to CQL 5.2, depending on the exactly CQL file and PGN database). CQL 6 is also substantially more expressive and compact than previous versions of CQL.
Feature | Example | Description |
---|---|---|
multi-threaded execution | cql foo.cql |
CQL by default runs in multiple threads |
Variable names need not start with a dollar sign | checkers=A attack k |
A variable name can be any sequence of allowed characters and need not start with a dollar sign |
Variables can hold integers, sets of squares or positions | Attacks=A attacks . x = #Attacks y=find check
|
More powerful variables |
Arithmetic expressions | power A * 3<power a |
basic integer arithmetic and relational expressions |
legal move checking | move legal enpassant |
move filter supports legal and pseudolegal move computation (as well as castling and capture) |
functions | function forks(x){[rbnqk] attackedby x>1} |
user-defined functions |
if | if pin through a then x else y |
if/then/else statments |
many more command line features | cql -variations foo.cql |
arbitrary filters on the command line many new command line options |
pawn structure filters | passedpawns A&isolatedpawns a&doubledpawns sort connectedpawns |
pawn structure filters |
run cql without a CQL file | cql -i mydatabase.pgn -cql stalemate -cql btm -cql r |
when CQL file is missing, use cql(). as file |
FEN support | cql -fen 8/5kp1/p5N1/P4Pp1/6P1/PKP5/1B1r4/8 -i foo.pgn |
find positions in FEN notation, in CQL file or using -fen command line option |
pin support | .pin through A>1 |
Find pins |
c-style comments | check // the position is check /* this line is ignored */ |
Anything after // on a line in a CQL file is ignored. Anything between /* and */ is ignored. |
xray | xray (A a k) |
Rays where first argument attacks second (renamed from ray attack ) |
persistent variables | persistent NStalemates = NStalemates +1 |
persistent variables retain their value between games. They can be used for statistics |
echo | echo(s t) s&t==. |
simpler and more powerful replacement for old relation syntax |