Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC 322 Introduction to Artificial Intelligence September 22, 2004.

Similar presentations


Presentation on theme: "CPSC 322 Introduction to Artificial Intelligence September 22, 2004."— Presentation transcript:

1 CPSC 322 Introduction to Artificial Intelligence September 22, 2004

2 Administrative Stuff galiano:~> pl Welcome to SWI-Prolog (Multi-threaded, Version 5.3.16) Copyright (c) 1990-2003 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- compile('~cs322/cilog/cilog_swi.pl'). CILOG Version 0.13. Copyright 1998-2004, David Poole. CILOG comes with absolutely no warranty. All inputs end with a period. Type "help." for help. cilog:

3 Administrative Stuff Welcome to SWI-Prolog (Multi-threaded, Version 5.2.0) Copyright (c) 1990-2003 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- [cilog_swi]. CILOG Version 0.12. Copyright 1998, David Poole. CILOG comes with absolutely no warranty. All inputs end with a period. Type "help." for help. cilog: load 'brother.ci'. CILOG theory brother.ci loaded. cilog: listing. parent(charles, william). parent(charles, harry). male(charles). male(william). male(harry). brother(A, B) <- male(A)&parent(C, A)&parent(C, B)&different(A, B). different(A, B) <- A\=B. cilog: ask brother(william,harry). Answer: brother(william, harry).

4 Administrative Stuff Welcome to SWI-Prolog (Multi-threaded, Version 5.2.0) Copyright (c) 1990-2003 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- [cilog_swi]. CILOG Version 0.13. Copyright 1998-2004, David Poole. CILOG comes with absolutely no warranty. All inputs end with a period. Type "help." for help. cilog: load 'brother.ci'. CILOG theory brother.ci loaded. cilog: listing. parent(charles, william). parent(charles, harry). male(charles). male(william). male(harry). brother(A, B) <- male(A)&parent(C, A)&parent(C, B)&different(A, B). different(A, B) <- A\=B. cilog: ask brother(william,harry). Error: error(existence_error(procedure, dif/2), A)

5 Administrative Stuff Office hours Qian HuangTu2:00pm - 4:00pm 308A Navjot SinghTh10:30am - 12:30pm 238 Kurt EiseltM W3:30pm - 4:30pm 247

6 Administrative Stuff Homework clarification: some basic relation, like “parent”, doesn’t have to be a rule...sorry for the confusion Turn in assignments electronically - use handin read man handin our course is cs322 the first assignment is asgn1 Newsgroup: ubc.courses.cpsc.322 We’re hoping to have WebCT going real soon now.... Read Chapter 3

7 Highlights from last time So what exactly happens when we ask? s3s3 s1s1 s2s2 light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3).

8 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?a 1 ^... ^ a k. AC := yes <- a 1 ^... ^ a k. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

9 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- a 1 ^... ^ a k. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

10 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w3,w5) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

11 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w3,w5) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

12 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w3,w5) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

13 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w3,w5) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

14 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w3,w5) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

15 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w3,w5) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

16 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- ok(cb1) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

17 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- ok(cb1) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

18 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- ok(cb1) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

19 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- ok(cb1) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

20 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- ok(cb1) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

21 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- ok(cb1) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

22 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- ok(cb1) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

23 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- ok(cb1) ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.) Note: if the clause C that was chosen is a fact in the knowledge base (no body, just a head) then you know a i is true

24 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- TRUE ^ connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.) Note: if the clause C that was chosen is a fact in the knowledge base (no body, just a head) then you know a i is true

25 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.) Note: if the clause C that was chosen is a fact in the knowledge base (no body, just a head) then you know a i is true

26 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

27 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

28 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

29 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

30 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

