PROPOSISTION LOGIC IN ARTIFICIAL INTELLIGENCE

RaghavendraPrasad179187 0 views 35 slides Oct 14, 2025
Slide 1
Slide 1 of 35
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35

About This Presentation

Propositional logic is a branch of mathematics that studies the relationships between complete statements (propositions), which are either true or false. It uses symbols to represent these propositions and logical connectives (like AND, OR, NOT) to build complex statements, analyzing whether an argu...


Slide Content

Notes 8:
Predicate logic and inference
ICS 270a Spring 2003

Outline
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

Propositional logic is not
expressive
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

Syntax
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
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))

Wffs sentences
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))
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
 ,,,

Semantics: Worlds
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

Semantics: Interpretation
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…

Semantics: Models
An interpretation satisfies a well-formed formula (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

Example of models
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>}

Quantification
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.
)( )( xMammalxCatx 
,,,,
)()(
)()(
)()(



FelixMammalFelixCat
RebbekaMammalRebbekaCat
SpotMammalSpotCat

Quantification: Existential
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.

)(),( xCatspotxxSister 
d)...Cat(Richarhard,Spot)Sister(Ric
Cat(Felix)ix,Spot)Sister(Fel
a)Cat(Rebeccecca,Spot)Sister(Reb
Cat(Spot)Spot)tSister(Spo



,

Useful Equivalences
De Morgan laws
Inference rules:

Universal instantiation: foall x f(x) |-- f(alpha)

Existential generalization: from f(alpha) |-- exist x f(x)

Modeling a domain;
Conceptualization
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

Resolution in the predicate calculus
Unification

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

Inference Rules in FOL
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
Existential introduction

From Likes(Jerry,IceCream) we can infer exists x Likes(x,IceCream)

Predicate calculus resolution
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 
1
 
2
leaving out
complementary literals
Example:
xyfsubst
CxRAxPCBQAyfP


)(
)},(),({)},,()),(({

Converting to clause form
),(
)27,(
)28,()27,(
)(),(
),()28,()27,()()( ,
ABS
BI
AIAI
BPAP
yxSyIxIyPxPyx




Example: Answer Extraction

Example: Resoluction Refutation
Prove I(A,27)

Rule-Based Systems
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

Forward Chaining Procedure
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

Example: Zoo Rulebase
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!

Where do the rules come from ?
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

Inference Network Representation
We can represent forward chaining with rules as a network:
has hair
eats meat
tawny color
black stripes
has a tail
is a tiger
is a carnivore
is a mammal

Inference using Backward Chaining
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)
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
eats meat
tawny color
black stripes
is a tiger
is a carnivore
is a mammal
forward pointing eyes
has claws
has teeth

Backward Chaining Procedure
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

Forward Chaining or Backward
Chaining:
which is better?
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?

What is a rule-based expert system
(ES)?
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

Examples of Expert Systems
1965 DENDRAL Stanfordanalyze mass spectrometry data
1965 MACSYMA MIT symbolic mathematics problems
1972 MYCIN Stanforddiagnosis of blood diseases
1972 Prospector SRI Mineral Exploration
1975 Cadeceus U. of PITTInternal Medicine
1978 DIGITALIS MIT digitalis therapy advise
1979 PUFF Stanfordobstructive airway diseases
1980 R1 CMU computer configuration
1982 XCON DEC computer configuration
1983 KNOBS MITRE mission planning
1983 ACE AT&T diagnosis faults in telephone cables
1984 FAITH JPL spacecraft diagnosis
1986 ACES Aerospacesatellite anomaly diagnosis
1986 Cambpelldiagnose cooker malfunctions
1986 DELTA/CATS GE diagnosis of diesel locomotives
1987 AMEX credit authorization
1992 MAX NYNEX telephone network troubleshooting
1995 CaltechPacBell network management
1997 UCI planning drug treatment for HIV

Mycin: Diagnosis and treatment of
blood diseases
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)

The XCON Application
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

Limitations of Rule-Based
Representations
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)

Summary
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
Tags