CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 30, 2013.

Slides:



Advertisements
Similar presentations
Department of Computer Science Undergraduate Events More
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Department of Computer Science Undergraduate Events More
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) March, 16, 2009.
CPSC 322, Lecture 21Slide 1 Bottom Up: Soundness and Completeness Computer Science cpsc322, Lecture 21 (Textbook Chpt 5.2) February, 27, 2009.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.6) February, 01, 2010.
CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) January, 6, 2010.
CPSC 322, Lecture 20Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Computer Science cpsc322, Lecture 20 (Textbook.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.8) February, 02, 2009.
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 21Slide 1 Bottom Up: Soundness and Completeness Computer Science cpsc322, Lecture 21 (Textbook Chpt 5.2) March, 5, 2010.
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 31Slide 1 Probability and Time: Markov Models Computer Science cpsc322, Lecture 31 (Textbook Chpt 6.5) March, 25, 2009.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) March, 8, 2010.
CPSC 322, Lecture 24Slide 1 Reasoning under Uncertainty: Intro to Probability Computer Science cpsc322, Lecture 24 (Textbook Chpt 6.1, 6.1.1) March, 15,
Logic: Datalog wrap-up CPSC 322 – Logic 5 Textbook §12.3 March 14, 2011.
Slide 1 Logic: TD as search, Datalog (variables) Jim Little UBC CS 322 – CSP October 24, 2014 Textbook §5.2 and 12.
Computer Science CPSC 322 Lecture 25 Logic Wrap Up Intro to Probability Slide 1.
Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Jim Little UBC CS 322 – CSP October 22, 2014.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
Department of Computer Science Undergraduate Events More
Logic: Intro & Propositional Definite Clause Logic CPSC 322 – Logic 1 Textbook §5.1 March 4, 2011.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 19Slide 1 (finish Planning) Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt – 5.2) Oct,
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
Slide 1 Propositional Logic Intro, Syntax Jim Little UBC CS 322 – CSP October 17, 2014 Textbook § – 5.2.
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 7, 2012.
Computer Science CPSC 322 Lecture 14 Intro to Logic (5.1, 5.1.1) 1.
Constraint Satisfaction Problems (CSPs) Introduction
Logic: TD as search, Datalog (variables)
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Computer Science cpsc322, Lecture 20
Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19
Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Propositional Definite Clause Logic: Syntax, Semantics, R&R and Proofs
Planning: Forward Planning and CSP Planning
Constraint Satisfaction Problems (CSPs) Introduction
Reasoning Under Uncertainty: Conditioning, Bayes Rule & Chain Rule
Planning: Representation and Forward Search
Decision Theory: Single Stage Decisions
Planning: Heuristics and CSP Planning
Planning: Heuristics and CSP Planning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Planning: Representation and Forward Search
Probability and Time: Markov Models
Probability and Time: Markov Models
Planning: Heuristics and CSP Planning
Logic: Top-down proof procedure and Datalog
Decision Theory: Single Stage Decisions
Probability and Time: Markov Models
Assignment-2 due now Enterprise Architecture Conference Sat. Oct 27
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Probability and Time: Markov Models
Computer Science cpsc322, Lecture 20
Bottom Up: Soundness and Completeness
Bottom Up: Soundness and Completeness
Representations & Reasoning Systems (RRS) (2.2)
Planning: Representation and Forward Search
Bottom Up: Soundness and Completeness
Presentation transcript:

CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 30, 2013

Department of Computer Science Undergraduate Events More Mastering LinkedIn Workshop Date: Mon., Oct 28 Time: 5:00 pm Location: Wesbrook 100 Resume Drop-in Editing Date: Tues., Oct 29 Time: 12:30 – 3:30 pm Location: ICCS 253 Graduate Recruitment Panel Date: Wed., Oct 30 Time: 12:30 – 1:30 pm Location: X836, ICICS/CS CSSS Meet the Profs Luncheon Date: Thurs., Oct 31 Time: 12:30 – 2 pm Location: X836, ICICS/CS E-Portfolio Info Session & Talk by Eric Diep, Co-Founder, A Thinking Ape Date: Tues., Nov 5 Time: 5:15 – 6:45 pm Location: DMP 110 Programming Interview Resources Drop-in Clinic Date: Wed., Nov 6 Time: 12:30 – 2 pm Location: ICCS 202 Speed Mentoring Dinner Date: Wed., Nov 6 Time: 5:45 – 7:15 pm Location: ICCS X860

