*************************** CSCE 420 - Fall 2016 Project #4 due date: Thurs, 11/17/2016, 11:10am (using Turn-in) *************************** The objective of this assignment is to implement Forward Chaining, write a propositional knowledge base for playing tic-tac-toe and then use it to infer moves. The program should take two command-line arguments as input: the filename of the KB, and a space-separated list of facts in quotes. The representation of the tic-tac-toe board will be described by literals indicating whether each position is occupied by x, o, or b (for blank), using coordinates 1-3 for row and column (top-left is 1,1). coordinate system: 11 12 13 21 22 21 31 32 33 So for example, an x in the middle would be asserted as 'x22'. In writing the rules, you should aim to output only the OPTIMAL move (i.e. the best strategy). For example, your rules need to account for whether there are forced moves to block when the oppenent can win, but to always take a winning move when available. You should also check for the conditions of whether one of the players has won the game, and if so, only infer something like "won_x" and "game_over", but not infer any move. Note that the knowledge base must only consist of conjunctive rules with positive literals. Hint, even though the rules can only contain positive literals, you can use proposition than have a negative meaning, like "not_can_win_x" The file format for the knowledge base is simple. It only contains rules, which consist of a list of positive literals followed by a consequent. For example, the rule "A ^ B ^ C -> D" would be written on one line with spaces "A B C D". Of course, propositional symbols can have multiple characters, digits, and underscore. Also, allow for blanks lines in the input file, and any line starting with a '#' should be assumed to be a comment. Examples: --------- x b x b b b o b o > python fc.py ttt.kb "x11 b12 x13 b21 b22 b23 o31 b32 o33 turn_o" ... move_o32_can_win x b x b b b o b o > python fc.py ttt.kb "x11 b12 x13 b21 b22 b23 o31 b32 o33 turn_x" ... move_x12_can_win x b x b b b b b o > python fc.py ttt.kb "x11 b12 x13 b21 b22 b23 b31 b32 o33 turn_o" ... move_o12_forced o b b o b x x b b > python fc.py ttt.kb "o11 b12 b13 o21 b22 x23 x31 b32 b33 turn_x" ... move_x33_setup What to turn in: ---------------- a) You will submit your SOURCE-CODE and KNOWLEDGE-Baed for testing using the web-based CSCE turnin facility, which is described here: https://wiki.cse.tamu.edu/index.php/Turning_in_Assignments_on_CSNet b) You should include a Word document with instructions on how to compile and run your program, c) Include a transcript that shows example program traces (transcripts) for the examples shown below, along with 4 other tests of your choosing.