- 95 Views
- Uploaded on
- Presentation posted in: General

Notes 8: Predicate logic and inference

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Notes 8:Predicate logic and inference

ICS 270a Spring 2003

- New ontology
- objects,relations,properties,functions.

- New Syntax
- Constants, predicates,properties,functions

- New semantics
- meaning of new syntax

- Inference rules for Predicate Logic (FOL)
- Resolution
- Forward-chaining, Backword-chaining
- unification

- Readings: Nillson’s Chapters 15-16, Russel and Norvig Chapter 8, chapter 9

- Needs to refer to objects in the world,
- Needs to express general rules
- On(x,y) à ~ clear(y)
- All man are mortal
- Everyone who passed age 21 can drink
- One student in this class got perfect score
- Etc….

- First order logic, also called Predicate calculus allows more expressiveness

- Components
- Infinite set of object constants, alphanumerc strings
- Bb, 12345, Jerusalem, 270a, Irvine

- Function constants of all aritys (convention: start with lower case)
- motherOf, times, greaterThan, color

- Relation constants, Predicates of all aritys (start with capital)
- B21, Parent, multistoried, XYZ, prime

- Infinite set of object constants, alphanumerc strings
- Terms
- An object constant is a term
- A function constant of arity n followed by n terms in parenthesis is a term (called functional expression)
- motherOf(Silvia), Sam, leftlegof(John), add1(5), times(5,plus(3,6))

- An atomic sentence is formed from a predicate (relation) symbol followed by a parenthesized list of symbols
- Atoms: a relation constant (predicate) followed by n terms in parenthesis seperated by commas.
- GreaterThan(6,3), Q, Q(A,B,C,D), Brother(Richard,John)
- Married(FatherOf(Richard),MotherOf(John))

- Atoms: a relation constant (predicate) followed by n terms in parenthesis seperated by commas.
- Complex propositional wffs:
- Use logic connectives:
- Brother(Richard,John) /\ Brother(John,Richard)
- Older(John,30) V Younger(John,30)
- Older(John) --> ~Younger(John,30) V P

- The world consists of objects that has properties.
- There are relations and functions between these objects
- Objects in the world, individuals: people, houses, numbers, colors, baseball games, wars, centuries
- Clock A, John, 7, the-house in the corner, Tel-Aviv

- Functions on individuals:
- father-of, best friend, third inning of, one more than

- Relations:
- brother-of, bigger than, inside, part-of, has color, occurred after

- Properties (a relation of arity 1):
- red, round, bogus, prime, multistoried, beautiful

- An interpretation of a wff is an assignment that maps
- object constants to objects in the worlds,
- n-ary function symbols to n-ary functions in the world,
- n-ary relation symbols to n-ary relations in the world

- Given an interpretation, an atom has the value “true” in case it denotes a relation that holds for those individuals denoted in the terms. Otherwise it has the value “false”
- Example: A,B,C,floor,
- On, Clear

- World:
- On(A,B) is false, Clear(B) is true, On(C,F1) is true…

- Example: A,B,C,floor,

- An interpretation satisfies a wff (sentence) if the wff has the value “true” under the interpretation.
- An interpretation that satisfies a wff is a model of that wff
- Any wff that has the value “true” under all interpretations is valid
- Any wff that does not have a model is inconsistent or unsatisfiable
- If a wff w has a value true under all the models of a set of sentences delta then delta logically entails w

- The formulas:
- On(A,F1) Clear(B)
- Clear(B) and Clear(C) On(A,F1)
- Clear(B) or Clear(A)
- Clear(B)
- Clear(C)
Possible interpretations which are models:

On = {<B,A>,<A,floor>,<C,Floor>}

Clear = {<C>,<B>}

- Universal and existential quantifiers allow expressing general rules with variables
- Universal quantification
- All cats are mammals
- It is equivalent to the conjunction of all the sentences obtained by substitution the name of an object for the variable x.

- Syntax: if w is a wff then (forall x) w is a wff.

- Existential quantification : an existentially quantified sentence is true in case one of the disjunct is true
- Equivalent to disjunction:
- We can mix existential and universal quantification.

