osl::checkmate::ProofDisproof Class Reference

証明数(proof number)と反証数(disproof number). More...

`#include <proofDisproof.h>`

## Public Types

enum | { PROOF_SHIFT = 32 , DISPROOF_MASK = 0xffffffffu , PROOF_MAX = (0xffffffffu / 16) , DISPROOF_MAX = (0xffffffffu / 16) , NO_ESCAPE_DISPROOF = (DISPROOF_MAX - 1) , CHECK_MATE_DISPROOF = (DISPROOF_MAX - 2) , NO_CHECK_MATE_PROOF = (PROOF_MAX - 1) , PAWN_CHECK_MATE_PROOF = (PROOF_MAX - 2) , LOOP_DETECTION_PROOF = (PROOF_MAX - 3) , ATTACK_BACK_PROOF = (PROOF_MAX - 4) }
enum | { DISPROOF_LIMIT = (DISPROOF_MAX - 3) , PROOF_LIMIT = (PROOF_MAX - 5) }

## Public Member Functions

| ProofDisproof ()
| ProofDisproof (unsigned int proof, unsigned int disproof)
unsigned int | proof () const
unsigned int | disproof () const
bool | isCheckmateSuccess () const
bool | isCheckmateFail () const
bool | isFinal () const
bool | isUnknown () const
bool | isPawnDropFoul (Move move) const
| 打歩詰めなら真
bool | isLoopDetection () const
unsigned long long | ulonglongValue () const
bool | isBetterForAttack (const ProofDisproof &r) const
| this が r より攻方に都合が良い時に真
bool | isBetterForDefense (const ProofDisproof &r) const
| this が r より受方に都合が良い時に真
const ProofDisproof & | betterForAttack (const ProofDisproof &r) const
| 攻方に都合が良い方を返す
const ProofDisproof & | betterForDefense (const ProofDisproof &r) const
| 受方に都合が良い方を返す

## Static Public Member Functions

static const ProofDisproof | makeDirect (unsigned long long value)
static const ProofDisproof | NoEscape ()
static const ProofDisproof | Checkmate ()
static const ProofDisproof | NoCheckmate ()
static const ProofDisproof | PawnCheckmate ()
static const ProofDisproof | LoopDetection ()
static const ProofDisproof | AttackBack ()
static const ProofDisproof | Unknown ()
static const ProofDisproof | Bottom ()
| 攻方にも受方にも不都合な仮想的な数

## Static Public Attributes

static const unsigned int | BigProofNumber =PROOF_MAX

## Private Member Functions

| ProofDisproof (unsigned long long value)
| range check をしない private バージョン

## Static Private Member Functions

static void | testConsistency ()
static unsigned long long | compose (unsigned long long proof, unsigned long long disproof)
static const ProofDisproof | make (unsigned int proof, unsigned int disproof)

## Private Attributes

unsigned long long | pdp

## Detailed Description

証明数(proof number)と反証数(disproof number).

詰み局面と確定した時は proofNumber=0 不詰み局面と確定した時は disproofNumber=0

Definition at line 16 of file proofDisproof.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
PROOF_SHIFT |
DISPROOF_MASK |
PROOF_MAX |
DISPROOF_MAX |
NO_ESCAPE_DISPROOF | 反証数の定数: 詰んだ時には，詰の種類の区別に利用
CHECK_MATE_DISPROOF |
NO_CHECK_MATE_PROOF | 証明数の定数: 反証された時には，不詰の種類の区別に利用
PAWN_CHECK_MATE_PROOF |
LOOP_DETECTION_PROOF |
ATTACK_BACK_PROOF |

Definition at line 20 of file proofDisproof.h.

## anonymous enum

anonymous enum

Enumerator
DISPROOF_LIMIT | 通常の反証数の上限
PROOF_LIMIT | 通常の証明数の上限

Definition at line 37 of file proofDisproof.h.

## Constructor & Destructor Documentation

## ProofDisproof() [1/3]

osl::checkmate::ProofDisproof::ProofDisproof | ( | unsigned long long | value | ) |

inline private

range check をしない private バージョン

