Position Legally Reachable?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Position Legally Reachable?

Post by mjlef »

Has anyone written a program to prove or disprove a specific chess position is reachable following the rules? And of legal, what moves reach that position? If so, can you provide a link?
Vladimir Xern
Posts: 39
Joined: Wed Mar 08, 2006 8:30 pm

Re: Position Legally Reachable?

Post by Vladimir Xern »

This is a body of chess problems known as proof games, if I'm not mistaken. One example of a proof game solver is Natch. These problems are usually searching for shortest proof games, however. It will give a position and a move count asking to reconstruct the position in the given number of moves. That's quite different from just legality checking, with no restriction on the number of moves. Natch would probably choke on something too involved, but it might be able to be modified to be more general purpose. There are other solvers like Euclide that may be worth looking into.
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Position Legally Reachable?

Post by mjlef »

Vladimir Xern wrote:This is a body of chess problems known as proof games, if I'm not mistaken. One example of a proof game solver is Natch. These problems are usually searching for shortest proof games, however. It will give a position and a move count asking to reconstruct the position in the given number of moves. That's quite different from just legality checking, with no restriction on the number of moves. Natch would probably choke on something too involved, but it might be able to be modified to be more general purpose. There are other solvers like Euclide that may be worth looking into.
Thanks, exactly what I was looking for!
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Position Legally Reachable?

Post by Nordlandia »

I downloaded Version 0.7 dating 2007, but encountered this problem.

Image
jpqy
Posts: 550
Joined: Thu Apr 24, 2008 9:31 am
Location: Belgium

Re: Position Legally Reachable?

Post by jpqy »

Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Position Legally Reachable?

Post by Lyudmil Tsvetkov »

I guess no one can write perfect code, as there are too many specifics.

I guess most GUIs would have problems even only defining what would be strictly legal.

[d]qnbqkb1r/pp1ppppp/8/8/8/8/PP1PPPPP/RNBQKBNR w KQk - 0 1

Fritz says this is legal, but how on Earth did the black c passer reach promotion square, as white Bc1 did not move with both b2 and d2 pawns on their home squares?

btw., what is the distinction between a legally reachable position and a legal position? are not all legally unreachable positions illegal per se?
brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

Re: Position Legally Reachable?

Post by brianr »

I have not done every step, but with only one black knight the other could have been taken during the promotion and then shuffled with the queen to A8
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Position Legally Reachable?

Post by Robert Pope »

But there is no way a black pawn could have gotten to rank 1 to promote without capturing something.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Position Legally Reachable?

Post by Lyudmil Tsvetkov »

[d]rnbqkbnr/pppppppp/8/8/7P/3P3P/PPPP3P/RNBQKBNR w KQkq - 0 1

for Fritz Gui this is perfectly legal position.
also for SF.

SF says: -1.43. :(