((run3) (OR ((delete (choice (6)))) ((PP))) (PP) (PP Now we run the Konigsberg bridge problem) (PP The query is all (X : epathextend (X (Y)) & check7 (X)) , where check7 does the forall stmnt .) (is (setup)) (PP Running ...) (all (X : epathextend (X (Y)) & check7 (X))) (PP) (PP End ... Prog5)) ((run2) (PP) (PP) (PP Now the bridge problems will be run . The modified problem will be first) (PP) (PP The modified problem doesn ' t use path "{" f "}") (is (setup)) (PP The query is all (X : epathextend (X (Y)) & check6 (X)) , where check6 does the forall statement) (PP) (PP Here are all 6 path solutions .....) (PP) (all (X : epathextend (X (Y)) & check6 (X))) (run3)) ((run1) (PP) (PP) (PP The second query is : all (X : epathextend (X (Y))) . It will now be executed) (all (X : epathextend (X (Y)))) (run2)) ((run) (PP) (PP Here is the first query that is run as part of the assignment .) (PP It is all (X : epathextend (X (1 a 3)))) (PP) (all (Y : epathextend (Y (1 a 3)))) (run1)) ((hardcopy *************************** follows ********************************)) ((hardcopy starts with two queries that will be run on the seven path graph)) ((hardcopy then will show the queries and solutions to the two bridge problems & /* (the Konigsberg problem , and the same problem with one path "{" f "}" removed))) ((decide) (/* decide inputs the user ' s choice of problem) (PP Which problem should be solved ?) (PP Enter ` no ' for the Konigsberg bridge problem .) (PP Enter ` just 7 ' for the modified problem) (OR ((is-told (choice (X))) (add (choice (X)))) ((PP)))) ((setup-2) (OR ((sixpaths) (PP You have chosen the six path problem)) ((sevenpaths) (PP You have chosen the Konigsberg bridge problem)))) ((setup-1) (/* Setup-1 prints an opening statement and calls decide to query the choice of problem) (PP Greetings . This program finds solutions to problems involving path finding ,) (PP most notably the Konigsberg bridge problem .) (decide)) ((setup) (setup-1) (setup-2)) ((by Submitted (Daniel Spiegel Program 5 CS580 May 16 , 1986))) ((by ------------------------------------------------------------)) ((graph6 ((1 a 3) (3 a 1) (1 b 3) (3 b 1) (1 c 2) (2 c 1) (2 d 3) (3 d 2) (2 g 4) (4 g 2) (3 e 4) (4 e 3)))) ((sixpaths) (choice 6)) ((graph7 ((1 a 3) (3 a 1) (1 b 3) (3 b 1) (1 c 2) (2 c 1) (2 d 3) (3 d 2) (2 g 4) (4 g 2) (3 e 4) (4 e 3) (3 f 4) (4 f 3)))) ((sevenpaths) (/* Sevenpaths will hold unless choice (6) is entered by the user) (NOT choice 6)) ((r X Y Z) (/* To find an r , it must be known whether there are seven paths or six paths) (OR ((sevenpaths) (graph7 (x|y))) ((sixpaths) (graph6 (x|y)))) (ON (X Y Z) (x|y))) ((estepextend X Y) (/* This finds and correctly attaches one path to the end of the input path X) (APPEND Z (x) Y) (r x y z) (NOT ON y Y) (APPEND Y (y) X1) (APPEND X1 (z) X)) ((epathextend X Y) (/* the rulebase as in class) (estepextend X Y)) ((epathextend X Y) (estepextend Z Y) (epathextend X Z)) ((check6 X) (/* Check6 causes only six path solutions to be output since no path can be) (/* repeated and all 6 must be used) (FORALL ((ON Y (a b c d e g))) ((ON Y X)))) ((check7 X) (/* check7 causes only seven path solutions to be output) (FORALL ((ON Y (a b c d e f g))) ((ON Y X)))) ((comment ************************************************************)) ((comment This program solves path problems , most notably the Konigsberg bridge problem)) ((comment This program will be executed with the queries as given in class)) ((data-rel choice)) ((infix by)) ((infix ON)) ((infix EQ)) ((infix /*)) ((postfix is-told)) ((postfix add)) ((postfix told)) ((postfix data-rel)) ((postfix all)) ((postfix is)) ((postfix delete)) ((dict comment)) ((dict by)) ((dict epathextend)) ((dict estepextend)) ((dict r)) ((dict graph7)) ((dict graph6)) ((dict sevenpaths)) ((dict sixpaths)) ((dict decide)) ((dict setup-1)) ((dict setup-2)) ((dict setup)) ((dict check6)) ((dict check7)) ((dict data-rel)) ((dict run)) ((dict run1)) ((dict run2)) ((dict run3)) ((dict choice)) ((dict hardcopy)) ct check7)) ((dict data-rel)) ((dict run)) ((dict run1)) ((dict run2)) ((