The first part of this series introduced the maximizing and minimizing orders on finite antichains in any partially ordered set . In this second part I will show how these orders and their properties are used to define evaluation functions on game trees. The previous post was mainly based on the paper “Searching game trees under a partial order” by P. Dasgupta et al. In this second post I will show how it is related to another paper “Alpha-Beta pruning under partial orders” by M. Ginsberg et al from 2001. This second paper has an interesting different approach. Instead of starting with a partial order from the beginning it investigates what structure an evaluation function on a game tree must have to satisfy some reasonable constraints. The answer they find is that such an evaluation function must be defined on a *lattice*, that is, a set with operators “greatest lower bound” and “least upper bound” . An evaluation function is then defined recursively, starting at the leaves. The minimizing player combines the values of subnodes with while the maximizing player uses . Moreover, Ginsberg et al show that such an evaluation function allows alpha beta pruning (which I will define in detail in the next post) exactly if the lattice is *distributive*. While the paper by Ginsberg references that of Dasgupta the relation between the two is not made very explicit. This post will give a very precise and (I think) satisfying relation between the two papers ultimately improving the results of both: The work of Dasgupta is formalized in terms of lattice theory and can now be applied to *any* partially ordered set, not just and the result of Ginsberg on alpha beta pruning is sharpened in the next post, potentially leading to more aggressive pruning in game tree searches.

Consider a game tree in which a min and max player make moves in turn. Suppose that leaf nodes in this tree get a value in the partially ordered space assigned to them. Is there a way, given the values at the leaves, to define an evaluation function on the entire tree? Let’s first assume that both players in fact use an (unspecified) linear extension of the partial order to select their optimal move. (Dasgupta et al call such a linear extension a *strategy*. See the intermezzo below for why it is fair to assume that both players use the *same* strategy.) Here is an example how this linear extension can be used to define an evaluation function on a tree of positions. The symbols “” at the leaf nodes indicate some (not necessarily equal) values in . The greatest lower bound and least upper bound and are taken with respect to the linear extension .

In this example the minimizing player is to move and the tree represents possible move developments that are considered. The value at inner nodes is defined recursively based on the linear extension: The minimizing player takes the minimum (the greatest lower bound) of the subnodes while the maximizing player takes the maximum (the least upper bound). This leads to a value for the top node in and the minimizing player will select a move that leads to this minimum.

*Intermezzo. Assuming that the min player in this example uses an unspecified linear extension (or “strategy” as Dasgupta calls them) to select moves is central in our considerations. But why is it fair to assume that the max player uses the same strategy? The reason is simple. Suppose the max player uses a different strategy or in fact any system at all (even random decisions) to select moves. In that case the altered evaluation function would assign to each node a value that is less than or equal to the value obtained from equal strategies (when compared with the min player’s linear extension). This follows from the recursive definition of the evaluation function. Since the min player’s goal is to reach a minimal value, the worst case scenario is to assume that the opponent uses the same strategy. End of intermezzo.*

Any evaluation function defined as above still depends on the choice of linear extension, so different linear extensions give different evaluation functions. What we are looking for instead is a way to define a single evaluation function based only on the given partial order on . There is a nice trick to turn the example above into exactly such a function, but it requires to alter the target space. To define the new target space start with , the space of all functions that map linear extensions of to . The evaluation defined above at any node can be regarded as an example of such a function by treating the linear extension in its definition not as fixed but as a variable. Let me make this more precise based on the following observations:

- There is a canonical embedding as constant functions: for all linear extensions .
- If then define an element by where in the right hand side refers to the minimum with respect to .
- If then define an element by where in the right hand side refers to the maximum with respect to .
- Since any totally ordered set is a distributive lattice with respect to its minimum and maximum operators and it follows that the definitions above turn into a distributive lattice and therefore also into a partially ordered set.

The entire space is too big for our purpose, therefore I define , the *linear lattice over* as the smallest sublattice of that contains . Then is still a distributive lattice. The linear lattice will serve as the target space for evaluation functions on game trees under the partial order .

*Remark. The set embeds into as a partially ordered set but not always as a lattice. For example if have a greatest lower bound then is a lower bound for and but not necessarily the greatest lower bound. End of remark.*

*Example. If is a totally ordered space then . End of example.*

An evaluation function on a game tree is now defined recursively, as in the picture above, as follows.

- Assign values in to the leaf nodes based on some heuristics.
- Define the value of an inner min node as the greatest lower bound in of the values of all its direct successors.
- Define the value of an inner max node as the least upper bound in of the values of all its direct successors.

Note that this construction is completely in line with the results of Ginsberg et al. The fact that is a distributive lattice even implies that alpha beta pruning should be applicable in the recursive computation of the evaluation function. I will address that part in the next post.

The linear lattice may seem rather abstract but the fact that it is distributive and generated by means that each element can be put in both a disjunctive and conjunctive normal form built from elements of only. These normal forms can be described directly in terms of minimizing and maximizing orders as introduced in the first post. This will identify the linear lattice with what Dasgupta et al call “dominance algebra”. Define two partially ordered spaces, suggestively called and , by applying the star order extension twice as in the picture below:

So is the set of finite antichains in ordered by their maximizing order and the set of finite antichains in ordered by their minimizing order. If is a linear extension of I denote it’s minimum and maximum operators by and respectively to distinguish them from the lattice operators in CNF and DNF. The following statements identify the normal forms of .

**CNF: **For *any* partially ordered space the space is a lattice with minimal and maximal elements and respectively. The sublattice is isomorphic to via the rule .

**DNF: **For *any* partially ordered space the space is a lattice with minimal and maximal elements and respectively. The sublattice is isomorphic to via the rule .

I will only show the CNF case. In the previous post we saw that any maximizing order always has a greatest lower bound operator and it also has a least upper bound operator if its base space has one. Since in particular always has a least upper bound operator, this shows that is a lattice. The empty set (which is a finite antichain) is maximal for any maximizing order and minimal for any minimizing order. Therefore the elements and are minimal and maximal elements for this lattice respectively. A simple verification shows that the given evaluation rule at least defines a surjective homomorphism onto so it remains to prove that this homomorphism is also injective (meaning that the conjunctive normal form is *unique*). Suppose are such that for all linear extensions . I will show that this implies (which suffices since by symmetry then also and ).

Let . For any there exists a linear extension such that

- is maximal in the lower set and
- if and then .

This implies that since, being an antichain, no element of other than itself can be entirely contained in and therefore must have a maximum greater than . Then by assumption also . In particular all with must contain and at least one such element must exist in . Since this holds for any it follows that for all with . This implies that and hence .

Summing up the results of this post: The linear lattice is the natural target space for evaluation functions on game trees based on heuristic evaluation of positions with values in the partially ordered set . Both lattices and (minus their maximal and minimal elements) are isomorphic to the linear lattice and explicitly represent elements in their unique conjunctive and disjunctive normal form respectively. In particular the CNF and DNF lattices are themselves distributive and isomorphic. The isomorphisms both ways correspond to what in the paper by Dasgupta et al is called “MAX to MIN” and “MIN to MAX”.

In the next and final post in this series I will discuss alpha beta pruning for game trees under a partial order.