Live data from Hacker News

Chess invariants

muratbuffalo.blogspot.com

61–67 of 67 posts

Re: Chess invariants

#61
post #59

Earlier quoted context omitted.

I agree it's hard and non-obvious. If it wasn't then chess would have long been solved by now. Let's start from the other end. Just a pawn and two kings. It's possible to describe some quite succinct rules for when that's a draw versus a win for the side with the pawn. Agreed? Club players know these by heart. You could write that doen as invariants. As long as the side with the pawn stays inside the "green zone" of…

People have done this. They call it tablebases [1]. They’ve computed 7-piece tablebases, but not 8 pieces. ”After the completion of the 7-man, some people were curious about the feasibility of building the 8-man. Ronald de Man estimated that without modifying much the generator, the task requires computers with 64 TB RAM and 2000 TB hard disks[10] (cost about $640K and $40K respectively in 2020). The generator can be…

Like your sibling comment, you seem to be missing my point. Tablebases are fundamentally enumerating positions explicitly even though they use lots of tricks to make that more efficient. I'm talking about foregoing that entirely.

Re: Chess invariants

#62

I can't wait to show this to my manager next time he asks why it's taking three weeks to build a simple CRUD app. "Look, if this guys TLA+ logic struggles to model a 1,500-year-old game without crying over a French pawn-capture rule, you can't expect me to integrate Stripe billing without a few state invariant violations."

Payments have a gargantuan amount of possible transitions and invariants that are far from trivial to encode.

I showed this to my manager and his response was: "So... three days?"

Re: Chess invariants

#63

> Chess is a lot trickier than it looks. It has so many rules: castling, en passant, pawn promotion, pinning, the discovered check, and the deadlock case of stalemate. As a kid playing chess with other neighborhood kids back in the day, absolutely none of us even knew about the en passant rule. My first exposure around the same time was completely by accident thanks to a passing reference in a CRPG called Betrayal at…

A lot of adult players don’t know it either.

If I play a casual game with someone who doesn’t know about en passant and they make a move that opens them up to it, I don’t attempt to take the piece, but I do point it out to them and recommend we use the rule in future games.

Re: Chess invariants

#64

Earlier quoted context omitted.

The only way to put yourself in check is by moving.

You can put yourself in check by moving the king. That has nothing to do with pinning. Adding a rule for pinning is redundant.

It isn’t an added rule for pinning. It’s the only rule about putting yourself in check.

Re: Chess invariants

#65
post #3

> Chess is a lot trickier than it looks. It has so many rules: castling, en passant, pawn promotion, pinning, the discovered check, and the deadlock case of stalemate. Nit: Pinning and the discovered check are not really rules, but rather names of tactics.

Well, if a piece is pinned it's illegal to move it. Rule 3.9.2: No piece can be moved that will either expose the king of the same colour to check or leave that king in check.

Well, a minor piece can be pinned in front of a queen. It would be legal to move the minor piece in that case, but you'd most likely lose the game if both sides' material were even before the move. Pinning is a tactic, not a rule.

Re: Chess invariants

#66
post #43

Earlier quoted context omitted.

doubtful, or at least not useful ones. Like, you could describe some invariant along the lines of "the position is winning for the side-to-move, iff there exists move, such that position' := ApplyMove(position, move) is losing for the (now other) side-to-move". But that's just restating minimax algorithm that people have known for 50 years. As someone dabbling abit around chess engine development, I'm very often impr…

I agree it's hard and non-obvious. If it wasn't then chess would have long been solved by now. Let's start from the other end. Just a pawn and two kings. It's possible to describe some quite succinct rules for when that's a draw versus a win for the side with the pawn. Agreed? Club players know these by heart. You could write that doen as invariants. As long as the side with the pawn stays inside the "green zone" of…

> Let's start from the other end. Just a pawn and two kings. It's possible to describe some quite succinct rules for when that's a draw versus a win for the side with the pawn. Agreed? Club players know these by heart. You could write that doen as invariants. As long as the side with the pawn stays inside the "green zone" of the state space, there is nothing the other side can do to void mate.

The flaw in this line of reasoning is that it's easy to come up with a theorem that works for KP vs K. However as the number of pieces increases, it becomes impossible to distill all the branches of possible moves into a simple theorem like that. If what you said were possible, endgame would be a simple flowchart, but look at how much time even GM players use in endgame and how often mistakes are made, and you'll recognize Chess endgame is not distillable into a simple flowchart when there are even as few as 7 pieces on the board.

Given the above, the only option is enumeration, if you want to prove that in all cases the outcome is White win or draw.

Re: Chess invariants

#67

The historical rules also left ambiguous promotion to the opposite color: https://chess.stackexchange.com/questions/8291/pawn-promotio... . This rule was clarified later to restrict to the same color.

> The player’s choice is not restricted to pieces that have been captured previously I grew up playing chess but my grandfather always insisted that pawns could only be promoted to captured pieces so when I played him we had to play a that variant. I suspect this came from players not having extra pieces with their chess sets.

That and just avoiding the obvious advantage of promoting every piece to a queen every time. Puts more constraint on the game which usually makes for more interesting play
Post reply on HN