Fundamental issue in knowledge representation: characterize what can be said in a representation language and what kinds of answers can be found in a reasonable amount of time
The world-model gap
Simple example: How many course are offered by the CSE department?
DB view: 2, but in real world they may be the same course; there may be other courses offered as well
DB answers are about the data not the real world
A major problem in AI is providing a model of the world that is sufficient for the agent
A knowledge representation language
Logic: A language for describing states of affairs along with mechanical procedures that can operate on sets of sentences in the language to perform reasoning (i.e., to determine “what implicitly follows” from what is explicitly represented).
Overview of logic
Logic formally includes:
Syntax: specifies the symbols in the language and how they can combine to form sentences (i.e. representations of facts)
Semantics: Specifies what facts in the real world sentences refer
to
Given a syntax and semantics can determine a reasoning mechanism
Reasoning mechanism continued
Inference procedure (proof theory): mechanical rules for computing the entailments of sets of sentences
Important distinction between facts and representations:
Fact: A claim about the real world (may be true or false)
Representation: Expression in some language; we need
representaions that can be encoded in a computer
Basic properties and relationships
Truth: A sentence is true if the “state of affairs” it describes in the real world is actually the case. Truth depends on interpertation and the state of the world --- semantics. Example:
"It's wet" is true or false under the obvious interpertation but we could design a new interpertation: wet -> raining
A sentence is valid if it is true in any state of affairs, no matter what the world is actually like. Also called a tautology or analytic truth. Examples?
More Basics
A sentence is unsatisfiable if it is never true --- the world is never like that. Examples?
Entailment: Suppose whenever one set of sentences is true under an interpretation, so is another sentence:
if {raining} and {outside} => {wet}
P Q R
the relationship between {P and Q} and R is entailment, denoted {P,Q} |= R
In general, there is more than one possible interpertation and
{P,Q} |= R requires that the truth of R follow from {P,Q} under all
interpertations
More Basics
An inference procedure that generates only entailed sentences is called sound and truth-preserving
Any world in which a sentence is true under an interpertation is a model of that sentence under that interpertation. A new use (meaning) of the word model? No, a model is still a formal mathematical structure that “stands in” for the world. More later.
If the models of a knowledge base (KB) are all models of Q then KB entails Q, KB |= Q
Semantics (a bit more)
interpertation: a correspondance between sentences and facts; part of the design of a language
compositionality: the meaning of the whole is a function of the meanings of its parts; make specification of proof theory easier
sometimes difficult to appreciate semantics because the languages that we use come with semantics that we learn naturally. Examples: English, algebra. Would these be good languages to use for knowledge representation (KR)? Why?
Inference procedures
Want to apply mechanical rules to a set of sentences to determine what they entail. The application of these rules is called inference
2 important properties of inference:
Soudness: if Q |= R then Q |- R (i.e., inference only produces entailments)
Completeness: if Q |= R then Q |- R (i.e., inference produces all entailments)
the proof theory of a language specifies the sound inferencing steps
Computing entailments
Computers do not know the semantics of a KR language
To decide if KB |= Q the computer must show that the KB entails Q under all interpretations.
Formal inference rules can be used to derive valid conclusions under all interpertations
Formal Logics
Defined by syntax, semantics, and proof theory
We will consider 2 formal logics: propositional logic and first-order predicate calculus
Ontological commitments (the nature of reality; the kinds of existences):
propositional logic: statements (propositions)
predicate calculus: statements, objects, and relations between objects
probability theory: statements
Formal logics continued
Epstemological commitments (states of knowledge):
propositional logic: true, false or unknown
predicate calculus: true, false or unknown
probability theory: degree of belief (will cover later)
Propositional logic
Recall that the KB is a representation of facts about the world in some representation language. Inference procedures enable the agent to derive new representations of facts; to get true facts the the inference process must follow the semantics.
We now see how this is done in a simple logic, propositional logic.
Syntax
The constants T and F are sentences
Any propositional symbol (P, Q, R, S, ....) is a sentence
If Q and R are sentences then so is:
(Q)
Q ^ R conjunction
Q | R disjunction
~ Q negation
Q => R implication
Q <=> R equivalence
Rules apply recursively to produce complex sentences. Examples?
Semantics
Interpertation function mapping proposition symbols to their meanings (e.g., P means “it is raining”). Interpertation is up to the designer; a sentence containing a proposition symbol is satisfiable but not valid. Why?
Constants T and F have fixed interperetations
Semantic continued
Rules for complex sentences (the meanings of logical connectives)
Q ^ R is True iff Q is True and R is True
Q | R is True iff Q is True or R is True
~Q is True iff Q is not True (False)
Q => R is True iff Q is not True or R is True
Q <=> R is True iff Q is True and R is True or Q is False and R is False
These rules are usually expressed in truth tables (see page 168, Fig 6.9 of text)
Note compositional semantics. Does English have a compositional semantics?
Entailment
Can use truth tables to test for entailment: Given a premise P and a conclusion C (i.e., premise => conclusion), build a truth table for the sentence P => C and check that all rows are true. If all rows are true then the sentence is valid --- the fact represented by C follows from the state of affairs represented by P under all interpretations
See example on pg 169 of text.
This method can be done mechanically; a computer can check conclusions without access to the semantics
Inference Procedures
Can summarize the truth table calculations with common patterns --- inference rules. Show soundness once and for all.