Docsity

First-Order Logic and Knowledge Representation in Artificial Intelligence - Prof. Worthy M, Study notes of Computer Science

Toggle sidebar
bg1
Page 1
CS 416
Artificial Intelligence
Lecture 13
First-Order Logic
Chapter 8
Guest Speaker
•Topics in Optimal Control, Minimax Control, and Game Theory
•March 28th, 2 p.m. OLS 005
•Onesimo Hernandez-Lerma
•Department of Mathematics
•CINVESTAV-IPN, Mexico City
•This is a nontechnical introduction, mainly thru examples, to some
recent topics in control and game theory, including adaptive control,
minimax control (a.k.a. "worst-case control" or "games against nature"),
partially observable systems (a.k.a. controlled "hidden Markov models"),
cooperative and noncooperative game equilibria, etc.
First-order logic
•We saw how propositional logic can create
intelligent behavior
•But propositional logic is a poor representation for
complex environments
•First-order logic is a more expressive and
powerful representation
Diagnostic Rules
•Rules leading from observed effects to hidden causes
– After you’ve observed something, this rule offers an explanation
– These rules explain what happened in the past
• Breezy implies pits
• Not breezy implies no pits
• Combining
Causal Rules
• Some hidden property causes percepts to be
generated
– These are predictions of perceptions you expect to
have in the future given current conditions
• A pit causes adjacent squares to be breezy
• If all squares adjacent to a square a pitless, it will not be
breezy
Causal Rules
• The causal rules formulate a model
– Knowledge of how the environment operates
– Model can be very useful and important and replace
straightforward diagnostic approaches
pf3
pf4
pf5

Partial preview of the text

Download First-Order Logic and Knowledge Representation in Artificial Intelligence - Prof. Worthy M and more Study notes Computer Science in PDF only on Docsity!

CS 416

Artificial Intelligence

Lecture 13 First-Order Logic Chapter 8

Guest Speaker

•Topics in Optimal Control, Minimax Control, and Game Theory •March 28 th, 2 p.m. OLS 005 •Onesimo Hernandez-Lerma •Department of Mathematics •CINVESTAV-IPN, Mexico City •This is a nontechnical introduction, mainly thru examples, to some recent topics in control and game theory, including adaptive control, minimax control (a.k.a. "worst-case control" or "games against nature"), partially observable systems (a.k.a. controlled "hidden Markov models"), cooperative and noncooperative game equilibria, etc.

First-order logic

•We saw how propositional logic can create

intelligent behavior

•But propositional logic is a poor representation for

complex environments

•First-order logic is a more expressive and

powerful representation

Diagnostic Rules

•Rules leading from observed effects to hidden causes

  • After you’ve observed something, this rule offers an explanation
  • These rules explain what happened in the past
    • Breezy implies pits
    • Not breezy implies no pits
    • Combining

Causal Rules

  • Some hidden property causes percepts to be

generated

  • These are predictions of perceptions you expect to have in the future given current conditions - A pit causes adjacent squares to be breezy - If all squares adjacent to a square a pitless, it will not be breezy

Causal Rules

  • The causal rules formulate a model
    • Knowledge of how the environment operates
    • Model can be very useful and important and replace straightforward diagnostic approaches

Conclusion

•If the axioms correctly and completely describe the way the world works and the way percepts are produced,

•then any complete logical inference procedure will infer the strongest possible description of the world state given the available percepts

•The agent designer can focus on getting the knowledge right without worrying about the processes of deduction

Discussion of models

  • Let’s think about how we use models every day
    • Daily stock prices
    • Seasonal stock prices
    • Seasonal temperatures
    • Annual temperatures

Knowledge Engineering

  • Understand a particular domain
    • How does stock trading work
  • Learn what concepts are important in the domain (features) - Buyer confidence, strength of the dollar, company earnings, interest rate
  • Create a formal representation of the objects and relations in the domain - Forall stocks (price = low ^ confidence = high) => profitability = high

Identify the task

  • What is the range of inputs and outputs
    • Will the stock trading system have to answer questions about the weather? - Perhaps if you’re buying wheat futures - Must the agent store daily temperatures or can it use another agent?

