Notes 7: Knowledge Representation, The Propositional Calculus - PowerPoint PPT Presentation

About This Presentation
Title:

Notes 7: Knowledge Representation, The Propositional Calculus

Description:

Bat_on and turns-key_on Engine-starts. Wff is unsatisfiable or inconsistent it ... the ... some sentences are true in the world it implies that some other ... – PowerPoint PPT presentation

Number of Views:73
Avg rating:3.0/5.0
Slides: 29
Provided by: padhrai
Learn more at: https://ics.uci.edu
Category:

less

Transcript and Presenter's Notes

Title: Notes 7: Knowledge Representation, The Propositional Calculus


1
Notes 7 Knowledge Representation, The
Propositional Calculus
  • ICS 270A Winter 2003

2
Outline
  • Representing knowledge using logic
  • Agent that reason logically
  • A knowledge based agent
  • Using constraints on feature values
  • A rich and implicit representation of the world
    state.
  • Representing and reasoning with logic
  • Propositional logic
  • Syntax
  • Semantic
  • validity and models
  • Rules of inference for propositional logic
  • Resolution
  • Complexity of propositional inference.
  • Reading Nillson Chapters 13,14, Russel and
    Norvig, Chapter 7

3
Why knowledge-base
  • The state of the world
  • may require lots of information..
  • The agent knowledge of the state of the world
  • If s is world state K(s) is what the agent
    knows.
  • For economy
  • Not everything explicitly specified. Some facts
    can be inferred.
  • Agent may infer whatever he does not know
    explicitly.
  • Nillson Constraints on feature values
  • Block A is not on the floor
  • Issues
  • In what language to express what the agent knows
    about the world. How explicit to make this
    knowledge. How to infer.

Agent knowledge of state
Description of the world
Agent explicit specification of what he knows
4
Knowledge RepresentationDefined by syntax,
semantix
Computer
Inference
Assertions Conclusions (knowledge
base) Facts Facts
Semantics
Imply
Real-World
Reasoning in the syntactic level Example
5
Constraints on the world
  • World so far were described by feature values
  • On(block,floor) On(A,B) Clear(C)
  • But some information is more complex
  • Law all human are mortal, all blue box are
    pushable
  • Negative information block a is not on the floor
  • Either A or B are pushable
  • Examples A lifting robot features
  • Bat_ok, liftable, moves
  • Constraints on the worlds can be written in
    logic
  • Bat_ok and liftable ? moves
  • If moves is false and Bat_ok is true, we infer
    liftable is false.
  • Logical languages involve
  • Syntax, the grammar
  • Semantics the meaning of words and sentences
  • Inference rules deriving new information that is
    correct.

6
The party example
  • If Alex goes, then Beki goes A ? B
  • If Chris goes, then Alex goes C ? A
  • Beki does not go not B
  • Chris goes C
  • Query Is it possible to satisfy all these
    conditions?
  • Should I go to the party?

7
Knowledge Representation
  • Knowledge representation
  • defined by syntax and semantics
  • Syntax says what sets of symbols are legal
    sentences.
  • Semantics says what a legal sentence means in the
    world.
  • Entailment
  • Generating new sentences that are true given old
    sentences that are true. KB alpha.
  • Sound inference
  • Given a knowledge base KB, generates a new
    sentence that is entailed by KB or verify
    entailment. KB -- ?
  • Soundness we infer only what can be entailed
    (what is true).
  • Proof A sequence of sound inferences.
  • Completeness
  • An inference is complete if it can prove
    everything that is true.
  • Proof theory
  • Example algebra language

8
Example of Languages for Representation
  • Programming languages
  • Formal languages, not ambiguous, but cannot
    express partial information. Not expressive
    enough.
  • Natural languages
  • very expressive but ambiguous ex small dogs and
    cats.
  • Good representation language
  • Both formal and can express partial information,
    can accommodate inference
  • Main approach used in AI Logic-based languages.

9
Propositional Logic
  • Syntax
  • Alphabet true,false,P,Q
  • Connectives
  • Well-Formed formulas (wffs or sentences) w1, w2
  • If Alex_goes ? Beki_goes
  • Semantics
  • True means true
  • False means false
  • Symbols means objects in the world and they are
    true or false relative to a scenario, or a world,
    we refer to.
  • Meaning of a sentence is derived from its parts
    as defined by truth-tables.

10
Truth tables for the logical connectives
11
A grammer for sentences in propositional logic
12
Truth Tables
  • Truth tables can be used to compute the truth
    value of any wff.
  • Can be used to find the truth of
  • Given n features there are 2n different worlds,
    different interpretations.
  • Interpretation any assignment of true and false
    to atoms
  • An interpretation satisfies a wff if the wff is
    assigned true under the interpretation
  • A model An interpretation is a model of a wff if
    the wff is satisfied in that interpretation.
  • Satisfiability of a wff can be determined by the
    truth-table
  • Bat_on and turns-key_on ? Engine-starts
  • Wff is unsatisfiable or inconsistent it has no
    models

13
Validity
14
Validity, Equivalence
  • Validity A wff is Valid if it is true in all
    interpretations
  • P ? P
  • Equivalence two wffs are equivalent iff they
    have the same models.
  • DeMorgan laws, law of contrapositive
  • If w1 is equivalent to w2 then w1 ? w2 and w2 ?
    w1
  • Associative
  • Distributive
  • DeMorgans

15
Logical Entailmenttruth in the world
  • KB ( ) entails a sentence, iff all the models
    of KB are models of alpha (in other words, any
    interpretation that satisfies KB satisfies
    alpha.)
  • If some sentences are true in the world it
    implies that some other sentences are true.
  • statement P is true whenever some other set KB of
    statements is true, then KB entails P.
  • Whenever means
  • In any possible world (model) in which every
    sentence of KB is true.

