1 1 Torsten Hahmann, CSC384, University of Toronto, Fall 2011 Announcements: Assignments 1. A1: will not be marked before the midterm; maybe back next Monday (no promises!) – Direct remarking requests first to Alexandra; only if it cannot be corrected/clarified, talk to me. – Submit remarking requests in writing (email is sufficient) ! 2. A2: Will be out by tomorrow – You are advised to look at the CSP questions (5-8) before the midterm and at question 1 (Interpretations) before, it will be good preparation for the midterm – Not much programming; should take significantly less time that A1 3. A2 Help Sessions: • Wednesday, Nov 2 nd : 2:30 – 3:30PM • Tuesday, Nov 8 th 5:30 – 6:30 PM 2 Torsten Hahmann, CSC384, University of Toronto, Fall 2011 Announcements: Midterm & Final • Midterm next week in class: October 24 th , 6pm • BE ON TIME! Start writing at 6:10pm, 80 min long • Afterwards: 1h lecture or a tutorial on common problems with A1 • If you have a conflict, let me know by Wed. • If you miss the midterm for medical reasons, you need the offical UofT medical certificate • Midterm: No aids allowed! • Some sample midterms on the website • Two office hours this week: • Tuesday, Oct. 18 th 5:15 – 6:45 PM (BA4261 – standard room) • Wednesday, Oct. 19 th 2:30 – 3:30PM (BA3289) 3 Torsten Hahmann, CSC384, University of Toronto, Fall 2011 Midterm Topics Essentially everything up to now. • Introduction (What is AI, Agents) • Focus: Search (Uninformed, Heuristic, Game-tree, Backtracking/CSP) • Need to know how the algorithms work, their properties, their advantages & disadvantages, problem formulation, etc. • Some first-order logic: interpretations and models (as covered today and question 1 of Assignment 2) • Do not need to: • Reproduce complex proofs (but unterstand the ideas) • Write (pseudo)code for algorithms or Prolog code 4 Torsten Hahmann, CSC384, University of Toronto, Fall 2011 Other announcements • Date for the final exam has been announced (see Exam Calendar) • I believe Dec. 13 th (check yourself!) • Midterm feedback: Let us improve the learning experience together. • please fill out during break • need a volunteer to collect them
21
Embed
Announcements: Assignments Announcements: …torsten/csc384-f11/lectures/csc384f...1 Torsten Hahmann, CSC384, University of Toronto, Fall 2011 1 Announcements: Assignments 1. A1: will
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
1Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Announcements: Assignments
1. A1: will not be marked before the midterm; maybe back next Monday (no promises!)
– Direct remarking requests first to Alexandra; only if it cannot be corrected/clarified, talk to me.
– Submit remarking requests in writing (email is sufficient) !
2. A2: Will be out by tomorrow
– You are advised to look at the CSP questions (5-8) before the midterm and at question 1 (Interpretations) before, it will be good preparation for the midterm
– Not much programming; should take significantly less time that A1
3. A2 Help Sessions:
• Wednesday, Nov 2nd : 2:30 – 3:30PM
• Tuesday, Nov 8th 5:30 – 6:30 PM
2Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Announcements: Midterm & Final
• Midterm next week in class: October 24th, 6pm• BE ON TIME! Start writing at 6:10pm, 80 min long
• Afterwards: 1h lecture or a tutorial on common problems with A1
• If you have a conflict, let me know by Wed.
• If you miss the midterm for medical reasons, you need the officalUofT medical certificate
• Midterm: No aids allowed!
• Some sample midterms on the website
• Two office hours this week: • Tuesday, Oct. 18th 5:15 – 6:45 PM (BA4261 – standard room)
• Wednesday, Oct. 19th 2:30 – 3:30PM (BA3289)
3Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Midterm Topics
Essentially everything up to now.• Introduction (What is AI, Agents)• Focus: Search (Uninformed, Heuristic, Game-tree,
Backtracking/CSP)• Need to know how the algorithms work, their
properties, their advantages & disadvantages, problem formulation, etc.
• Some first-order logic: interpretations and models(as covered today and question 1 of Assignment 2)
• Do not need to:• Reproduce complex proofs (but unterstand the ideas)• Write (pseudo)code for algorithms or Prolog code
4Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Other announcements
• Date for the final exam has been announced (see Exam Calendar)
• I believe Dec. 13th (check yourself!)
• Midterm feedback: Let us improve the
learning experience together.
• please fill out during break
• need a volunteer to collect them
2
5Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Some unfinished business: CSP
• Conversion of n-ary constraints into binary constraints. – Remember: finite CSPs have finite number of variables
and finite number of domain values for variable (no real values for example)
• Library of problems: csplib.org
• Some constraint solvers:– Choco (Java)
– Minion (C++)
• CSP research here at UofT:– Fahiem Bacchus (also extensions to QBF)
– Chris Beck (MIE): scheduling & optimization
6Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Where are we?
1. Heuristic Search: “Formulate problem as search problem”
� Requires domain-dependent heuristic to efficiently guide the search
2. Games: “Restricted to specific applications of interest to AI”
� Special kind of search over utilities
3. Constraint Satisfaction Problems: “Wider class of AI problems”
� More general: good for a large class of problems; do need to encode algorithms and heuristics for each new problem
4. Logic-based Knowledge representation
� Even more general, we can encode knowledge and reuse general purpose inference engines:
5. Planning (specific kind of logic-based knowledge representation)
6. Reasoning under uncertainty
7. If time permits: Decision making under uncertainty.
7Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Knowledge Representation (KR)
• This material is covered in chapters 7– 9 and 12 of the textbook.
• Chapter 7 provides useful motivation for logic, and an introduction to some basic ideas. It also introduces propositional logic, which is a good background for first-order logic.
• Instead we focus immediately on the first-order case as covered in Chapter 8.
• Chapter 8 contains more examples that we won’t be able to cover in class
• We focus on resolution (9.2 and 9.5) as first-order inference mechanism, other mechanisms covered in Chapter 9 are forward and backward chaining.
• Chapter 12 covers some of the additional notions that have to be dealt with when using knowledge representation in AI. These are geared towards modern uses of logic for logic representation.
8Torsten Hahmann, CSC384, University of Toronto, Fall 2011
What is KNOWLEDGE?Easier question: how do we talk about it?
• We say “John knows that …” and fill in the blank
(can be true/false, right/wrong)
• Contrast: “John fears that …”
(same content, different attitude)
Other forms of knowledge:
- know how, who, what, when, …
- sensorimotor: typing, riding a bicycle
- affective: deep understanding
Belief: not necessarily true and/or held for appropriate reasons
Here we make no distinction between knowledge and belief
MAIN IDEA
Taking the world to be one way and not another
3
9Torsten Hahmann, CSC384, University of Toronto, Fall 2011
What is REPRESENTATION?Symbols standing for things in the world
� first aid
� women
“John” � John
“John loves Mary” � the proposition that John loves Mary
Knowledge Representation:
Symbolic encoding of propositions believed
(by some agent)
10Torsten Hahmann, CSC384, University of Toronto, Fall 2011
What is REASONING?
Reasoning:
Manipulation of symbols encoding propositions to
produce new representations of new propositions
Analogy: arithmetic “1011” + “10” → “1101”
↓ ↓ ↓
eleven two thirteen
Modus ponens (forward chaining):
All men are mortals, socrates is a man. Thus, socrates is mortal
All foobars are bliffs, bebong is a foobar. Thus, bebong is a bliff
11Torsten Hahmann, CSC384, University of Toronto, Fall 2011
WHY Knowledge?Taking an intentional stance (Daniel Dennet):
For sufficiently complex systems, it is sometimes compelling to describe
systems in terms of beliefs, goals, fears, intentions
E.g., in a game-playing program
“because it believed its queen was in danger, but wanted to still
control the centre of the board”
More useful than description about actual techniques used for
deciding how to move
“because evaluation procedure P using minimax returned a value
of +7 for this position.”
Is KR just a convenient way of talking about complex systems?
- sometimes such anthropomorphizing is inappropriate (e.g., thermostat)
- can also be very misleading!
fooling users into thinking a system knows more than it does
12Torsten Hahmann, CSC384, University of Toronto, Fall 2011
• We can reuse general knowledge in many different
applications or domains
– Knowledge of time, of general process, of spatial features, of
physics, etc. are useful for many different applications
– E.g. “a door can usually be opened and used to move into a building
or room”
• This is the idea of ontologies = reusable and shareable
formalisations of knowledge
WHY Knowledge?
4
13Torsten Hahmann, CSC384, University of Toronto, Fall 2011
WHY Representation?Taking Dennet’s intentional stance says nothing about what is or is not represented symbolically
e.g., in game playing, perhaps the board position is represented but the goal of getting a knight out early is not
KR Hypothesis (Brian Smith)“Any mechanically embodied intelligent process will be comprised of structural
ingredients that a) we as external observers naturally take to represent a propositional account of the knowledge that the overall process exhibits, and b) independent of such external semantic attribution, play a formal but causal and essential role in engendering the behaviour that manifests that knowledge”
Two issues: existence of structures that
• we can interpret propositionally
• determine how the system behaves
KNOWLEDGE-BASED SYSTEM: one designed this way!
14Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Two ExamplesBoth of the following systems can be described intentionally.
However, only the 2nd has a separate collection of symbolic structures (following the KR Hypothesis)
Example 2 has a knowledge base and thus the system is a knowledge-based system.
about the world• father_of(jane, bill), female(jane), system_down()
• satisfied(client15), satisfied(C)
• desires(client15,rome,week29), desires(X,Y,Z)
• rating(hotel7, 4), cost(hotel7, 125)
46Torsten Hahmann, CSC384, University of Toronto, Fall 2011
First Order Syntax—Building up.
Atoms are formulas. (Atomic formulas).
• The negation (NOT) of a formula is a new formula
¬ f
Asserts that f is false.
• The conjunction (AND) of a set of formulas is a formula.
f1 Λ f2 Λ … Λ fn where each fi is formula
Asserts that each formula fi is true.
47Torsten Hahmann, CSC384, University of Toronto, Fall 2011
First Order Syntax—Building up.
• The disjunction (OR) of a set of formulas is a formula.
f1 V f2 V … V fn where each fi is formula
Asserts that at least one formula fi is true.
• Existential Quantification ∃. ∃X. f where X is a variable and f is a formula.
Asserts there is some individual such that f under than binding will be true.
• Universal Quantification ∀. ∀X.f where X is a variable and f is a formula.
Assets that f is true for every individual.
48Torsten Hahmann, CSC384, University of Toronto, Fall 2011
First Order Syntax—abbreviations.
• Implication (→):
f1→ f2 is equivalent to ¬f1 V f2.
• Other symbols used for implication:
• f1⇒ f2
• f1⊃ f2
• If and only if (↔):
f1 ↔ f2 is equivalent to (f1 → f2) . (f2 → f1).
• Other symbols used for implication:
• f1⇔ f2
• f1≡ f2
13
49Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Semantics.
• Formulas (syntax) can be built up recursively, and can become arbitrarily complex.
• Intuitively, there are various distinct formulas (viewed as strings) that really are asserting the same thing∀X,Y. elephant(X) Λ teacup(Y) → largerThan(X,Y)
∀X,Y. teacup(Y) Λ elephant(X) → largerThan(X,Y)
• To capture this equivalence and to make sense of complex formulas we utilize the semantics.
50Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Semantics.
• A formal mapping from formulas to semantic entities (individuals, sets and relations over individuals, functions over individuals).
• The mapping mirrors the recursive structure of the syntax, so we can give any formula, no
matter how complex a mapping to semantic entities.
51Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Semantics—Formal Details
First, we must fix the particular first-order language we are
going to provide semantics for. The primitive symbols included in the syntax defines the particular language.L(F,P,V)
• F = set of function (and constant symbols)
• Each symbol f in F has a particular arity.
• P = set of predicate symbols.
• Each symbol p in P has a particular arity.
• V = an infinite set of variables.
52Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Semantics—Formal Details
An interpretation (model) is a tuple
⟨D, Φ, Ψ,v⟩
•D is a non-empty set (domain of individuals)
• Φ (Phi) is a mapping: Φ(f) : Dk→ D
• maps k-ary function symbol f, to a function from k-ary tuples of
individuals to individuals.
• Ψ (Psi) is a mapping: Ψ(p) : Dk → True/False
• maps k-ary predicate symbol p, to an indicator function over k-ary
tuples of individuals (a subset of Dk)
•v is a variable assignment function. v(X) = d ∈ D (it maps every variable to some individual)
14
53Torsten Hahmann, CSC384, University of Toronto, Fall 2011
82Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Propositional KB: a, c → b, b → c, d → b, ¬b → ¬c
a b c d
a b c ¬d
a ¬b ¬c ¬d
Set of All Interpretations
Models of KB
Models: A Propositional Example
83Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Models and Interpretations
• the more sentences in KB, the fewer models (satisfying interpretations) there are.
•The more you write down (as long as it’s all true!), the “closer” you get to the “real world”! Because each sentence in KB rules out certain unintended
interpretations.
•This is called axiomatizing the domain
84Torsten Hahmann, CSC384, University of Toronto, Fall 2011
Computing logical consequences
• We want procedures for computing logical consequences that can be implemented in our
programs.
• This would allow us to reason with our knowledge
• Represent the knowledge as logical formulas
• Apply procedures for generating logical consequences