imansharifi@lenovo-g50-80:~/PhD Program/1-Prolog Programming/Code/Maze 3$ yap % Restoring file /usr/lib/Yap/startup.yss YAP 6.2.2 (x86_64-linux): Sat Sep 17 13:59:03 UTC 2016 ?- pwd. /home/imansharifi/PhD Program/1-Prolog Programming/Code/Maze 3 yes ?- [aleph]. % consulting /home/imansharifi/PhD Program/1-Prolog Programming/Code/Maze 3/aleph.pl... A L E P H Version 5 Last modified: Sun Mar 11 03:25:37 UTC 2007 Manual: http://www.comlab.ox.ac.uk/oucl/groups/machlearn/Aleph/index.html % consulted /home/imansharifi/PhD Program/1-Prolog Programming/Code/Maze 3/aleph.pl in module user, 52 msec 2325136 bytes yes ?- read_all(maze). % reconsulting /home/imansharifi/PhD Program/1-Prolog Programming/Code/Maze 3/maze.b... These codes have been written by Iman Sharifi (Email:iman.sharifi.edu@gmail.com). Do not forget to hit the star bottun in this repository if you could use it. This project aims to find some rules regarding State Transition in Maze platform. Using Current State and taken action, we are going to find some general rules for the Next State which is generalizeable to different Maze environments. Mode Declarations ... The head of the desired rules has been defined. The terms of the body of the rules have been settled. Language Setting ... The states (maze cells) have been defined. The actions (right,left,up,down) have been defined. Background Knowledge ... The neighborhood relations have been defined. The obstacles (walls) have been defined. % reconsulted /home/imansharifi/PhD Program/1-Prolog Programming/Code/Maze 3/maze.b in module user, 2 msec 18352 bytes [consulting pos examples] [maze.f] [consulting neg examples] [maze.n] yes ?- induce. [select example] [1] [sat] [1] [next_state(x13,right,x23)] [bottom clause] next_state(A,B,C) :- adjacent(A,B,C), not_wall(A), not_wall(C). [literals] [4] [saturation time] [0.001] [reduce] [best label so far] [[1,0,2,1]/0] next_state(A,B,C). [14/24] next_state(A,B,C) :- adjacent(A,B,C). [8/16] next_state(A,B,C) :- not_wall(A). [14/14] next_state(A,B,C) :- adjacent(A,B,C), not_wall(C). [8/6] next_state(A,B,C) :- adjacent(A,B,C), not_wall(A). [8/6] next_state(A,B,C) :- adjacent(A,B,C), not_wall(C), not_wall(A). [8/0] [-------------------------------------] [found clause] next_state(A,B,C) :- adjacent(A,B,C), not_wall(C), not_wall(A). [pos cover = 8 neg cover = 0] [pos-neg] [8] [clause label] [[8,0,4,8]] [clauses constructed] [6] [-------------------------------------] [clauses constructed] [6] [search time] [0.003] [best clause] next_state(A,B,C) :- adjacent(A,B,C), not_wall(C), not_wall(A). [pos cover = 8 neg cover = 0] [pos-neg] [8] [atoms left] [6] [positive examples left] [6] [estimated time to finish (secs)] [0.00225] [select example] [2] [sat] [2] [next_state(x13,up,x13)] [bottom clause] next_state(A,B,A) :- adjacent(A,B,C), not_wall(A), wall(C). [literals] [4] [saturation time] [0.0] [reduce] [best label so far] [[1,0,2,1]/0] next_state(A,B,A). [6/8] next_state(A,B,A) :- adjacent(A,B,C). [6/8] next_state(A,B,A) :- not_wall(A). [6/8] next_state(A,B,A) :- adjacent(A,B,C), wall(C). [6/0] [-------------------------------------] [found clause] next_state(A,B,A) :- adjacent(A,B,C), wall(C). [pos cover = 6 neg cover = 0] [pos-neg] [6] [clause label] [[6,0,3,6]] [clauses constructed] [4] [-------------------------------------] next_state(A,B,A) :- adjacent(A,B,C), not_wall(A). [clauses constructed] [5] [search time] [0.001] [best clause] next_state(A,B,A) :- adjacent(A,B,C), wall(C). [pos cover = 6 neg cover = 0] [pos-neg] [6] [atoms left] [0] [positive examples left] [0] [estimated time to finish (secs)] [0.0] [theory] [Rule 1] [Pos cover = 8 Neg cover = 0] next_state(A,B,C) :- adjacent(A,B,C), not_wall(C), not_wall(A). [Rule 2] [Pos cover = 6 Neg cover = 0] next_state(A,B,A) :- adjacent(A,B,C), wall(C). [Training set performance] Actual + - + 14 0 14 Pred - 0 24 24 14 24 38 Accuracy = 1.0 [Training set summary] [[14,0,0,24]] [time taken] [0.00700000000000001] [total clauses constructed] [11] ?- write_rules('extracted_rules.txt'). yes ?- pwd. /home/imansharifi/PhD Program/1-Prolog Programming/Code/Maze yes ?-