Descriptive Notation conversion ambiguities

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Kirk
Posts: 5702
Joined: Sat Mar 11, 2006 3:44 am

Descriptive Notation conversion ambiguities

Post by Kirk »

As it has been out of regular use for many years, programmers have not seen fit to add this to the notation options along with algebraic, long algebraic, etc. Chessmaster (at least thru 9000) has been the only GUI I know that has it.

I was wondering if anyone had a solution to deal with descriptive notation ambiguities in programming a conversion from algebraic to descriptive. The programmers of the Pirat GUI are attempting just that.

For example a pawn capture in Descriptive would just be "P x P". But thaqt works only if that is the only pawn capture possible. If there are more than the file and rank must always be given "P(Q4) X P". Same goes for other pieces where there can be more than one piece than can occupy a square and further infrmation is given.

Question: Would every possible exception need to be writen into the code, or is there shortcuts?

http://www.clarksvillechessclub.org/ebo ... ations.pdf
http://www.markalowery.net/Chess/Notati ... ation.html
http://en.wikipedia.org/wiki/Descriptive_chess_notation
“He knew all the tricks, dramatic irony, metaphor, pathos, puns, parody, litotes and... satire. He was vicious”
wgarvin
Posts: 838
Joined: Thu Jul 05, 2007 5:03 pm
Location: British Columbia, Canada

Re: Descriptive Notation conversion ambiguities

Post by wgarvin »

If I was trying to parse moves (or any kind of command) which were potentially ambiguous depending on what was actually on the board, I might try and do it as follows:

Scan the board for pieces that are eligible to be the moving piece. Each time you find one, figure out if there are move(s) which match the command. Add all matching moves by that piece to a list, and keep scanning the board.

At the end, if you have exactly one move in the list then you proceed. If you have more than one move in the list, you reject the command as being ambiguous.

The advantage of this method is that you don't have to know anything about the kind of conflicts/ambiguities that can occur. You simply examine one candidate move at a time to see if it is a match.

[Edit: I think the same kind of ambiguities can exist with standard algebraic notation, in which case it is qualified with extra information similar to your example?]
mageofmaple

Re: Descriptive Notation conversion ambiguities

Post by mageofmaple »

I think you are on the right path, but the ambiguity can be more than just the moving piece. Consider the case of PxP ... Maybe there is only one pawn that can make a capture, but there are two different pawns it can capture. (e.g., PxRP or PxBP)

Also, I'm not sure how algebraic notation can be unclear, since it specifies the starting square and the ending square.
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Descriptive Notation conversion ambiguities

Post by Carey »

I've examined the source for a few old programs that did classic descriptive notation, and it can be pretty complicated.

There are some areas where you can try to be clever, but it mostly boils down to plain old ugly brute force code.

You generate a list of all possible legal moves for that position. You then parse the entered move and reject any that are impossible. Destination square wrong, wrong rank or file, wrong promotion, capture vs. non-capture, whatever you can figure out from what the user entered.

If more than one is left, then the entered move is ambiguous.

The joy of doing it this way is that you don't have to really understand what the user entered. You just figure out what you can and reject moves if even one thing doesn't fit.


Going the other way, generating descriptive notation, is similar.

You start off with the full desciption and remove one piece of information at a time until it's no longer clear which move you mean.


And yes, SAN moves can also be unclear. That's the joys of minimalist notation.


It's usually a good idea to start at the end and parse the text backwards. Most of the confusion tends to be towards the front. But not always...


Also, you need to be a little loose in how you parse. Some people do promotions or enpassant, etc. a little differently.


You can look at one example of this kind of parsing in Atkin's classic Chess 0.5

If Robert Hyatt ever gets around to letting me release the source to CrayBlitz & Blitz, you can see how he did it.

I've got one other old program that does it, but I can't release it yet... Hopefully by the end of the year he'll have the docs written.

And hopefully by the end of the year, I'll have one more classic program that did descriptive notiation.
User avatar
Kirk
Posts: 5702
Joined: Sat Mar 11, 2006 3:44 am

Re: Descriptive Notation conversion ambiguities

Post by Kirk »

Hi!

I received the following email. Would you have any suggestions?

Hi

"As a last resort, the location of a capture or the starting point of a move may also be shown, delimited with parentheses or a slash, as BxN/QB6, or R(R3)-Q3. Sometimes only the rank or file is indicated, as R(6)xN. "

how would you write the move f2xg3 in descriptive notation?

PxN does not work as there are 6 Pawnmoves doing the same
BPxN does not work as there are 4 Pawnmoves doing the same
KBPxN does not work too as there are 3 Pawnmoves doing the same

P(2)x N does not work too
P(B)xN the same
P(KB)xN the same !! I donot know whether this is allowed anyway , no example --> be as kind as to comment
P(KB2)xN the same
PxN/KN3 the same


P(KB2)xN/KN3 is not mentioned anywhere as the last resort.


kind regards juergen
“He knew all the tricks, dramatic irony, metaphor, pathos, puns, parody, litotes and... satire. He was vicious”
User avatar
Bill Rogers
Posts: 3562
Joined: Thu Mar 09, 2006 3:54 am
Location: San Jose, California

Re: Descriptive Notation conversion ambiguities

Post by Bill Rogers »

Long before computer chess came into its own I had tried dozens of times to recreate games using the old long form. Alas there were so many mistakes made that I don't think I ever was able to play one game complete.
The new code, however, leaves no doubt about the exact move so why so you even want to bother?
E2-E4 or E4xD5 does not leave any question in the minds of the players.
Just my opinion
Bill
User avatar
Kirk
Posts: 5702
Joined: Sat Mar 11, 2006 3:44 am

Re: Descriptive Notation conversion ambiguities

Post by Kirk »

The only use it would have be to help those trying to read older books and articles. As an old guy I am "MultiLingual" but trying to read analysis given in algebraic and comparing it to old articles and books in descriptive is difficult.

Someone just came out with DVDs that contain the entire history of Chess Life Magazine. Of course, to read it one must know descriptive.

Beside, it is an interesting challenge to make a program be able to make that concersion. Chessmaster is the only one I know who does it and I am not sure it it is in the 11th or 10th as I only have 9K at the moment.
“He knew all the tricks, dramatic irony, metaphor, pathos, puns, parody, litotes and... satire. He was vicious”
User avatar
Kirk
Posts: 5702
Joined: Sat Mar 11, 2006 3:44 am

Re: Descriptive Notation conversion ambiguities

Post by Kirk »

Thanks Carey! :)
“He knew all the tricks, dramatic irony, metaphor, pathos, puns, parody, litotes and... satire. He was vicious”
User avatar
Marek Soszynski
Posts: 586
Joined: Wed May 10, 2006 7:28 pm
Location: Birmingham, England

Re: Descriptive Notation conversion ambiguities

Post by Marek Soszynski »

Just to say that ChessBase 9 can be set to display descriptive notation: Tools->Options->Notation->1.P-Q4
Marek Soszynski