| 1 |
/* oracleProverLight.h |
| 2 |
*/ |
| 3 |
#ifndef _ORACLEPROVERLIGHT_H |
| 4 |
#define _ORACLEPROVERLIGHT_H |
| 5 |
|
| 6 |
#include "proofOracle.h" |
| 7 |
#include "osl/checkmate/fixedDepthSearcher.h" |
| 8 |
#include "osl/state/numEffectState.h" |
| 9 |
#include "osl/player.h" |
| 10 |
namespace osl |
| 11 |
{ |
| 12 |
namespace checkmate |
| 13 |
{ |
| 14 |
/** |
| 15 |
* 表を使わない OracleProver |
| 16 |
*/ |
| 17 |
template <Player Attacker> |
| 18 |
class OracleProverLight |
| 19 |
{ |
| 20 |
public: |
| 21 |
typedef NumEffectState state_t; |
| 22 |
private: |
| 23 |
state_t *state; |
| 24 |
FixedDepthSearcher fixed_searcher; |
| 25 |
int node_count; |
| 26 |
Move best_move; |
| 27 |
public: |
| 28 |
OracleProverLight() : node_count(0) |
| 29 |
{ |
| 30 |
} |
| 31 |
typedef ProofOracleAttack<Attacker> attack_oracle_t; |
| 32 |
typedef ProofOracleDefense<Attacker> defense_oracle_t; |
| 33 |
/** |
| 34 |
* oracle に基づき詰められるかどうかを判定する |
| 35 |
* @param best_move 詰む場合に詰ます手で上書きする |
| 36 |
*/ |
| 37 |
bool proofWin(state_t& state, attack_oracle_t oracle, |
| 38 |
Move& best_move); |
| 39 |
/** |
| 40 |
* oracle に基づき詰んでいるかどうかを判定する |
| 41 |
* @param state に alt(Attacker) に対して王手がかかっていること |
| 42 |
*/ |
| 43 |
bool proofLose(state_t& state, defense_oracle_t oracle, |
| 44 |
Move last_move=Move::INVALID()); |
| 45 |
|
| 46 |
int nodeCount() const { return node_count; } |
| 47 |
|
| 48 |
// private: |
| 49 |
const ProofDisproof attack(attack_oracle_t oracle); |
| 50 |
const ProofDisproof defense(defense_oracle_t oracle); |
| 51 |
}; |
| 52 |
|
| 53 |
} // namespace checkmate |
| 54 |
} // namespace osl |
| 55 |
|
| 56 |
#endif /* _ORACLEPROVERLIGHT_H */ |
| 57 |
// ;;; Local Variables: |
| 58 |
// ;;; mode:c++ |
| 59 |
// ;;; c-basic-offset:2 |
| 60 |
// ;;; End: |