31 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- connected_to(w2,w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

32 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- down(s1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

33 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- down(s1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

34 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- down(s1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

35 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- down(s1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

36 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- down(s1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

37 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- down(s1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

38 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- down(s1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

39 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <- TRUE. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

40 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

41 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

42 Highlights from last time So what exactly happens when we ask? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). ask connected_to(w3,w5) & connected_to(w2,w3). prove: ?connected_to(w3,w5) ^ connected_to(w2,w3). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

43 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?a 1 ^... ^ a k. AC := yes <- a 1 ^... ^ a k. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

44 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). ask continuous(l2, w3). prove: ?a 1 ^... ^ a k. AC := yes <- a 1 ^... ^ a k. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

45 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- a 1 ^... ^ a k. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

46 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- continuous(l2, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

47 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- continuous(l2, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

48 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- continuous(l2, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

49 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- continuous(l2, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

50 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- continuous(l2, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

51 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- continuous(l2, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C until AC is an answer (i.e., yes <-.)

52 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- continuous(l2, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

53 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(l2, w3) <- connected_to(l2, Z) & connected_to(Z, w3). prove: ?continuous(l2, w3). AC := yes <- continuous(l2, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

54 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(l2, w3) <- connected_to(l2, Z) & connected_to(Z, w3). prove: ?continuous(l2, w3). AC := yes <- connected_to(l2, Z) ^ connected_to(Z, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

55 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(l2, Z) ^ connected_to(Z, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

56 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(l2, Z) ^ connected_to(Z, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

57 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(l2, Z) ^ connected_to(Z, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

58 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(l2, Z) ^ connected_to(Z, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

59 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(l2, Z) ^ connected_to(Z, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

60 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(l2, Z) ^ connected_to(Z, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

61 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(l2, w4) ^ connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

62 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- TRUE ^ connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

63 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

64 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

65 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

66 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

67 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

68 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

69 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- connected_to(w4, w3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

70 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- up(s3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

71 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- up(s3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

72 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- up(s3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

73 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- up(s3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

74 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- up(s3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

75 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- up(s3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

76 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- up(s3). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

77 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <- TRUE. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

78 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

79 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

80 Once more, with variables light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). prove: ?continuous(l2, w3). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

81 Can we make “continuous” arbitrarily long? s3s3 s1s1 s2s2 light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y).

82 Can we make “continuous” arbitrarily long? s3s3 s1s1 s2s2 light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, A) & connected_to(A, Y).

83 Can we make “continuous” arbitrarily long? s3s3 s1s1 s2s2 light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, Y). continuous(X, Y) <- connected_to(X, Z) & connected_to(Z, A) & connected_to(A, Y).... and so on...

84 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?a 1 ^... ^ a k. AC := yes <- a 1 ^... ^ a k. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

85 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). ask continuous(l2, w5). prove: ?a 1 ^... ^ a k. AC := yes <- a 1 ^... ^ a k. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

86 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- a 1 ^... ^ a k. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

87 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(l2, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

88 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(l2, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

89 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(l2, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

90 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(l2, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

91 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(l2, w5) <- connected_to(l2, Z) & continuous(Z, w5). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(l2, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

92 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(l2, w5) <- connected_to(l2, Z) & continuous(Z, w5). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(l2, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

93 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(l2, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

94 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(l2, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

95 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(l2, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

96 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(l2, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

97 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(l2, w4) ^ continuous(w4, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

98 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- TRUE ^ continuous(w4, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

99 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w4, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

100 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w4, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

101 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w4, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

102 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w4, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

103 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w4, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

104 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(w4, w5) <- connected_to(w4, Z) & continuous(Z, w5). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w4, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

105 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(w4, w5) <- connected_to(w4, Z) & continuous(Z, w5). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(w4, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

106 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(w4, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

107 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(w4, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

108 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(w4, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

109 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(w4, Z) ^ continuous(Z, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

110 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- connected_to(w4, w3) ^ continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

111 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- up(s3) ^ continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

112 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- up(s3) ^ continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

113 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- up(s3) ^ continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

114 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- up(s3) ^ continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

115 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- up(s3) ^ continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

116 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- TRUE ^ continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

117 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

118 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

119 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

120 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

121 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(X, Y) <- connected_to(X, Y). prove: ?continuous(l2, w5). AC := yes <- continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

122 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- continuous(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

123 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- connected_to(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

124 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- connected_to(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

125 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- connected_to(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

126 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- connected_to(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

127 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- connected_to(w3, w5). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

128 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- ok(cb1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

129 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- ok(cb1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

130 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- ok(cb1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

131 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- ok(cb1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

132 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- ok(cb1). repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

133 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <- TRUE. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

134 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

135 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

136 Once more, with recursion light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

137 That’s what happens when we ask. light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0, w1) <- up(s2). connected_to(w0, w2) <- down(s2). connected_to(w1, w3) <- up(s1). connected_to(w2, w3) <- down(s1). connected_to(l2, w4). connected_to(w4, w3) <- up(s3). connected_to(p1, w3). connected_to(w3, w5) <- ok(cb1). connected_to(p2, w6). connected_to(w6, w5) <- ok(cb2). connected_to(w5, outside). continuous(X, Y) <- connected_to(X, Z) & continuous(Z, Y). continuous(w3, w5) <- connected_to(w3, w5). prove: ?continuous(l2, w5). AC := yes <-. repeat select a conjunct a i from the body of AC choose clause C from KB with a i as head replace a i in the body of AC by the body of C after making appropriate substitutions until AC is an answer (i.e., yes <-.)

138 The Awesome Power of Recursion or how getting the representation right makes everything else so easy....

139 The Maze r11 - r12 - r13 - r14 - r15 - r16 - r17 r18 | | | | | r21 r22 r23 - r24 r25 - r26 r27 - r28 | | | | r31 r32 r33 - r34 - r35 r36 r37 - r38 | | | | | | r41 r42 r43 r44 - r45 - r46 r47 r48 | | | | | | r51 r52 - r53 r54 r55 r56 r57 - r58 | | | | | | r61 r62 - r63 r64 - r65 r66 - r67 r68 | | | | r71 r72 r73 r74 - r75 - r76 r77 - r78 | | | | | r81 - r82 r83 - r84 r85 - r86 r87 - r88


Download ppt "CPSC 322 Introduction to Artificial Intelligence September 22, 2004."

Similar presentations


Ads by Google