Assemble the relevant knowledge

  • You know what information is relevant
  • How can you accumulate the information?
    • Not formal description of knowledge at this point
    • Just principled understanding of where information resides

Formalize the knowledge

•Decide on vocabulary of predicates, functions,

and constants

  • Beginning to map domain into a programmatic structure
  • You’re selecting an ontology
    • A particular theory of how the domain can be simplified and represented at its basic elements
    • Mistakes here cause big problems

Converting universal quantifiers

•Universal Instantiation •Example:

after substitution {x/John}, {x/Richard}, {x/Father(John)} becomes

•We’ve replaced the variable with all possible ground terms (terms without variables)

Converting existential quantifiers

•Existential Instantiation •Example:

  • There is some thing that is a crown and is on John’s head…
  • Let’s call it C 1 becomes: •You can replace the variable with a constant symbol that does not appear elsewhere in the knowledge base •The constant symbol is a Skolem constant

Existential Instantiation

  • Only perform substitution once
    • There exists an x s.t. Kill (x, Victim)
      • Someone killed the victim
      • Maybe more than once person killed the victim
      • Existential quantifier says at least one person was killer
    • Replacement is
      • Kill (Murderer, Victim)

Complete reduction

  • Convert existentially quantified sentences
    • Creates one instantiation
  • Convert universally quantified sentences
    • Creates all possible instantiations
  • Use propositional logic to resolve

•Every first-order knowledge base and query can

be propositionalized in such a way that entailment

is preserved

Trouble ahead!

  • Universal quantification with functions:
  • What about (Father(Father(Father(John))))?
    • Isn’t it possible to have infinite number of substitutions?
    • How well will the propositional algorithms work with infinite number of sentences?

A theorem of completeness

•if

  • a sentence is entailed by the original, first-order knowledge base •then
  • there is a proof involving just a finite subset of the propositional knowledge base •We want to find that finite subset
  • First try proving the sentence with constant symbols
  • Then add all terms of depth 1: Father (Richard)
  • Then add all terms of depth 2: Father (Father (Richard))
  • …

Still more trouble

  • Completeness says that if statement is true in

first-order logic, it will also be true in

propositions

  • But what happens if you’ve been waiting for your proposition-based algorithm to return an answer and it has been a while? - Is the statement not true? - Is the statement just requiring lots of substitutions?
  • You don’t know!

The Halting Problem

•Alan Turing and Alonzo Church proved

  • You can write an algorithm that says yes to every entailed sentence but
  • You no algorithm exists that says no to every nonentailed sentence •So if your entailment-checking algorithm hasn’t returned “yes” yet, you cannot know if that’s because the sentence is not entailed. •Entailment for first-order logic is semi-decidable

Adapting Modus Ponens

•Did you notice how inefficient previous method

was?

  • Instantiate universal quantifiers by performing lots of substitutions until (hopefully quickly) a proof was found
  • Why bother substituting Richard for x when you and I know it won’t lead to a proof?
  • Clearly, John is the right substitution for x.

Modus Ponens for propositional

logic

Generalized Modus Ponens

  • For atomic sentences p (^) i, p (^) i’, θ where there is a substitution θ such that Subst{q, p (^) i’} = Subst{q, p (^) i}:

Generalized Modus Ponens

  • This is a lifted version
    • It raises Modus Ponens to first-order logic
    • We want to find lifted versions of forward chaining, backward chaining, and resolution algorithms - Lifted versions make only those substitutions that are required to allow particular inferences to proceed

Predicate Indexing

•Index the facts in the KB

  • Example: unify Knows (John, x) with Brother (Richard, John)
  • Predicate indexing puts all the Knows facts in one bucket and all the Brother facts in another - Might not be a win if there are lots of clauses for a particular predicate symbol - Consider how many people Know one another - Instead index by predicate and first argument - Clauses may be stored in multiple buckets

Subsumption lattice

  • How to construct indices for all possible queries

that unify with it

  • Example: Employs (AIMA.org, Richard)

Subsumption Lattice Subsumption lattice

  • Each node reflects making one substitution
  • The “highest” common descendent of any two nodes is the result of applying the most general unifier
  • Predicate with n arguments will create a lattice with O(2 n) nodes
  • Benefits of indexing may be outweighed by cost of storing and maintaining indices