16
Rules of Inference
  • Producing an additional wffs from a set of wffs
  • From alpha infer beta
  • Sound inference rule
  • The conclusion is true whenever the premises are
    true.
  • Examples
  • Modus ponens A and A ? B -- B is sound,
    resolution is sound.
  • Proof
  • A sequence of inference rules generating the
    desired conclusion from the KB.
  • Example KB
  • From
  • From
  • KB

17
Rules of inference
18
Complete inference rules
  • An inference rule is complete if
  • it can be used to prove anything that is true.
  • Is modes ponens complete?
  • PvQ, P --gtA, Q --gt A
  • can we prove A by modes-ponens?
  • Cab we prove A by resolution?
  • Is resolution complete?
  • Example the party problem
  • Resolution implies forward-chaining and backword
    chaining.
  • Example
  • Resolution is complete

19
Resolution in Propositional Calculus
  • Using clauses as wffs
  • Literal, clauses, conjunction of clauses (cnfs)
  • Resolution rule
  • Resolving (P V Q) and (P V ? Q) P
  • Generalize modus ponens, chaining .
  • Resolving a literal with its negation yields
    empty clause.
  • Resolution is sound
  • Resolution is NOT complete
  • P and R entails P V R but you cannot infer P V R
  • From (P and R) by resolution
  • Resolution is complete for refutation adding
    (?P) and (?R) to (P and R) we can infer the empty
    clause.
  • Decidability of propositional calculus by
    resolution refutation if a wff w is not entailed
    by KB then resolution refutation will terminate
    without generating the empty clause.

20
Soundness of resolution
21
The party example
  • If Alex goes, then Beki goes A ? B
  • If Chris goes, then Alex goes C ? A
  • Beki does not go not B
  • Chris goes C
  • Query Is it possible to satisfy all these
    conditions?
  • Should I go to the party?

22
Example of proof by Refutation
  • Assume the claim is false and prove
    inconsistency
  • Example can we prove that Chris will not come to
    the party?
  • Prove by generating the desired goal.
  • Prove by refutation add the negation of the goal
    and prove no model
  • Proof
  • Refutation

23
The moving robot examplebat_ok,liftable
?movesmoves, bat_ok
24
Converting wffs to Conjunctive clauses
  • 1. Eliminate implications (P?Q) or (R ? P)
  • 2. Reduce the scope of negation sign
  • 3. Convert to cnfs using the associative and
    distributive laws

25
Converting wffs to Conjunctive clauses
  • 1. Eliminate implications
  • 2. Reduce the scope of negation sign
  • 3. Convert to cnfs using the associative and
    distributive laws

26
Proof by refutation
  • Given a database in clausal normal form KB
  • Find a sequence of resolution steps from KB to
    the empty clauses
  • Use the search space paradigm
  • States current cnf KB new clauses
  • Operators resolution
  • Initial state KB negated goal
  • Goal State a database containing the empty
    clause
  • Search using any search method

27
Proof by refutation (contd.)
  • Or
  • Prove that KB has no model - PSAT
  • A cnf theory is a constraint satisfaction
    problem
  • variables the propositions
  • domains true, false
  • constraints clauses (or their truth tables)
  • Find a solution to the csp. If no solution no
    model.
  • This is the satisfiability question
  • Methods Backtracking arc-consistency ? unit
    resolution, local search

28
Resolution refutation search strategies
  • Ordering strategies
  • Breadth-first, depth-first
  • I-level resolvents are generated from level-(I-1)
    or less resolvents
  • Unit-preference prefer resolutions with a
    literal
  • Set of support
  • Allows reslutions in which one of the resolvents
    is in the set of support
  • The set of support those clauses coming from
    negation of the theorem or their decendents.
  • The set of support strategy is refutation
    complete
  • Linear input
  • Restricted to resolutions when one member is in
    the input clauses
  • Linear input is not refutation complete
  • Example (PVQ) (P V not Q) (not P V Q) (not P V
    not Q) have no model

29
Complexity of propositional inference
  • Checking truth tables is exponential
  • Satisfiability is NP-complete
  • However, frequently generating proofs is easy.
  • Propositional logic is monotonic
  • If you can entail alpha from knowledge base KB
    and if you add sentences to KB, you can infer
    alpha from the extended knowledge-base as well.
  • Inference is local
  • Tractable Classes Horn, 2-SAT
  • Horn theories
  • Q lt-- P1,P2,...Pn
  • Pi is an atom in the language, Q can be false.
  • Solved by modus ponens or unit resolution.

30
Summary
  • Representing knowledge using logic
  • Using logic to represent and reason about
    knowledge
  • Logic, syntax, semantics and proof theory
  • Representing and reasoning with logic
  • Propositional logic
  • Syntax
  • Semantic
  • validity and models
  • Rules of inference for propositional logic
  • Complexity of propositional inference.
  • Reading Nillson Chaters 13, 14 Russel and Norvig
    Chapter 7.

31
The Wumpus world
  • The state of world is still simple to specify,
    not too many facts.
  • However the agents knowledge is partial and he
    needs to infe and think about his state in order
    to choose a good action.
  • Goal find gold, return to 1,1, climb out.
  • in wumpus square and near, perceive a stench
  • near a pit, breeze
  • in gold, percieve glitter
  • in wall, bump
  • actions turn 90, grab,shoot, climb
Write a Comment
User Comments (0)
About PowerShow.com