game-tree- Searching game trees with alpha-beta pruning



Nodes in game trees Copyright 2009 Colin Adams

This file is part of game-tree.

Game-tree is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.



class Game_tree a whereSource

Nodes in a game search tree


is_terminal :: a -> BoolSource

Is this a game-terminating node (e.g. checkmate)?

Law: is_terminal n == (children n == [])

node_value :: a -> IntSource

Heuristic value of node

Returned value must line in the (inclusive) range (minBound + 4, maxBound - 3) Needs to be sensitive to whose turn it is to move. I.e. it must return values of the opposite sign if the other player is to move.

children :: a -> [a]Source

Child nodes in the game tree (positions more deeply searched)