Deduce equivalent states, etc. More...
Functions | |
bitset_t | MaximumProofSet (const HexBoard &brd, HexColor toPlay) |
Compute the maximum possible proof. | |
bitset_t | InitialProofForOpponent (const HexBoard &brd, HexColor toPlay) |
The proof for a losing state is the union the proofs for each move. | |
bool | ShrinkProof (bitset_t &proof, const StoneBoard &board, HexColor loser, const ICEngine &ice) |
Gives all cells outside of the proof to loser, computes fillin using ice, removes any cell in proof that is filled-in. | |
template<class HASH , class DB , class DATA > | |
int | StoreTranspositions (SolverDB< HASH, DB, DATA > &db, const DATA &data, const HexState &state, const bitset_t &proof, HexColor winner) |
Computes and stores in db the transpostions of this proof on the given boardstate. | |
template<class HASH , class DB , class DATA > | |
int | StoreFlippedStates (SolverDB< HASH, DB, DATA > &db, const DATA &data, const HexState &state, const bitset_t &proof, HexColor winner) |
Computes and stores in db the flipped transpostions of this proof on the given boardstate. |
Deduce equivalent states, etc.
The proof for a losing state is the union the proofs for each move.
This function returns the proof defined by all opponent semi-connctions as well as any ice deductions.
Definition at line 24 of file ProofUtil.cpp.
References HexBoard::Builder(), HexPointUtil::colorEdge1(), HexPointUtil::colorEdge2(), HexBoard::Cons(), InferiorCells::DeductionSet(), VCList::getGreedyUnion(), HexBoard::GetInferiorCells(), VCSet::GetList(), StoneBoard::GetPlayed(), HexBoard::GetPosition(), VCList::getUnion(), InferiorCells::Killers(), VCBuilder::Parameters(), InferiorCells::Reversers(), InferiorCells::Reversible(), VC::SEMI, benzene_bitset< _Nb >::set(), VCBuilderParam::use_greedy_union, and InferiorCells::Vulnerable().
Referenced by DfsSolver::OrderMoves(), and DfsSolver::SolveInteriorState().
Compute the maximum possible proof.
Definition at line 17 of file ProofUtil.cpp.
References InferiorCells::DeductionSet(), StoneBoard::GetEmpty(), HexBoard::GetInferiorCells(), StoneBoard::GetPlayed(), and HexBoard::GetPosition().
Referenced by DfsSolver::HandleLeafNode(), DfpnSolver::MID(), DfsSolver::OrderMoves(), and DfsSolver::Solve().
bool ProofUtil::ShrinkProof | ( | bitset_t & | proof, | |
const StoneBoard & | board, | |||
HexColor | loser, | |||
const ICEngine & | ice | |||
) |
Gives all cells outside of the proof to loser, computes fillin using ice, removes any cell in proof that is filled-in.
Returns true if proof was shrunk.
Referenced by DfsSolver::HandleProof().
int ProofUtil::StoreFlippedStates | ( | SolverDB< HASH, DB, DATA > & | db, | |
const DATA & | data, | |||
const HexState & | state, | |||
const bitset_t & | proof, | |||
HexColor | winner | |||
) | [inline] |
Computes and stores in db the flipped transpostions of this proof on the given boardstate.
Returns number of db entries successfully added or updated.
Definition at line 122 of file ProofUtil.hpp.
References BLACK, HexAssert, BitsetUtil::IsSubsetOf(), BoardUtils::Mirror(), SolverDataFlags::MIRROR_TRANSPOSITION, benzene_bitset< _Nb >::none(), HexState::Position(), SolverDB< HASH, DB, DATA >::Put(), HexState::ToPlay(), SolverDataFlags::TRANSPOSITION, and WHITE.
Referenced by DfsSolver::StoreState().
int ProofUtil::StoreTranspositions | ( | SolverDB< HASH, DB, DATA > & | db, | |
const DATA & | data, | |||
const HexState & | state, | |||
const bitset_t & | proof, | |||
HexColor | winner | |||
) | [inline] |
Computes and stores in db the transpostions of this proof on the given boardstate.
Returns number of db entries successfully added or updated.
Definition at line 59 of file ProofUtil.hpp.
References BitsetUtil::BitsetToVector(), BLACK, StoneBoard::Hash(), HexAssert, StoneBoard::PlayMove(), HexState::Position(), SolverDB< HASH, DB, DATA >::Put(), StoneBoard::StartNewGame(), SolverDataFlags::TRANSPOSITION, and WHITE.
Referenced by DfsSolver::StoreState().