Computer Science CPSC 322
Lectur ture e 15 Logic I Intro a and nd PDCL
1
Lectur ture e 15 Logic I Intro a and nd PDCL 1 Announ - - PowerPoint PPT Presentation
Computer Science CPSC 322 Lectur ture e 15 Logic I Intro a and nd PDCL 1 Announ nouncem emen ents Marked midterms will be available on Thursday (with solutions) Assignment 3 will be posted on Th. Due Wed. Nov 15 2 late
1
Representation Reasoning Technique
4
Representation Reasoning Technique
Back to static problems, but with richer representation
5
Propositional Logics First-Order Logics Propositional Definite Clause Logics Semantics and Proof Theory Satisfiability Testing (SAT) Description Logics Cognitive Architectures Video Games Ontologies Semantic Web Information Extraction Summarization Production Systems Tutoring Systems Hardware Verification Product Configuration Software Verification
Applications
6
Propositional Logics First-Order Logics Propositional Definite Clause Logics Semantics and Proof Theory Description Logics Cognitive Architectures Video Games Hardware Verification Product Configuration Ontologies Semantic Web Information Extraction Summarization Production Systems Tutoring Systems Software Verification
You will know You will know a little
Applications
Satisfiability Testing (SAT)
7
8
9
Logic and AI “The Advice Taker” Coined “Artificial Intelligence”. Dartmouth W’shop (1956)
10
1. Begin with a task domain. 2. Distinguish those things you want to talk about (the ontology) 3. Choose symbols in the computer to denote elements of your ontology 4. Tell the system knowledge about the domain
12
/ up /down
13
/ up /down
14
1. Begin with a task domain. 2. Distinguish those things you want to talk about (the ontology) 3. Choose symbols in the computer to denote elements of your ontology 4. Tell the system knowledge about the domain 5. Ask the system whether new statements about the domain are true or false
15
/ up /down
16
17
{true, false}
18
20
Definition (atom) An atom is a symbol starting with a lower case letter Definition (body) A body is an atom or is of the form b1 ∧ b2 where b1 and b2 are bodies. Definition (definite clause) A definite clause is
atom (“head”) and b is a body. (Read this as “h if b”.) Definition (KB) A knowledge base (KB) is a set of definite clauses
Examples: p1; live_l1 Examples: p1 ∧ p2;
Examples: p1 ← p2; live_w0 ← live_w1 ∧ up_s2
21
22
a) Sunny_today b) sunny_today ∨ cloudy_today c) vdjhsaekwrq d) high_pressure_system ← sunny-today e) sunny_today ← high_pressure_system ∧ summer f) sunny_today ← high_pressure-system ∧ ¬ winter g) ai_is_fun ← f(time_spent, material_learned) h) summer ← sunny_today ∧ high_pressure_system How many of the clauses below are legal PDCL clauses?
Definition (definite clause) A definite clause is
(Read this as ‘h if b.’)
23
a) Sunny_today b) sunny_today ∨ cloudy_today c) vdjhsaekwrq d) high_pressure_system ← sunny-today e) sunny_today ← high_pressure_system ∧ summer f) sunny_today ← high_pressure-system ∧ ¬ winter g) ai_is_fun ← f(time_spent, material_learned) h) summer ← sunny_today ∧ high_pressure_system How many of the clauses below are legal PDCL clauses?
Definition (definite clause) A definite clause is
(Read this as ‘h if b.’)
24
a) Sunny_today b) sunny_today ∨ cloudy_today c) vdjhsaekwrq d) high_pressure_system ← sunny-today e) sunny_today ← high_pressure_system ∧ summer f) sunny_today ← high_pressure-system ∧ ¬ winter g) ai_is_fun ← f(time_spent, material_learned) h) summer ← sunny_today ∧ high_pressure_system
25
26
28
29
30
31
33
34
Semantics allows you to relate the symbols in the logic to the domain you're trying to model. We can use the interpretation to determine the truth value of clauses
35
Similar to CSPs: a model of a set of clauses is an interpretation that makes all of the clauses true
36
p q r s I1 false true true false
1
37
p q r s I1 false true true false
1
38
p q r s I1 T T T T I2 F F F T I3 T T F F I4 T T T F I5 T T F T Which of the interpretations below are models of KB?
39
p q r s p ← q s s ← r KB I1 T T T T I2 F F F T I3 T T F F I4 T T T F I5 T T F T
Which of the interpretations below are models of KB? All interpretations where KB is true
40
Which of the interpretations below are models of KB? All interpretations where KB is true: I1, I2, and I5
41
p q r s p ← q s s ← r KB I1 T T T T T T T T I2 F F F T T T T T I3 T T F F T F T F I4 T T T F T F T F I5 T T F T T T T T
1) Tell the system knowledge about a task domain.
2) Ask the system whether new statements about
– Sound: only generates correct answers with respect to the semantics – Complete: Guaranteed to find an answer if it exists
42
1) Tell the system knowledge about a task domain. 2) Ask the system whether new statements about
43
1) Tell the system knowledge about a task domain. 2) Ask the system whether new statements about
44
45
46
47
r q p T T T T T F T F T T F F F T T F T F F F T F F F
48
r q p T T T T T F T F T T F F F T T F T F F F T F F F
49
r q p T T T T T F T F T T F F F T T F T F F F T F F F
50
p q r s I1 true true true true I2 true true true false I3 true true false false I4 true true false true I5 false true true true I6 false true true false I7 false true false false I8 false true false true I9 true false true true I10 true false true false I11 true false false false I12 true false false false ….. …… ….. …… …….
51
p q r s I1 true true true true I2 true true true false I3 true true false false I4 true true false true I5 false true true true I6 false true true false I7 false true false false I8 false true false true I9 true false true true I10 true false true false I11 true false false false I12 true false false false ….. …… ….. …… …….
52
p q r s I1 true true true true I2 true true true false I3 true true false false I4 true true false true I5 false true true true I6 false true true false I7 false true false false I8 false true false true I9 true false true true I10 true false true false I11 true false false false I12 true false false false ….. …… ….. …… …….
53
p q r s I1 true true true true I2 true true true false I3 true true false false I4 true true false true I5 false true true true I6 false true true false I7 false true false false I8 false true false true I9 true false true true I10 true false true false I11 true false false false I12 true false false false ….. …… ….. …… …….
T T F F
54
55
56
p q r s I1 true true true true I2 true true true false
57
p q r s I1 true true true true I2 true true true false
58
59
Bottom-up up and d Top-Dow
dure e for Finding ng Logi gical al Cons nseque quenc nce
Slide 61
Slide 62
complete: every atom that logically follows from KB is derived by P
sound: every atom derived by P follows logically from KB (i.e. is true in every model)
Slide 63
i.e., check whether all clauses in KB are true in I
64
i.e., check whether all clauses in KB are true in I
65
i.e., check whether all clauses in KB are true in I
66
67
BU G if G ⊆ C at the end of this procedure
68
C := {}; repe peat at select clause h ← b1 ∧ … ∧ bm in KB such that bi ∈ C for all i, and h ∉ C; C := C ∪ {h} unt until no more clauses can be selected.
a ← b ∧ c a ← e ∧ f b ← f ∧ k c ← e d ← k e. f ← j ∧ e f ← c j ← c {}
69
C := {}; repe peat at select clause h ← b1 ∧ … ∧ bm in KB such that bi ∈ C for all i, and h ∉ C; C := C ∪ {h} unt until no more clauses can be selected.
a ← b ∧ c a ← e ∧ f b ← f ∧ k c ← e d ← k e. f ← j ∧ e f ← c j ← c {} {e} {c,e} {c,e,f} {c,e,f,j} {a,c,e,f,j} Done.
70