CPSC 322, Lecture 21Slide 3 Lecture Overview Recap Using Logic to Model a Domain (Electrical System) Reasoning/Proofs (in the Electrical Domain) Top-Down Proof Procedure

CPSC 322, Lecture 21Slide 4 Soundness & completeness of proof procedures A proof procedure X is sound … A proof procedure X is complete…. BottomUp for PDCL is We proved this in general even for domains represented by thousands of propositions and corresponding KB with millions of definite clauses !

CPSC 322, Lecture 21Slide 5 Lecture Overview Recap Using PDCL Logic to Model a Domain (Electrical System) Reasoning/Proofs (in the Electrical Domain) Top-Down Proof Procedure

CPSC 322, Lecture 21Slide 6 Electrical Environment / up /down

CPSC 322, Lecture 21Slide 7 Let’s define relevant propositions / up /down For each wire w For each circuit breaker cb For each switch s For each light l For each outlet p x 2 2 How many interpretations?

CPSC 322, Lecture 21Slide 8 Let’s now tell system knowledge about how the domain works / up /down live_l 1 ← live_w 0 ← live_w 1 ←

CPSC 322, Lecture 21Slide 9 More on how the domain works…. / up /down live_w 2 ← live_w 3 ∧ down_s 1. live_l 2 ← live_w 4. live_w 4 ← live_w 3 ∧ up_s 3. live_p 1 ← live_w 3..

CPSC 322, Lecture 21Slide 10 More on how the domain works…. / up /down live_w 3 ← live_w 5 ∧ ok_cb 1. live_p 2 ← live_w 6. live_w 6 ← live_w 5 ∧ ok_cb 2. live_w 5 ← live_outside.

CPSC 322, Lecture 21Slide 11 What else we may know about this domain? That some simple propositions are true / up /down live_outside.

CPSC 322, Lecture 21Slide 12 What else we may know about this domain? That some additional simple propositions are true down_s 1. up_s 2. up_s 3. ok_cb 1. ok_cb 2. live_outside. / up /down

CPSC 322, Lecture 21Slide 13 All our knowledge….. down_s 1. up_s 2. up_s 3. ok_cb 1. ok_cb 2. live_outside / up /down live_l 1 ← live_w 0 live_w 0 ← live_w 1 ∧ up_s 2. live_w 0 ← live_w 2 ∧ down_s 2. live_w 1 ← live_w 3 ∧ up_s 1. live_w 2 ← live_w 3 ∧ down_s 1. live_l 2 ← live_w 4. live_w 4 ← live_w 3 ∧ up_s 3. live_p 1 ← live_w 3. live_w 3 ← live_w 5 ∧ ok_cb 1. live_p 2 ← live_w 6. live_w 6 ← live_w 5 ∧ ok_cb 2. live_w 5 ← live_outside.

CPSC 322, Lecture 21Slide 14 Lecture Overview Recap Using Logic to Model a Domain (Electrical System) Reasoning/Proofs (in the Electrical Domain) Top-Down Proof Procedure

CPSC 322, Lecture 21Slide 15 What Semantics is telling us Our KB (all we know about this domain) is going to be true only in a subset of all possible __________interpretations What is logically entailed by our KB are all the propositions that are true in all those interpretations This is what we should be able to derive given a sound and complete proof procedure

CPSC 322, Lecture 21Slide 16 If we apply the bottom-up (BU) proof procedure down_s 1. up_s 2. up_s 3. ok_cb 1. ok_cb 2. live_outside live_l 1 ← live_w 0 live_w 0 ← live_w 1 ∧ up_s 2. live_w 0 ← live_w 2 ∧ down_s 2. live_w 1 ← live_w 3 ∧ up_s 1. live_w 2 ← live_w 3 ∧ down_s 1. live_l 2 ← live_w 4. live_w 4 ← live_w 3 ∧ up_s 3. live_p 1 ← live_w 3.. live_w 3 ← live_w 5 ∧ ok_cb 1. live_p 2 ← live_w 6. live_w 6 ← live_w 5 ∧ ok_cb 2. live_w 5 ← live_outside.

