Introduction to Artificial Inteligence
Assignment 4
Programming assignment - logical reasoning
Goals
Implementing a basic forward-chaining reasoning system, and
applying it to playing RISK.
Requirements
Your program should essentially implement a production system.
It should read a set of rules from a file into working memory.
Then, once specific data is added to the working memory, it should use
forward chaining to prodoce its results.
Specifically, your rules and basic facts should be such that will be
appropriate for reasoning about good moves in RISK. In essence, you
should work according to the following steps:
- Decide on a basic vocabulary of predicates and facts (examples below),
and code several of them for testing.
- Implement the reasoning mechanism and test it with the basic rules.
- Add rules so as to make passable RISK play.
Examples of predicates you might use:
- FA(node, how_many) - predicate stating how many of my armies
are at a certain territory.
- EA(node, how_many) - likewise for enemy armies.
- NE(node1, node2) - denotes neighboring nodes.
- AD(node1, node2) - my armies at node 1 have an advantage over
enemy armies at node 2.
- GAD(node1, node2) - same, but I have a GREAT advantage
- >(x, y)
- A(node1, node2) - action: attack node2 from node 1.
Note that predicates of the first type are added by simple code that looks
at the state of the game. Other predicates can be added as a result
of applying rules. Some rules that might make sense are:
- IF FA(X, C1) AND EA(Y, C2) AND NE(X, Y) AND >(C1, C2) THEN ADD AD(X, Y)
- IF AD(X, Y) AND NOT GAD(W, Z) THEN ACTION A(X, Y)
Further requirements
Your reasoner should support the following keywords (in addition to the obvious
IF, AND, NOT, and THEN):
- ADD - add a fact to working memory
- DELETE - delete a fact from working memory
- ACTION - make the agent take the indicated external action
Note that you should implement some form of conflict resolution scheme of your
choice, be specific about it in the documentation!
Deliverables
You need to turn in:
- The program - executable and source code.
- File containing your rules.
- Documentation on your design choices - especially issues such as
conflict resolution scheme, input file format, etc.
- Examples of input and output for specific situations in a RISK game.
Deadline: January 18, 2004.