/* Maze. Peter Ross, 12-Nov-81. The database in this file describes a maze. All the cells are labelled with a letter and number, e.g. e2, f12 etc, except for the two called in and home. The predicate door(X,Y) means that there is a (two way) door between cells X and Y. The predicate move(X,Y) expresses the fact that the doors are two-way - it means you can move from cell X to cell Y in one move. Tasks: (1) show you CAN get from in to home. (2) find the shortest route (3) show you CAN'T get from in to home if the doors are only one way! NOTE: don't bother trying to draw the maze - (a) it has an idiosyncratic cell labelling scheme, and (b) it isn't two-dimensional! */ move(X,Y) :- door(X,Y). move(X,Y) :- door(Y,X). door(in,a4). door(a2,a3). door(a3,a4). door(a4,a5). door(a5,a6). door(a6,a7). door(a7,a8). door(a9,a10). door(a11,a12). door(a1,b12). door(b12,c12). door(c12,d1). door(e1,f12). door(f12,g12). door(g12,h1). door(i1,j12). door(k12,l1). door(b10,b9). door(b9,b8). door(b8,b7). door(b5,b4). door(a2,b11). door(b11,c11). door(e2,f11). door(g11,h2). door(j11,k11). door(k11,l2). door(c12,c11). door(c9,c8). door(c8,i6). door(c6,c5). door(c5,c4). door(c3,c2). door(b10,c10). door(c10,d3). door(f10,g10). door(h3,i3). door(j10,k10). door(d1,d2). door(d2,d3). door(d5,d6). door(d7,d8). door(d8,d9). door(d9,d10). door(d10,d11). door(d11,d12). door(b9,c9). door(c9,d4). door(e4,f9). door(f9,g9). door(h4,i4). door(i4,j9). door(k9,l4). door(e2,e3). door(e3,g1). door(e4,e5). door(e6,e7). door(e8,e9). door(e10,e11). door(e11,e12). door(c8,d5). door(e5,f8). door(h5,i5). door(i5,j8). door(f12,f11). door(f10,f9). door(f8,f7). door(f6,f5). door(f4,f3). door(f2,f1). door(b7,c7). door(c7,d6). door(e6,f7). door(f7,g7). door(j7,k7). door(g11,g10). door(g9,g8). door(g8,g7). door(g6,g5). door(g5,g4). door(a7,b6). door(b6,c6). door(d7,e7). door(f6,g6). door(g6,h7). door(j6,k6). door(k6,l7). door(h1,h2). door(h5,h6). door(h6,h7). door(h9,h10). door(h10,h11). door(a8,b5). door(e8,f5). door(h8,i8). door(j5,k5). door(i1,i2). door(i2,i3). door(i3,i4). door(i6,i7). door(i7,i8). door(i8,i9). door(i9,i10). door(i10,i11). door(i11,i12). door(a9,b4). door(c4,d9). door(d9,e9). door(f4,g4). door(h9,i9). door(i9,j4). door(k4,l9). door(j10,j9). door(j9,j8). door(j7,j6). door(j5,j4). door(j3,j2). door(j2,j1). door(a10,b3). door(b3,c3). door(d10,e10). door(g3,h10). door(j3,k3). door(k3,l10). door(k11,k10). door(k9,k8). door(k8,k7). door(k4,k3). door(k3,k2). door(k2,k1). door(a11,b2). door(b2,c2). door(f2,g2). door(g2,h11). door(l1,l2). door(l2,l3). door(l3,l4). door(l5,l6). door(l6,l7). door(l7,l8). door(l8,l9). door(l10,l11). door(a12,b1). door(b1,c1). door(c1,d12). door(e12,f1). door(g1,h12). door(h12,i12). door(j1,k1). door(k1,home).