3#ifndef OSL_CHECKMATE_PROOF_NUMBER_TABLE_H
4#define OSL_CHECKMATE_PROOF_NUMBER_TABLE_H
52 assert((d !=
UUL) && (d !=
UUR));
53 assert(liberty_mask <= 0xff);
67 const unsigned int liberty_mask = info.
liberty();
78 const unsigned int liberty_mask = info.
liberty();
83 if (to + offset + offset != king)
87 else if (ptype !=
LANCE)
109 return std::max(1,liberty_count + state.
countEffect(defense, to));
116 return std::max(liberty_count-1,1);
const Offset getShortOffsetNotKnight(Offset32 offset32) const
Longの利きの可能性のあるoffsetの場合は, 反復に使う offsetを Knight以外のShortの利きのoffsetの場合はそれ自身を返す.
Direction getLongDirection(Offset32 offset32) const
Direction getShort8(Square from, Square to) const
int countEffect(Player player, Square target) const
利きの数を数える.
unsigned int index() const
bool isNeighboring8(Square to) const
const King8Info resetEdgeFromLiberty(Player king_player, Square king, King8Info info) const
liberty から盤の淵(xかyが1か9)を取り除く.
CArray2d< uint64_t, 2, Square::SIZE > edge_mask
uint64_t uint64Value() const
unsigned int liberty() const
8-15 bit 目を 0-7bitにshiftして返す
証明数(proof number)と反証数(disproof number).
int libertyAfterAllDrop(const NumEffectState &state) const
drop のみ
const ProofDisproof attackEstimation(const NumEffectState &state) const
全て
CArray2d< uint8_t, 0x100u, 0x100u > pmajor_liberty
龍や馬で王手をかけられる時のliberty: [liberty][move_mask]
int disproofAfterAllCheck(const NumEffectState &, Player, King8Info) const
CArray2d< uint8_t, 0x10000u, 8 > drop_liberty
全ての有効drop -> 最小liberty.
CArray2d< uint8_t, 0x100u, 0x100u > promote_liberty
王が1,2段目にいる時の移動王手によるliberty: [liberty][move_mask].
const Liberty countLibertyLong(Player player, Square to, Ptype ptype, Square king, King8Info info) const
int libertyAfterAllMove(const NumEffectState &state) const
移動 のみ
int libertyAfterAllCheck(const NumEffectState &state) const
全て
CArray2d< CArray< Liberty, DIRECTION_SIZE >, 0x100u, PTYPE_SIZE > liberties
一つの王手 -> Liberty: long なdirection は1マスあけた王手を意味する
CArray2d< uint8_t, 0x100u, 0x100u > other_move_liberty
それ以外の移動liberty: [liberty][move_mask]
const Liberty countLiberty(Ptype ptype, Direction d, unsigned int liberty_mask) const
dir 方向からの王手をかけた時のlibertyの予想
int countLiberty(const NumEffectState &state, int liberty_count, Move move, Square king, King8Info info) const
move は王手である必要がある
const Liberty countLibertyShortNotKnight(Player player, Square to, Ptype ptype, Square king, King8Info info) const
8近傍へのdropまたは取れない移動後のlibertyの予測値を返す.
ProofNumberTable Proof_Number_Table
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す
const BoardTable Board_Table
const PtypeO PTYPEO_EDGE __attribute__((unused))
bool isMajor(Ptype ptype)
constexpr bool isLong(Direction d)
constexpr Player alt(Player player)
uint8_t liberty
玉の自由度の予測値.
Liberty(uint8_t l=0, bool e=false)
bool has_effect
false の場合は必ず空き王手
static bool hasEffect(const NumEffectState &, Square target, Player attack)
target に attack の追加利きが一つでもあるか. 相手の影利きが先にある場合は対象としない.
static int countBit(Integer mask)