Definition at line 50 of file proofDisproof.h.

References pdp.

Referenced by AttackBack(), betterForAttack(), betterForDefense(), Bottom(), Checkmate(), isBetterForAttack(), isBetterForDefense(), LoopDetection(), makeDirect(), NoCheckmate(), NoEscape(), PawnCheckmate(), and Unknown().

## ProofDisproof() [2/3]

osl::checkmate::ProofDisproof::ProofDisproof | ( |  | ) |

inline

Definition at line 59 of file proofDisproof.h.

References compose(), and pdp.

Referenced by AttackBack(), Checkmate(), LoopDetection(), make(), makeDirect(), NoCheckmate(), NoEscape(), PawnCheckmate(), and Unknown().

## ProofDisproof() [3/3]

osl::checkmate::ProofDisproof::ProofDisproof | ( | unsigned int | proof,
|  | unsigned int | disproof )

inline

Definition at line 62 of file proofDisproof.h.

References compose(), disproof(), DISPROOF_LIMIT, DISPROOF_MAX, pdp, proof(), PROOF_LIMIT, and PROOF_MAX.

## Member Function Documentation

## AttackBack()

const ProofDisproof osl::checkmate::ProofDisproof::AttackBack | ( |  | ) |

inline static

Definition at line 79 of file proofDisproof.h.

References ATTACK_BACK_PROOF, ProofDisproof(), and ProofDisproof().

Referenced by osl::checkmate::operator<<().

## betterForAttack()

const ProofDisproof & osl::checkmate::ProofDisproof::betterForAttack | ( | const ProofDisproof & | r | ) | const

inline

攻方に都合が良い方を返す

Definition at line 128 of file proofDisproof.h.

References isBetterForAttack(), and ProofDisproof().

## betterForDefense()

const ProofDisproof & osl::checkmate::ProofDisproof::betterForDefense | ( | const ProofDisproof & | r | ) | const

inline

受方に都合が良い方を返す

Definition at line 135 of file proofDisproof.h.

References isBetterForDefense(), and ProofDisproof().

## Bottom()

const ProofDisproof osl::checkmate::ProofDisproof::Bottom | ( |  | ) |

inline static

攻方にも受方にも不都合な仮想的な数

Definition at line 82 of file proofDisproof.h.

References DISPROOF_MAX, make(), PROOF_MAX, and ProofDisproof().

## Checkmate()

const ProofDisproof osl::checkmate::ProofDisproof::Checkmate | ( |  | ) |

inline static

Definition at line 75 of file proofDisproof.h.

References CHECK_MATE_DISPROOF, ProofDisproof(), and ProofDisproof().

Referenced by osl::checkmate::Dfpn::attack(), osl::checkmate::operator<<(), osl::checkmate::Dfpn::proofOracleAttack(), and osl::checkmate::Dfpn::Node::setCheckmateDefense().

## compose()

unsigned long long osl::checkmate::ProofDisproof::compose | ( | unsigned long long | proof,
|  | unsigned long long | disproof )

inline static private

Definition at line 45 of file proofDisproof.h.

References disproof(), proof(), and PROOF_SHIFT.

Referenced by make(), ProofDisproof(), and ProofDisproof().

## disproof()

unsigned int osl::checkmate::ProofDisproof::disproof | ( |  | ) | const

inline

Definition at line 85 of file proofDisproof.h.

References DISPROOF_MASK, and pdp.

Referenced by osl::checkmate::Dfpn::attack(), compose(), osl::checkmate::Dfpn::defense(), isBetterForAttack(), isBetterForDefense(), isCheckmateFail(), make(), osl::checkmate::operator<<(), and ProofDisproof().

## isBetterForAttack()

bool osl::checkmate::ProofDisproof::isBetterForAttack | ( | const ProofDisproof & | r | ) | const

inline

this が r より攻方に都合が良い時に真

Definition at line 106 of file proofDisproof.h.

References disproof(), proof(), and ProofDisproof().

Referenced by betterForAttack().

## isBetterForDefense()

bool osl::checkmate::ProofDisproof::isBetterForDefense | ( | const ProofDisproof & | r | ) | const