- De Morgan laws
- Inference rules:
- Universal instantiation: foall x f(x) |-- f(alpha)
- Existential generalization: from f(alpha) |-- exist x f(x)

- The kinship domain:
- object are people
- Properties include gender and they are related by relations such as parenthood, brotherhood,marriage
- predicates: Male, Female (unary) Parent,Sibling,Daughter,Son...
- Function:Mother Father

- Unification
- Algorithm unify

- Using unification in predicate calculus resolution
- Completeness and soundness
- Converting a wff to clause form
- The mechanics of resolution
- Answer extraction

- All the inference rules for propositional logic applies and additional three rules that use substitution; assigning constants to variables
- Subst(x/constant)
- Subst({x/Sam,y/Pam},Likes(x,y)) = Likes(Sam,Pam)

- Universal elimination
- From fromall x Likes(x,IceCream) we can substitute {x/Ben} and infer Likes(Ben,IceCream)

- Existential Elimination
- For any sentence and for any symbol k that does not appear elsewhere in the knowledge-base
- exists x Kill(x,Victim) we can infer Kill(Murderer,victim)

- As long as Murdered soes not appear anywhere

- For any sentence and for any symbol k that does not appear elsewhere in the knowledge-base
- Existential introduction
- From Likes(Jerry,IceCream) we can infer exists x Likes(x,IceCream)

- Suppose the 1 and 2 are two clauses represented as set of literals. If there is an atom in 1 and a literal ~ in 2 such as and have a common unifier
- Then these two clauses have a resolvent row. It is obtained by applying the substitution to 12 leaving out complementary literals
- Example:

Example: Answer Extraction

Example: Resoluction Refutation Prove I(A,27)

- Rule-based Knowledge Representation and Inference
- combines rules
- if DOG(x) then TAIL(X)

- with working memory,
- DOG(SPOT)
- DOG(LUNA)

- is not a formal knowledge representation scheme like logic
- somewhat like a combination of propositional and FOPL
- uses simple methods for inference
- often combined with other mechanisms such as inheritance
- motivated by practical use rather than theoretical properties
- also has some basis in cognitive models

- combines rules

While (rules can still fire or goal is not reached)

for each rule in the rulebase which has not fired

1. try to bind premises by matching to

assertions in WM

2. if all premises in a rule are supported then assert

the conclusion and add to WM

Repeat 1. and 2. for all matching/ instantiation alternatives

end

continue

- Want to identify animals based on their characteristics
- could have rules like
- if A1 and A2 and A3.....and A27 then animal is a monkey
- i.e., one very specific rule per animal

- Better to use intermediate concepts
- e.g., the intermediate concept of a mammal
- if ?x is a mammal and B1...and B3 then ?x is a monkey

- Why are intermediate concepts useful?
- rules are easier to create
- rulebase is easier to maintain
- easier to perform inference
- however: finding good intermediate concepts is non-trivial!

- Manual Knowledge Acquisition
- interview experts
- expert describes the rules
- process of translating expert knowledge into a formal representation is also known as knowledge engineering
- this is notoriously difficult
- experts are often very poor at explicitly describing what they do
- e.g., ask Michael Jordan how he plays basketball or ask Tiger Woods how he plays golf

- Automated Knowledge Acquisition
- derive rules automatically from formal specifications
- e.g., by automatic analysis of solution manuals

- machine learning
- learn rules from data

- derive rules automatically from formal specifications

- We can represent forward chaining with rules as a network:

has hair

is a mammal

eats meat

is a carnivore

is a tiger

tawny color

black stripes

has a tail

- Establish a hypothesis
- e.g., Tony is a tiger
- a hypothesis is as assertion whose truth we wish to test
- i.e., assert the hypothesis
- see if that is consistent with other data

- Work backwards, i.e.,
- match the hypothesis to the conclusion of the rules
- look at the premise conditions of the rule
- if these are unknown,
- declare these as intermediate hypotheses
- backward chain recursively (depth-first manner)

- if these are unknown,

