Answers.Body: <p>I don't know if any such tool exists. If you want to program yourself you need to watch out for:</p>
  
  <p><strong>Change of mating theme</strong>: If you remove pieces you might get new/different mates, e.g. in:</p>
  
  <pre><code>    6rk/5Npp/8/8/8/8/2K5/7R b - - 0 1
  </code></pre>
  
  <p>if you remove the white knight and the black pawn on h7 you have a new mate, which might not be desirable.</p>
  
  <p><strong>Impossible positions</strong>: If you remove pieces you might end up with positions that cannot be reached in normal play. This can be as easy as positions where three pieces attack the king at the same time, but it can also be a lot more difficult. So in addition to checking for mate, you also need to run some <em>retrograde analysis</em> to check whether the position is legal</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T10:14:12.270Z
Answers.LastActivityDate: 2016-12-13T10:14:12.270Z
Answers.UserDisplayName: user1583209
Answers.Body: <p>If I understand you correctly, you want to automatically simplify the mating sequence (final position minus a couple of moves) basically keeping the same mating pattern.</p>
  
  <p>I think doing this automatically will be very difficult because if you remove pieces all kind of things can happen:</p>
  
  <ul>
  <li><p>additional sidelines (loss of quality)</p></li>
  <li><p>change of the theme of the mating pattern</p>
  
  <p>... and if you don't run an engine to compare original mating sequences with simplified ones, you are in even more trouble...</p></li>
  </ul>
  
  <p>BTW, are you sure that all the mates in your collection are forced and that the moves played are best play from both sides?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-25T20:10:22.300Z
Answers.Text: Thank you for your quick answer.
  In fact, all my FEN are final checkmated positions, so nothing to do with "mate in N" puzzles.
  And I just want to remove all unecessary pieces, so I need to verify, using an automatic/batch method
Answers.UserDisplayName: TiLapiot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-25T20:13:04.947Z
Answers.Text: So you only care about the final position?
Answers.UserDisplayName: user1583209
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-25T20:35:14.860Z
Answers.Text: Yes :)
  ...Only final position matters, where I'd like to remove all "superfluous" pieces.
  
  So :
  - if I remove too much pieces, there is no more checkmate 
  - if I let some useless pieces (i.e. not involved in direct checkmate), then the theme is not clean enough.
  
  That's why I need to remove *all* needless pieces, one by one, then check for still-a-checkmate, 
  Simpliflying+verification must be done automatically, using any trick (software, engine, batch, etc)
  
  That's what I search...
Answers.UserDisplayName: TiLapiot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-25T23:33:13.780Z
Answers.Text: It is more difficult than checking for checkmate. You'd also need to check whether it is not an impossible position (retrograde analysis)
Answers.UserDisplayName: user1583209
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-25T16:57:45.653Z
Answers.LastActivityDate: 2016-11-25T17:13:41.470Z
Answers.LastEditDate: 2016-11-25T17:13:41.470Z
Answers.UserDisplayName: user1583209
Body: <p>I have a collection of checkmated chess positions, in FEN/EPD format.
  Most of the time, each of these positions contains some <em>useless</em> pieces, that I really want to remove, in the aim of getting cleaner schemes.</p>
  
  <p>Then, I'm searching for a batch possibility to check if my whole chess collection is checkmate or not. Ideally, it would be a tool/solution using DOS/CMD, because I have to clean many FEN checkmates.</p>
  
  <p>I've googled for various DOS chess tools, but in vain. I also searched to use some chess engines (under cmd), Arena/WinBoard, EPD2Diag, PGN-Extract, etc. but also without success.</p>
  
  <p>Here are two examples:</p>
  
  <pre><code>[FEN "3q4/6b1/4k3/4r3/3p2Q1/B1N1R3/5R2/6K1 w - - 0 1"]
  </code></pre>
  
  <p></p>
  
  <pre><code>[FEN "1K6/1b6/1b6/1P6/7r/7p/7Q/4qN1k w - - 0 1"]
  </code></pre>
  
  <p>Here, it's obviously both checkmate for White, but knowing I have few hundreds of others, how can I get a DOS batch possibility to check all in once?</p>
  
Tags: <checkmate><evaluation><fen>
Title: How to determine checkmated positions using DOS/CMD, from numerous FEN/EPD chess positions?
ThreadText: # How to determine checkmated positions using DOS/CMD, from numerous FEN/EPD chess positions?
  
  (Asked by: username_0 on 2016-11-25)
  
  I have a collection of checkmated chess positions, in FEN/EPD format.
  Most of the time, each of these positions contains some *useless* pieces, that I really want to remove, in the aim of getting cleaner schemes.
  
  Then, I'm searching for a batch possibility to check if my whole chess collection is checkmate or not. Ideally, it would be a tool/solution using DOS/CMD, because I have to clean many FEN checkmates.
  
  I've googled for various DOS chess tools, but in vain. I also searched to use some chess engines (under cmd), Arena/WinBoard, EPD2Diag, PGN-Extract, etc. but also without success.
  
  Here are two examples:
  
  ```
  [FEN "3q4/6b1/4k3/4r3/3p2Q1/B1N1R3/5R2/6K1 w - - 0 1"]
  
  ```
  
  ```
  [FEN "1K6/1b6/1b6/1P6/7r/7p/7Q/4qN1k w - - 0 1"]
  
  ```
  
  Here, it's obviously both checkmate for White, but knowing I have few hundreds of others, how can I get a DOS batch possibility to check all in once?
  
  **Tags:** checkmate, evaluation, fen
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-12-13. Score: 2
  
  I don't know if any such tool exists. If you want to program yourself you need to watch out for:
  
  **Change of mating theme**: If you remove pieces you might get new/different mates, e.g. in:
  
  ```
      6rk/5Npp/8/8/8/8/2K5/7R b - - 0 1
  
  ```
  
  if you remove the white knight and the black pawn on h7 you have a new mate, which might not be desirable.
  
  **Impossible positions**: If you remove pieces you might end up with positions that cannot be reached in normal play. This can be as easy as positions where three pieces attack the king at the same time, but it can also be a lot more difficult. So in addition to checking for mate, you also need to run some *retrograde analysis* to check whether the position is legal
  
  
  ---
  
  ### Answer by username_1 on 2016-11-25. Score: 1
  
  If I understand you correctly, you want to automatically simplify the mating sequence (final position minus a couple of moves) basically keeping the same mating pattern.
  
  I think doing this automatically will be very difficult because if you remove pieces all kind of things can happen:
  
  * additional sidelines (loss of quality)
  * change of the theme of the mating pattern
  
    ... and if you don't run an engine to compare original mating sequences with simplified ones, you are in even more trouble...
  
  BTW, are you sure that all the mates in your collection are forced and that the moves played are best play from both sides?
  
  > **Comments:**
  > **username_0**: Thank you for your quick answer. In fact, all my FEN are final checkmated positions, so nothing to do with "mate in N" puzzles. And I just want to remove all unecessary pieces, so I need to verify, using an automatic/batch method  
  > **username_1**: So you only care about the final position?  
  > **username_0**: Yes :) ...Only final position matters, where I'd like to remove all "superfluous" pieces.  So : - if I remove too much pieces, there is no more checkmate  - if I let some useless pieces (i.e. not involved in direct checkmate), then the theme is not clean enough.  That's why I need to remove *all* needless pieces, one by one, then check for still-a-checkmate,  Simpliflying+verification must be done automatically, using any trick (software, engine, batch, etc)  That's what I search...  
  > **username_1**: It is more difficult than checking for checkmate. You'd also need to check whether it is not an impossible position (retrograde analysis)  
  
  ---
  
  