inline

this が r より受方に都合が良い時に真

Definition at line 117 of file proofDisproof.h.

References disproof(), proof(), and ProofDisproof().

Referenced by betterForDefense().

## isCheckmateFail()

bool osl::checkmate::ProofDisproof::isCheckmateFail | ( |  | ) | const

inline

Definition at line 87 of file proofDisproof.h.

References disproof().

Referenced by osl::checkmate::Dfpn::attack(), osl::checkmate::Dfpn::defense(), isFinal(), osl::checkmate::Dfpn::proofOracleDefense(), and osl::checkmate::Dfpn::Node::setNoCheckmateDefense().

## isCheckmateSuccess()

bool osl::checkmate::ProofDisproof::isCheckmateSuccess | ( |  | ) | const

inline

Definition at line 86 of file proofDisproof.h.

References proof().

Referenced by osl::checkmate::Dfpn::attack(), osl::checkmate::Dfpn::blockingSimulation(), osl::checkmate::CheckmateIfCapture::cannotCapture(), osl::checkmate::Dfpn::defense(), osl::checkmate::DualDfpn::findProof(), osl::move_probability::StateInfo::findShortThreatmate(), osl::checkmate::Dfpn::grandParentSimulation(), osl::checkmate::Dfpn::hasCheckmateMove(), isFinal(), osl::checkmate::DualDfpn::isLosingState(), osl::checkmate::DualDfpn::isWinningState(), osl::checkmate::ProofTreeDepthDfpn::orNode(), osl::checkmate::Dfpn::proofOracleAttack(), osl::checkmate::Dfpn::proofOracleDefense(), and osl::checkmate::Dfpn::Node::setCheckmateAttack().

## isFinal()

bool osl::checkmate::ProofDisproof::isFinal | ( |  | ) | const

inline

Definition at line 88 of file proofDisproof.h.

References isCheckmateFail(), and isCheckmateSuccess().

Referenced by osl::checkmate::DualDfpn::findProof(), osl::move_probability::StateInfo::findShortThreatmate(), osl::checkmate::Dfpn::hasCheckmateMove(), isUnknown(), osl::checkmate::DfpnTable::List::probe(), osl::checkmate::DfpnTable::List::store(), and osl::checkmate::Dfpn::tryProofMain().

## isLoopDetection()

bool osl::checkmate::ProofDisproof::isLoopDetection | ( |  | ) | const

inline

Definition at line 97 of file proofDisproof.h.

References LoopDetection(), and pdp.

Referenced by osl::checkmate::DfpnTable::addDag(), osl::checkmate::Dfpn::attack(), osl::checkmate::DualDfpn::findProof(), osl::checkmate::Dfpn::Node::setNoCheckmateDefense(), and osl::checkmate::DfpnTable::store().

## isPawnDropFoul()

bool osl::checkmate::ProofDisproof::isPawnDropFoul | ( | Move | move | ) | const

inline

打歩詰めなら真

Definition at line 92 of file proofDisproof.h.

References osl::Move::isDrop(), osl::Move::isNormal(), NoEscape(), osl::PAWN, pdp, and osl::Move::ptype().

## isUnknown()

bool osl::checkmate::ProofDisproof::isUnknown | ( |  | ) | const

inline

Definition at line 89 of file proofDisproof.h.

References isFinal().

## LoopDetection()

const ProofDisproof osl::checkmate::ProofDisproof::LoopDetection | ( |  | ) |

inline static

Definition at line 78 of file proofDisproof.h.

References LOOP_DETECTION_PROOF, ProofDisproof(), and ProofDisproof().

Referenced by osl::checkmate::Dfpn::attack(), osl::checkmate::DualDfpn::findProof(), osl::checkmate::Dfpn::hasCheckmateMove(), osl::checkmate::Dfpn::hasEscapeMove(), isLoopDetection(), osl::checkmate::operator<<(), and osl::checkmate::Dfpn::tryProofMain().

## make()

const ProofDisproof osl::checkmate::ProofDisproof::make | ( | unsigned int | proof,
|  | unsigned int | disproof )

