9 #include "osl/apply_move/applyMoveWithPath.h" 
   19 using namespace osl::ntesuki;
 
   23 template <
class Searcher, Player P>
 
   36                unsigned int pass_left)
 
   37     : searcher(searcher), record_orig(record_orig), pass_left(pass_left)
 
   43     result = (*searcher).template defense<O>(record_orig, pass_left);
 
   47 template <
class Searcher, Player P>
 
   60                 unsigned int pass_left)
 
   61     : searcher(searcher), record_orig(record_orig), pass_left(pass_left)
 
   67     result = (*searcher).template attack<O>(record_orig, pass_left);
 
   82   if (!state.isValidMove(m, 
false)) 
return false;
 
   83   if (m.
isDrop()) 
return true;
 
   96     candidate=setCapture(candidate,p);
 
  110        const unsigned int pass_left)
 
  112   const Player attacker = P;
 
  116       !record_orig->
getValue<attacker>(pass_left)
 
  126   if (!state.inCheck(P) &&
 
  128                                          check_move).isCheckmateSuccess())
 
  142   if ((pass_left > 0) && 
 
  143       record_orig->
getValue<attacker>(pass_left - 1).isCheckmateSuccess())
 
  145     return attack<P>(record_orig, pass_left - 1);
 
  148   const Move move = adjustMove<P>(state, best_move_orig.
move());
 
  151   if (!is_safe_move<P>(state, move, pass_left))
 
  158   if(0 == pass_left && !move_is_check)
 
  164   if (best_move_orig.
isCheck() != move_is_check)
 
  170   const NtesukiRecord* record_child_orig = table.findWithMoveConst(record_orig,
 
  172   if (!record_child_orig)
 
  183   ApplyMoveWithPath<P>::doUndoMove(state, path, move, helper);
 
  186   return helper.result;
 
  191 bool OracleProverLight::
 
  193         const unsigned int pass_left)
 
  199       !record_orig->
getValue<attacker>(pass_left)
 
  206   if (state.inCheck(attacker))
 
  212   if ((pass_left == 0) &&
 
  222     return defense<P>(record_orig, pass_left - 1);
 
  227   mg->generateSlow(P, state, moves);
 
  228   if (moves.empty()) 
return true;
 
  231   for (NtesukiMoveList::iterator move_it = moves.begin();
 
  232        move_it != moves.end(); move_it++)
 
  235     if (isscheme != NtesukiRecord::normal_is &&
 
  236         isscheme != NtesukiRecord::delay_is &&
 
  237         move.
isCheck() && pass_left > 0) 
continue;
 
  241     const NtesukiRecord *record_child_orig = table.findWithMoveConst(record_orig, move);
 
  242     if (!record_child_orig ||
 
  243         !record_child_orig->getValue<attacker>(pass_left).isCheckmateSuccess())
 
  248     int pass_left_child = pass_left;
 
  249     if (move.
isPass()) --pass_left_child;
 
  252     ApplyMoveWithPath<P>::doUndoMoveOrPass(state, path, move.
move(), helper);
 
  254     if (
false == helper.result) 
return false;
 
  267                 const unsigned int pass_left)
 
  269   const Player attacker = P;
 
  270   if (!record || !record_orig) 
return false;
 
  280   if (attack<P>(record_orig, pass_left))
 
  304                  const unsigned int pass_left)
 
  307   if (!record || !record_orig) 
return false;
 
  317   if (defense<P>(record_orig, pass_left))