side question, which CS class(es) teach about invariants?
There’s a book called Logic for Programmers: https://leanpub.com/logic#table-of-contents
31–40 of 67 posts
side question, which CS class(es) teach about invariants?
There’s a book called Logic for Programmers: https://leanpub.com/logic#table-of-contents
Earlier quoted context omitted.
Did you mean putting your opponent in check? In chess, you are not allowed to put yourself in check.
You said “ That's a consequence of not being allowed to put yourself in check (by any means).” My point is that there are no other means.
I was pointing out that that specific rule (read to mean that moving a piece pinned against a king is not allow) is not strictly necessary. Putting oneself in check is not allowed regardless of whether it's because you moved a piece that was pinned against your king or moved your king directly into the line of sight of an opponent's piece. These are the different "means."
As a sibling comment points out, "The only action you can ever take in chess is moving," so it's not particularly meaningful to say that the only way to put yourself in check is by moving.
Anyone know what language is being used in the blogpost?
TLA+ i think
Earlier quoted context omitted.
You said “ That's a consequence of not being allowed to put yourself in check (by any means).” My point is that there are no other means.
I was replying to a comment quoting an official rule saying "no piece can be moved if that exposes or leaves its own king in check." I was pointing out that that specific rule (read to mean that moving a piece pinned against a king is not allow) is not strictly necessary. Putting oneself in check is not allowed regardless of whether it's because you moved a piece that was pinned against your king or moved your king d…
The rule, "3.9.2: no piece can be moved if that exposes or leaves its own king in check." covers both the case of moving a pinned piece as well as moving the king into check, i.e. it covers all "means" of putting yourself into check.
Screenshots of code? In 2026?...
side question, which CS class(es) teach about invariants?
Earlier quoted context omitted.
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.
The point is that, logically, the first part of that rule (“expose the king”) is implied by the second part (“leave that king”), so the first part is redundant. You could simplify the rule to: No piece can be moved that will leave the king of the same color in check.
Earlier quoted context omitted.
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.
The point is that, logically, the first part of that rule (“expose the king”) is implied by the second part (“leave that king”), so the first part is redundant. You could simplify the rule to: No piece can be moved that will leave the king of the same color in check.
While we're being pedantic though it's not a property of the piece that might be able to be moved that will place the king in check. It's a property of the move. For example we might imagine you have a rook between an enemy rook and your king. You can move the rook along the line between the enemy rook and the king, but not perpendicular to it.
The rule should be:
No move can be made where the moving players king is in check in the resulting position