Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::AdversarialGameDomain Concept Reference

Minimal contract for alternating-turn zero-sum games. More...

#include <Negamax.H>

Concept definition

template<typename Domain>
and requires(Domain &domain, typename Domain::State &state, const typename Domain::Move &move) {
{ domain.apply(state, move) } -> std::same_as<void>;
{ domain.undo(state, move) } -> std::same_as<void>;
}
Minimal contract for alternating-turn zero-sum games.
Definition Negamax.H:408
Required evaluator contract for zero-sum games.
Definition Negamax.H:380
Minimal requirement for search moves.
Minimal requirement for mutable search states.
Concept for lazy successor generation.
and
Check uniqueness with explicit hash + equality functors.
@ Domain
Preserve the order emitted by for_each_successor().

Detailed Description

Minimal contract for alternating-turn zero-sum games.

A game domain must:

  • expose nested State, Move and Score types,
  • lazily generate legal moves through for_each_successor(),
  • mutate the current state with apply() / undo(),
  • recognize terminal positions with is_terminal(),
  • evaluate any state with evaluate(), always from the current player's perspective.
Precondition
evaluate(state) returns values in [score_floor<Score>(), score_ceiling<Score>()]. The internal sentinel std::numeric_limits<Score>::lowest() is reserved by the engine and maps to std::numeric_limits<Score>::max() when negated.

The engine assumes apply() / undo() switch turns implicitly through the state itself; no separate player parameter is carried by the search code.

Definition at line 407 of file Negamax.H.