CPSC 322, Lecture 23 Slide 1
Log Logic ic: : TD TD as se as sear arch ch, , Da Data talo log (v (var ariab ables) es)
Co Computer ter Sc Scienc nce e cpsc sc322 322, , Lectu cture e 23 (Te Text xtbo book
- k Chpt 5.2 &
Log Logic ic: : TD TD as se as sear arch ch, , Da Data talo - - PowerPoint PPT Presentation
Log Logic ic: : TD TD as se as sear arch ch, , Da Data talo log (v (var ariab ables) es) Co Computer ter Sc Scienc nce e cpsc sc322 322, , Lectu cture e 23 (Te Text xtbo book ok Chpt 5.2 & & some basic
CPSC 322, Lecture 23 Slide 1
CPSC 322, Lecture 23 Slide 2
CPSC 322, Lecture 22 Slide 3
CPSC 322, Lecture 22 Slide 4
yes ← a1 ∧ a2 ∧ … ∧ am
yes ← a1 ∧ a2 ∧ … ∧ am
CPSC 322, Lecture 22 Slide 5
rule you obtain the answer clause yes ← . Query: a (two ways) yes ← a. yes ← a. a ← e ∧ f. a ← b ∧ c. b ← k ∧ f. c ← e. d ← k. e. f ← j ∧ e. f ← c. j ← c.
CPSC 322, Lecture 23 Slide 6
CPSC 322, Lecture 11 Slide 7
Constrai aint nt Satisfac facti tion
blems ems):
Planni nning ng (forward) d) :
Logical l Infe nferen rence ce (top p Do Down wn)
Possible ble He Heuristi stic? c? Number of atoms in the answer clause Ad Admissi issible ble? Prove: ?← a ∧ d. a ← b ∧ c. a ← g. a ← h. b ← j. b ← k. d ← m. d ← p. f ← m. f ← p. g ← m. g ← f. k ← m. h ←m. p.
CPSC 322, Lecture 23 Slide 10
a ← b ∧ c.
a ← g. a ← h. b ← j. b ← k. d ← m. d ← p. f ← m. f ← p. g ← m. g ← f. k ← m. h ← m. p. Prove: ?← a ∧ d.
CPSC 322, Lecture 23 Slide 11
CPSC 322, Lecture 23 Slide 12
CPSC 322, Lecture 23 Slide 13
up_s3 live_w1 connected_w1_w2
CPSC 322, Lecture 23 Slide 14
CPSC 322, Lecture 23 Slide 15
tter wi with colors) s)
Da Datalog:
relati ational nal rule language A variable is a symbol starting with an upper case letter A constant is a symbol starting with lower-case letter or a sequence of digits. A predicate symbol is a symbol starting with a lower-case letter. A term is either a variable or a constant.
Examples: X, Y Examples: alan, w1 Examples: live, connected, part-of, in Examples: X, Y, alan, w1
An atom is a symbol of the form p or p(t1 …. tn) where p is a predicate symbol and ti are terms A definite clause is either an atom (a fact) or of the form: h ← b1 ∧… ∧ bm where h and the bi are atoms (Read this as ``h if b.'') A knowledge base is a set of definite clauses Examples: sunny, in(alan,X) Example: in(X,Z) ← in(X,Y) ∧ part-of(Y,Z)
How do we deal with variables?
in(alan, r123). part_of(r123,cs_building). in(X,Y) part_of(Z,Y) ∧ in(X,Z).
Query: yes in(alan, cs_building). yes part_of(Z,cs_building) ∧ in(alan, Z).
in(X,Y) part_of(Z,Y) ∧ in(X,Z). with Y = cs_building X = alan
in(alan, r123). part_of(r123,cs_building). in(X,Y) part_of(Z,Y) ∧ in(X,Z).
Query: yes in(alan, cs_building). yes part_of(Z,cs_building) ∧ in(alan, Z).
Using clause: in(X,Y) part_of(Z,Y) ∧ in(X,Z), with Y = cs_building X = alan Using clause: part_of(r123,cs_building) with Z = r123
??????
in(alan, r123). part_of(r123,cs_building). in(X,Y) part_of(Z,Y) ∧ in(X,Z).
Query: yes in(alan, cs_building). yes part_of(Z,cs_building) ∧ in(alan, Z). yes in(alan, r123). yes part_of(Z, r123), in(alan, Z). yes .
Using clause: in(X,Y) part_of(Z,Y) ∧ in(X,Z), with Y = cs_building X = alan Using clause: part_of(r123,cs_building) with Z = r123 Using clause: in(alan, r123). Using clause: in(X,Y) part_of(Z,Y) ∧ in(X,Z). With X = alan Y = r123
fail
No clause with matching head: part_of(Z,r123).
What would the answer(s) be? Query: in(alan, X1).
in(alan, r123). part_of(r123,cs_building). in(X,Y) part_of(Z,Y) & in(X,Z).
yes(X1) in(alan, X1).
What would the answer(s) be? yes(r123). yes(cs_building). Query: in(alan, X1).
in(alan, r123). part_of(r123,cs_building). in(X,Y) part_of(Z,Y) & in(X,Z).
yes(X1) in(alan, X1).
Again, you can trace the SLD derivation for this query in the AIspace Deduction Applet
CPSC 322, Lecture 8 Slide 24
Propositional Logics First-Order Logics Propositional Definite Clause Logics Semantics and Proof Theory Satisfiability Testing (SAT) Description Logics Cognitive Architectures Video Games Hardware Verification Product Configuration Ontologies Semantic Web Information Extraction Summarization Production Systems Tutoring Systems
CPSC 322, Lecture 2 Slide 25
Static Sequential Representation Reasoning Technique SLS
CPSC 322, Lecture 23 Slide 26
CPSC 502, Lecture 6 27
Literal: ral: an atom or a negation of an atom Clause: e: is a disjunction of literals Conjunctive ctive Normal al Form (CNF): ): a conjunction of clauses
rt all formulas ulas in KB KB and in CNF
ution n Proced edure ure (at t each step ep combin ine e two cla lauses es containing aining complem lemen entary tary li literals rals in into a new
inatio ation
e resolve
ty clause
CPSC 502, Lecture 6 28
this task!
Start from a randomly generated interpretation
CPSC 502, Lecture 6 29
We have constant stant symbo bols, , predicate cate symbo bols s and and functi ction
h more re comple lex x (but t the same basic idea – one possible ble confi figurati guration
ecidable ble: : algorithms exists that says yes for every entailed formulas, but no algorithm exists that also says no for every non-entailed sentence
Resoluti ution
edure e can be ge general ralize zed d to FOL consta stant nt symbols
duals, als, entitie ties s predicat cate symbo bols s => relati tion
funct ction n symbo bols s => functi ctions