inline static private

Definition at line 54 of file proofDisproof.h.

References compose(), disproof(), proof(), and ProofDisproof().

Referenced by Bottom().

## makeDirect()

const ProofDisproof osl::checkmate::ProofDisproof::makeDirect | ( | unsigned long long | value | ) |

inline static

Definition at line 71 of file proofDisproof.h.

References ProofDisproof(), and ProofDisproof().

## NoCheckmate()

const ProofDisproof osl::checkmate::ProofDisproof::NoCheckmate | ( |  | ) |

inline static

Definition at line 76 of file proofDisproof.h.

References NO_CHECK_MATE_PROOF, ProofDisproof(), and ProofDisproof().

Referenced by osl::checkmate::Dfpn::attack(), osl::checkmate::Dfpn::hasEscapeMove(), osl::checkmate::operator<<(), osl::checkmate::Dfpn::proofOracleDefense(), and osl::checkmate::Dfpn::setIllegal().

## NoEscape()

const ProofDisproof osl::checkmate::ProofDisproof::NoEscape | ( |  | ) |

inline static

Definition at line 74 of file proofDisproof.h.

References NO_ESCAPE_DISPROOF, ProofDisproof(), and ProofDisproof().

Referenced by osl::checkmate::Dfpn::attack(), osl::checkmate::Dfpn::defense(), osl::checkmate::Dfpn::hasEscapeMove(), isPawnDropFoul(), osl::checkmate::operator<<(), osl::checkmate::Dfpn::proofOracleAttack(), and osl::checkmate::Dfpn::proofOracleDefense().

## PawnCheckmate()

const ProofDisproof osl::checkmate::ProofDisproof::PawnCheckmate | ( |  | ) |

inline static

Definition at line 77 of file proofDisproof.h.

References PAWN_CHECK_MATE_PROOF, ProofDisproof(), and ProofDisproof().

Referenced by osl::checkmate::Dfpn::attack(), osl::checkmate::Dfpn::hasEscapeMove(), osl::checkmate::operator<<(), and osl::checkmate::Dfpn::proofOracleAttack().

## proof()

unsigned int osl::checkmate::ProofDisproof::proof | ( |  | ) | const

inline

Definition at line 84 of file proofDisproof.h.

References pdp, and PROOF_SHIFT.

Referenced by osl::checkmate::Dfpn::attack(), osl::checkmate::Dfpn::blockingSimulation(), compose(), osl::checkmate::Dfpn::defense(), osl::checkmate::Dfpn::grandParentSimulation(), isBetterForAttack(), isBetterForDefense(), isCheckmateSuccess(), make(), osl::checkmate::operator<<(), and ProofDisproof().

## testConsistency()

void osl::checkmate::ProofDisproof::testConsistency | ( |  | ) |

static private

Definition at line 4 of file proofDisproof.cc.

References BigProofNumber, NO_CHECK_MATE_PROOF, and PAWN_CHECK_MATE_PROOF.

## ulonglongValue()

unsigned long long osl::checkmate::ProofDisproof::ulonglongValue | ( |  | ) | const

inline

Definition at line 99 of file proofDisproof.h.

References pdp.

Referenced by osl::checkmate::operator<(), and osl::checkmate::operator==().

## Unknown()

const ProofDisproof osl::checkmate::ProofDisproof::Unknown | ( |  | ) |

inline static

Definition at line 80 of file proofDisproof.h.

References ProofDisproof(), and ProofDisproof().

## Member Data Documentation

## BigProofNumber

const unsigned int osl::checkmate::ProofDisproof::BigProofNumber =PROOF_MAX

static

Definition at line 101 of file proofDisproof.h.

Referenced by testConsistency().

## pdp

unsigned long long osl::checkmate::ProofDisproof::pdp

private

Definition at line 18 of file proofDisproof.h.

Referenced by disproof(), isLoopDetection(), isPawnDropFoul(), proof(), ProofDisproof(), ProofDisproof(), ProofDisproof(), and ulonglongValue().

The documentation for this class was generated from the following files:

- proofDisproof.h
- proofDisproof.cc