thomas-maeder / popeye

Popeye is a chess problem solving and testing software with strong support for fairy chess and heterodox genres. For more information cf. topic "Popeye (chess)" on http://en.wikipedia.org/
31 stars 14 forks source link

AntiCirce Cage is not working #254

Closed vlaicu closed 3 years ago

vlaicu commented 5 years ago

Popeye seems to enter in an infinite loop when solving AntiCirce Cage problems.

For instance, when I entered the Homebase position with the stipulation H#2, it doesn't go further the first move (1.a5). The (unique) solution is 1.d4 e5 2.Be3 e:d4(>d2)# (discovered by me and Eric Huber).

In order to understand properly this fairy condition, please use the following input (composed by me): BeginProblem Pieces White Pa7 Pe7 Kf1 Black Ka8 Pg3 Pg2 Stipulation H#2 Condition AntiCirce Cage EndProblem

The intended solution is: 1.g2-g1=S! e7-e8=B 2.g3-g2 Be8-c6#

The white King is not initially in check, because the promoted black figure has no cage where to be placed. Please be aware of the following tries, which explain the subtleties of the genre: 1.g2-g1=R?? ... 3.Rg1-h1! and the no cage for the wB. 1.g2-g1=B?? ... 3.Bg1:a7(>Bh1) and again no cage for the wB. 1.Ka8-b7+ e7-e8=B?? illegal because Black can play 2.g2:f1=B(>Ba8)!

The full definition of the genre (according to Paul Raican) is given below: Anti Cage Circe (type Calvet)

  1. On making a capture, the capturing unit (including King) is reborn as in Cage Circe renaissances. The captured unit disappears, as in normal chess.
  2. When there are more than one cage, the side making the capture chooses the rebirth square from the available cages.
  3. Since rebirth is obligatory, a capture is legal only if the capturing unit may find a cage. A capture may be made either from or on a cage.
  4. Promotion with capture is legal provided the promoted unit may find a rebirth cage.
  5. White pawns may reborn on the 1st row, from which they can move like ordinary pawns, including making a double step from the second row. Same for black pawns.
  6. White pawns may also reborn as promoted pieces on the last row. In such case, the rebirth square must be a cage for the promoted piece, the type of which is chosen by the side making the capture. Same for black pawns.
  7. A King may capture only if he can find a rebirth cage unguarded; however, he may threaten to capture the opposing King even when this cage is guarded. This introduces an additional way of answering a check, by spoiling the cage where the checking piece would be replaced.
  8. Captures, in which the capturing piece lands on a cage square, are allowed.
  9. A replaced Rook, King (or Rook and King) may be used for castling, provided the usual castling rules are satisfied.
thomas-maeder commented 3 years ago

Fixed for 4.87

The h#2 problem given above has only the given intended solution.

There were two bugs to be fixed: