Combinatorial games from a type of states #
In the literature, mathematicians often describe games as graphs, consisting of a set of states, as
well as move relations for the left and right players. We define a structure GameGraph which
facilitates this construction, bundling the left and right set functions along with the type, as
well as functions GameGraph.toLGame and GameGraph.toIGame which turn them into the appropriate
type of game.
Mathematically, GameGraph.toLGame is nothing but the corecursor on loopy games, while
GameGraph.toIGame is defined inductively.
Design notes #
When working with any "specific" game (nim, domineering, etc.) you can use GameGraph to set up
the basic theorems and definitions, but the intent is that you're not working with GameGraph
directly most of the time.
A game graph is a type of states endowed with move sets for the left and right players.
You can use GameGraph.toLGame and GameGraph.toIGame to turn this structure into the
appropriate game type.
The sets of options for the players.
Instances For
Loopy games #
Turns a state of a GameGraph into an LGame.
Equations
- c.toLGame a = LGame.corec c.moves a
Instances For
Well-founded games #
Conway recursion: build data for a game by recursively building it on its left and right sets.
Equations
Instances For
Turns a state of a GameGraph into an IGame.