Logic Programming WhatversusHow

 Assignment - Pelican Hunters

Introduction

This assignment focusses on a simplified version of a board game called Pelican Hunters. There are two parts to the assignment. (1) In the first part, you play the game in order to familiarize yourself with the game world. (2) In the second part, you write rules that constrain the behavior of both players so as to maximize social value while minimally restricting their freedom of action.

Playing the Game

Pelican Hunters is a 2-player, alternating move game played on an 8x8 board. There are two hunters - Indy and Lara. In addition, there are eight pelicans, two pieces of gold, and two diamonds. On each step of the game, one of the players moves to another square. If the player moves onto a square containing the other player, the other player dies. If the player moves onto a square containing a pelican, the pelican is obliterated. If a player moves onto a square containing a diamond or a piece of gold, the treasure is added to the player's hoard. One complication is that a player's hoard has room for only one piece of treasure of each sort. If a player collects a second item of a sort that he or she already has, the treasure disappears (and thus becomes inaccessible to either player). The game terminates when either of the players is eliminated or when all of the pelicans are obliterated. At the end of the game, a player's score is 100 if he or she has both gold and a diamond, it is 50 if he or she has only one type of treasure; and it is 0 otherwise.

Pelican Hunters is not a traditional game. Unlike competitive games, there is also a social score. The social score has two parts - efficiency and equity. The efficiency component is simply the sum of the scores of the players; the higher their scores, the higher the efficiency component. The equity component is the efficiency component multiplied by the difference in the scores of the players divided by 200 (the total possible score). The social score is efficiency minus inequity. If both players get 100 points, efficiency is 200 and inequity is 0 and the societal score is, therefore, 200. If both players get 0, the efficiency is 0 and inequity is 0 and the societal score is 0. If one player gets 100 and the other player gets 0, then efficiency is 100 and inequity is 50 (i.e. 100 * (100 - 0) / 200), and the societal score is 50.

Load the basic version of the game by clicking in the link below. The board is shown in the middle. The social score is shown above the board. The boxes on the left are spaces for Indy's treasure, and the boxes on the right hold Lara's treasure. The scores above these boxes show the scores for each of the players. The currently active player is shown below the board. To make a move, simply click on the desired square. The active player will then move as directed, and the other player will become active.

Pelican Hunters - basic version

If you get tired playing manually, you can let the game play by itself. Clicking on the Step button makes a random move for the active player. Clicking Play runs the game in automatic mode, making random moves for one player after the other. Clicking the Pause button suspend automatic operation. Clicking the Reset button resets the game to its initial state. Try it. You will find a variation of this automatic version useful in the second part of the assignment.

Writing Laws

Now to the point of the assignment. Instead of being a player, you get to play the role of a legislator. Your job is to enact legislation that will allow the players freedom to maximize their individual scores but will encourage them to act so as to maximize the social score as well. What rules would you enact, and how would you encode those rules so that the players used them in determining their legal actions?

As our ontology, we use the symbols a, ..., h to denote columns and the digits 1, ..., 8, as in Chess. We use the symbol indy to denote Indy; we use the symbol lara to denote Lara; and we use gold, diamond, and pelican to denote treasures and pelicans. We use the three place relation location to specify the contents of each location on the board. For example, the sentence location(a,3,indy) means that Indy is located in the third cell (from the bottom) in the first column. We use the two place relation has to state that a player has a particular treasure. For example, the sentence has(indy,gold) means that Indy has a gold nugget. We use the unary predicate control to describe whose turn it is to play. For example, the sentence control(indy) means it is Indy's turn to play. Finally, we use the binary relation legal to state that it is legal for the player in control to move to a specific cell. For example, the sentence legal(a,5) means that it is legal for the currently active player to move to the cell in row and column 5.

Your job on this assignment is to define legal in terms of location and has and control so that all players have maximum freedom but act in a way that maximizes social utility. There are multiple ways this can be done.