- Can use search algorithms to control how backward chaining proceeds

Inference Network Representation of Backward Chaining

- We can represent backward chaining as a network:

has hair

is a mammal

eats meat

is a carnivore

forward pointing eyes

has claws

has teeth

is a tiger

tawny color

black stripes

While (unsupported hypotheses exist or goal is not reached)

for each hypothesis H

for each rule R whose conclusion matches with H

try to support each rule’s premises by

1. matching assertions in WM

2. recursively applying backward chaining

if rule’s premises are supported

conclude that H is true

end

end

continue

- Which direction is better depends on the circumstances
- 4 main factors of relevance
- the number of possible start states and number of possible goal states
- smaller is better

- the branching factor in each direction
- smaller is better

- what type of explanation the user wants
- more natural explanations may be important

- the typical action which triggers a rule
- i.e., data-driven or hypothesis-driven?

- the number of possible start states and number of possible goal states

- ES performs a task in limited domains that require human expertise
- medical diagnosis; fault diagnosis; status monitoring; data interpretation; mineral exploration; credit checking; tutoring; computer configuration

- ES solves problems by application of domain specific knowledge rather than weak methods.
- Domain knowledge is acquired by interviewing human experts
- ES can explain a problem solution in human-understandable terms
- ES cannot operate in situations that call for common sense

1965DENDRALStanfordanalyze mass spectrometry data

1965MACSYMAMITsymbolic mathematics problems

1972MYCINStanforddiagnosis of blood diseases

1972ProspectorSRIMineral Exploration

1975CadeceusU. of PITTInternal Medicine

1978DIGITALISMITdigitalis therapy advise

1979PUFFStanfordobstructive airway diseases

1980R1CMUcomputer configuration

1982XCONDECcomputer configuration

1983KNOBSMITREmission planning

1983ACEAT&Tdiagnosis faults in telephone cables

1984FAITHJPLspacecraft diagnosis

1986ACESAerospacesatellite anomaly diagnosis

1986Cambpelldiagnose cooker malfunctions

1986DELTA/CATSGEdiagnosis of diesel locomotives

1987AMEXcredit authorization

1992MAXNYNEXtelephone network troubleshooting

1995CaltechPacBell network management

1997UCIplanning drug treatment for HIV

RULES

PREMISE ($AND (SAME CNTXT GRAM GRAMNEG)

(SAME CNTXT MORH ROD)

(SAME CNTXT AIR AEROBIC))

ACTION: (CONCLUDE CNTXT CLASS ENTEROBACTERIACEAE .8)

If the stain of the organism is gramneg, and

the morphology of the organism is rod, and

the aerobicity of the organism is aerobic

THEN there is strongly suggestive evidence (.8) that

the class of organism is enterocabateriaceae

DATA

ORGANISM-1:

GRAM = (GRAMNEG 1.0)

MORP = (ROD .8) (COCCUS .2)

AIR = (AEROBIC .6)(FACUL .4)

- A rule-based expert system
- expert in the sense that the rules capture expert design knowledge
- addresses a design/configuration problem

- Digital Equipment Corporation (or Compaq by now!)
- XCON = rule-based expert system for computer configuration
- decides how peripherals are configured on new orders
- has 10,000 rules
- developed in early 1980’s
- based on “reactive rule-based systems”
- if antecedents then action
- forward chaining in style

- estimated to have saved DEC several hundred million $’s

- Can be difficult to create
- the “knowledge engineering” problem

- Can be difficult to maintain
- in large rule-bases, adding a rule can cause many unforeseen interactions and effects => difficult to debug

- Many types of knowledge are not easily represented by rules
- uncertain knowledge: “if it is cold it will probably rain”
- information which changes over time
- procedural information (e.g. a sequence of tests to diagnose a disease)

- Knowledge Representation methods
- formal logic
- rule-based systems (less formal)

- Rule-based representations are composed of
- Working memory:
- Rules

- Inference occurs by
- forward or backward chaining

- Rule-based expert systems
- useful for certain classes of problems which do not have direct algorithmic solutions
- have their limitations