CPSC 322, Lecture 21Slide 17 Lecture Overview Recap Using Logic to Model a Domain (Electrical System) Reasoning/Proofs (in the Electrical Domain) Top-Down Proof Procedure

Bottom-up vs. Top-down KB G is proved if G  C When does BU look at the query G ? Bottom-up D. Only at the beginning A. In every loop iterationB. Never C. Only at the end C

Bottom-up vs. Top-down Key Idea of top-down: search backward from a query G to determine if it can be derived from KB. KB C G is proved if G  C When does BU look at the query G? At the end Bottom-up Top-down TD performs a backward search starting at G KB answer Query G

CPSC 322, Lecture 22Slide 20 Top-down Ground Proof Procedure Key Idea: search backward from a query G to determine if it can be derived from KB.

CPSC 322, Lecture 22Slide 21 Top-down Proof Procedure: Basic elements Notation : An answer clause is of the form: yes ← a 1 ∧ a 2 ∧ … ∧ a m Rule of inference (called SLD Resolution) Given an answer clause of the form: yes ← a 1 ∧ a 2 ∧ … ∧ a m and the clause: a i ← b 1 ∧ b 2 ∧ … ∧ b p You can generate the answer clause yes ← a 1 ∧ … ∧ a i-1 ∧ b 1 ∧ b 2 ∧ … ∧ b p ∧ a i+1 ∧ … ∧ a m Express query as an answer clause (e.g., query a 1 ∧ a 2 ∧ … ∧ a m ) yes ←

CPSC 322, Lecture 22Slide 22 Rule of inference: Examples Rule of inference (called SLD Resolution) Given an answer clause of the form: yes ← a 1 ∧ a 2 ∧ … ∧ a m and the KB clause: a i ← b 1 ∧ b 2 ∧ … ∧ b p You can generate the answer clause yes ← a 1 ∧ … ∧ a i-1 ∧ b 1 ∧ b 2 ∧ … ∧ b p ∧ a i+1 ∧ … ∧ a m yes ← b ∧ c.b ← k ∧ f. yes ← e ∧ f.e.

CPSC 322, Lecture 22Slide 23 (successful) Derivations An answer is an answer clause with m = 0. That is, it is the answer clause yes ←. A (successful) derivation of query “?q 1 ∧ … ∧ q k “ from KB is a sequence of answer clauses γ 0, γ 1,…,γ n such that γ 0 is the answer clause yes ← q 1 ∧ … ∧ q k γ i is obtained by resolving γ i-1 with a clause in KB, and γ n is an answer. An unsuccessful derivation…..

CPSC 322, Lecture 22Slide 24 Example: derivations a ← e ∧ f. a ← b ∧ c.b ← k ∧ f. c ← e.d ← k. e. f ← j ∧ e. f ← c. j ← c. Query: a (two ways) yes ← a. yes ← a.

CPSC 322, Lecture 22Slide 25 Example: derivations k ← e. a ← b ∧ c.b ← k ∧ f. c ← e.d ← k. e. f ← j ∧ e. f ← c. j ← c. Query: b ∧ e A. Provable by TDB. It depends C. Not Provable by TD

CPSC 322, Lecture 2Slide 26 Course Big Picture Environment Problem Inference Planning Deterministic Stochastic Search Arc Consistency Search Value Iteration Var. Elimination Constraint Satisfaction Logics STRIPS Belief Nets Vars + Constraints Decision Nets Markov Processes Var. Elimination Static Sequential Representation Reasoning Technique SLS

CPSC 322, Lecture 11Slide 27 Standard Search vs. Specific R&R systems Constraint Satisfaction (Problems): State: assignments of values to a subset of the variables Successor function: assign values to a “free” variable Goal test: set of constraints Solution: possible world that satisfies the constraints Heuristic function: none (all solutions at the same distance from start) Planning : State possible world Successor function states resulting from valid actions Goal test assignment to subset of vars Solution sequence of actions Heuristic function empty-delete-list (solve simplified problem) Logical Inference State answer clause Successor function states resulting from substituting one atom with all the clauses of which it is the head Goal test empty answer clause Solution start state Heuristic function ….. (next time)

CPSC 322, Lecture 4Slide 28 Learning Goals for today’s class You can: Model a relatively simple domain with propositional definite clause logic (PDCL) Trace query derivation using SLD resolution rule of inference