Está en la página 1de 10

Predicate Calculus, Toward Predicate

First-Order Logic, and Sets Calculus


Robert Stengel • Sentence
Robotics and Intelligent Systems MAE 345, – Series of words forming a
Princeton University, 2007 grammatically complete expression
of a single thought
• Predicate Calculus
– Normally contains (at least) a
– Extension of propositional calculus
subject and a predicate
– Sentence structure
• First-Order Logic • Predicate
– Further extension to include functions – That which is predicated (or said) of
the subject in a proposition
• Crisp Sets – Second term of a proposition, e.g.,
– Properties of collections of objects • Socrates is a man
• Fuzzy Sets and Control – The statement made about the
Systems subject, e.g.,
– Effects of uncertainty or imprecision • The main verb, its object, and
modifiers
Copyright 2007 by Robert Stengel. All rights reserved. For educational use only.
http://www.princeton.edu/~stengel/MAE345.html

Predicate Calculus Predicates


• Predicate, P(X)
• Extensions to propositional calculus – A statement (or proposition) about individuals (or arguments)
that is either true or false*
– Predicates
– One argument: Example: – QUEEN OF HEARTS is-red
– Variables “is-red” (true)
– LIVE GRASS is-red
– Quantification (false)
• Conversion of words to numbers – Two arguments: Example: – SEVEN is-greater-than FOUR
• Introduction of degrees of value “is-greater-than”

– Inference rules for quantifiers


• First-order logic • One-argument predicate, P(X), performs a sort
• Productive use of predicates, variables, and
quantification
• Building blocks for expert systems
* also called an atomic formula
Variable Quantification
• “Universal quantifiers say something that is true
for all possible values of a variable.”*
x : variable
• A placeholder that is to be filled with a ( forall ( x ) f )
f : formula; specifies scope of x
constant, e.g., X in P(X)
• A slot that receives a value ( forall ( x) (if (inst x fire " engine) (color x red)))
• Existential quantifiers
• A symbolic address for information ! !
– state conditions under which a variable exists
– predicate properties or relationships of one or more variables
!
(exists ( x ) f )
( forall ( x) (if ( person x) (exists ( y)(head " of x y))))
* Charniak and McDermott, 1985
!
!

Inference Rules Examples of Sentences


for Quantifiers
• LISP-like terms and prefix notation
• Well-formed formula (WFF) – (catch-object jack-1 block-1) • Jack-1 catches the object called
– Syntactically correct combination of connectives, Block-1
predicates, constants, variables, and quantifiers – (inst block-1 block) • Block-1 is an instantiation
of a block
– (color block-1 blue)
• Universal Quantification (or Elimination or Instantiation) • Block-1 is blue
– Man(Socrates) -> Mortal(Socrates) • With connectives
– or “The man, Socrates, is mortal” – (and (color block-1 yellow) • Block-1 is a yellow
(inst block-1 elephant)) elephant
• Existential Quantification (or Elimination or
– (if (supports block-2 block-1) • If block-2 supports block-1,
Instantiation) (on block-1 block-2)) then block-1 is on block-2
– Man(person) -> Happy(person) – (if (and (inst clyde elephant) • If clyde is an elephant and
– Someone is happy (color elephant gray)) (color an elephant is gray, then
clyde gray)) clyde is gray
• Existential Introduction
– Man(Jerry) -> Likes_ice_cream(Jerry)
– Someone likes ice cream
Command vs. Verbs and Nouns in Apollo
Guidance Computer Program
Decision in the AGC Verb Code Description
01 Display 1st component of
Remarks
Octal display of data
• Sentence 02 Display 2nd component of
on REGISTER 1
Octal display of data
– Subject and predicate on REGISTER 1
03 Display 3rd component of Octal display of data
– Subject is implied on REGISTER 1
• Astronaut, or
• GNC system
– Sentence describes action Noun Code Description Scale/Units
to be taken employing or 01 Specify machine address XXXXX
involving the object 02 Specify machine address XXXXX
03 (Spare)
• Predicate 04 (Spare)
– Verb = Action 05 Angular error XXX.XX degrees
– Noun = Variable or 06 Pitch angle XXX.XX degrees
Program Heads up-down +/- 00001
See http://apollo.spaceborn.dk/dsky-sim.html 07 Change of program or major mode
And http://www.ibiblio.org/apollo/ for simulation
11 Engine ON enable

Verbs and Nouns in First-Order Logic


Apollo Guidance
Computer Program • Further extensions to predicate
calculus
• Verbs (Actions)
– Display
• Selected Nouns
(Variables)
• Selected Programs
(CM)
• Functions
– Checklist – AGC Idling


Enter
Monitor – Self-test ON/OFF – Gyro Compassing
– Fixed number of arguments
– Star number
– Write
– Failure register


LET Abort
Landmark Tracking
– Rather than returning TRUE or FALSE,
– Terminate
– Start code – Ground Track functions return objects, e.g.,
– Change – Event time Determination
– Align – Inertial velocity – Return to Earth • “uncle-of” Mary returns John
– Altitude – SPS Minimum


Lock
Set – Latitude Impulse – Functions of functions, e.g.,
– Miss distance – CSM/IMU Align
– Return
– Final Phase
• (father-of (father-of (John)) returns John!s
– Test – Delta time of burn
– Velocity to be – First Abort Burn paternal grandfather
– Calculate
gained
– Update
Towers of Hanoi:
First-Order Logic An Axiomatic System
(Barr and Feigenbaum)
• Equals
– Two individuals are equal if and only if
(equivalence) they are indistinguishable under all
predicates and functions • Problem: Move all disks (one at a time) from
1st peg to 3rd peg without putting a larger disk
X "Y if and only if
on a smaller disk
P(X) " P(Y ), F(X) " F(Y ), #P $ F
• Objects • Predicates
• Axiomatization – Disks: 1, 2, 3, 4, 5 – Sorting: DISK, PEG
– Axioms: necessary relationships between objects – Pegs: A, B, C • DISK(A) is FALSE
! in a domain • PEG(A) is TRUE
– Formal expression in sentences of first-order – Comparison: SMALLER
! logic (emphasis on syntax over semantics) • SMALLER(1,2) is TRUE

Towers of Hanoi Towers of Hanoi


• Second axiom
• First axiom " X S. FREE(X,S) # ¬$ Y . (ON(Y, X,S ))
"XYZ.(SMALLER(X,Y ) # (SMALLER(Y,Z)) $ SMALLER(X,Z)
• More Predicates
• Premise
– Acceptable (legal) move: LEGAL (X,Y,S)
SMALLER(1,2) "SMALLER(2,3) – Act of moving disk: MOVE(X,Y,S)
! !
• Situational constant, S • Object of analysis
– Identifies state of system after a series of moves – Find a situation that is TRUE if a move is legal
! and is accomplished
• More predicates
– Vertical relationship: ON • More Axioms
• ON(X,Y,S) asserts that disc X is on disk Y in situation S – See Handbook of AI for additional steps
– Nothing on top of disk: FREE Example of theorem proving, i.e., of
• FREE(X,S) indicates that no disc is on X theory that a goal state can be reached
Venn Diagrams (Naïve or Intuitive)
John Venn Set Theory Georg
Cantor
• A: All mammals
• Deals with the properties of well-defined
• B: All aquatic animals
collections of objects
• C: All gray, hairless
objects • Universal set = Universe of discourse = U
• A & B: Whales, – Contains all elements of possible concern in a
dolphin, seals, … particular context
• B & C: Fish, clams, • A = a particular set in U
whales, dolphins, … – defined in a list or rule, or
• A, B, &C: Whales, – by a membership function describing elements
dolphins, … (or members) of the set
Axiomatic set theory: Formalisms for general rather than specific sets

Membership in a Set
Set Theory • A = a particular set in U
– defined in a list or rule, or
– by a membership function
describing elements (or
• List members) of the set
• Universal set = guests at a party
A = {x, y,z,...} Ordering of elements is not important • Particular sets
– Current graduate students
A = (x, y,z,...) Ordering of elements is important – Alumni
– Spouses
• Rule – Friends of students
– Children
! A = { x " U x meets some conditions} e.g., – Same family
– Visitors
! A = { x " U : x meets some conditions} A = { x " U : g(x) # 0} – Pilots
– Teachers
• Membership function, µ – Managers
$1, if x " A – Military officers
µA (x) = % ! ": belongs to – Women and men
! &0, if x # A – US citizens or foreign nationals

!
Operations on Sets Properties of Sets
• Complement • Empty (null) set
• Union of sets • Intersection of sets
A'= U " A " = A # A or = U # U
C = A" B C = A" B • Reflexive property • Symmetry property
– Relationships that bear – Relationship of first to
same effect on own set as second set is the same as
• One-to-one correspondence • Proper Subset on other sets second to first set
! e.g., A = A !
A=B B " A, and e.g., A = B, B = A
! For example, as when
! • Transivity property
A = {x, y, z} B#A – Two sets bear same
relationship to a third set
• Equivalence
B = {4, 3, 9}; then x = 4. y = 3, and z = 9 – Reflexivity + Symmetry +
... in which case, A “is greater than” B Transivity
! e.g., if A > B and B > C,
! A"B !
then A > C
! A ~ B or A " B

! !
!
What If Sets Have Uncertain or
Hard and Soft Thinking
Contradictory Membership?
• Problem-solving approaches
– Logical / Metaphorical
• Example: U = All – Reasonable / Dream-like
the cars in Berkeley – Serious / Humorous
– Definite / Ambiguous
A = { x " U x has 4 cylinders} – Consistent / Paradoxical
B = { x " U x has 6 cylinders} – Laborious / Playful
– Exact / Approximate
• What makes a car “US”? – Real / Fantastic
– US cars may contain – Focused / Diffuse
! foreign parts – Analytical / Illogical
– Foreign cars may contain – Specific / General
List?
US parts – Mature / Immature
Rule?
• How should we define Sets E Membership function?
and F? • Crisp / Fuzzy
Fuzzy Experiment Fuzzy Sets
• Fuzzy membership function, µA(x)
µA(x) takes any value in [0, 1]
• What does each
• Fuzzy set, E
term mean?
E = { x " U [ x, µE (x)]}
A few ! x
Several " x • U = All the cars in Berkeley
A lot # x µD(x) = p(x) = percentage of domestic parts
µF(x) = 1 – p(x) = percentage of foreign parts
!
• Normalize results so that the maximum is 1 • Membership functions express a subjective utility that may
be rigorous (e.g., based on probability) or not
• Normalized plots are fuzzy membership • “If 46% of a car!s parts are domestic, it probably is a foreign
functions car”

Fuzzy Membership Fuzzy Set Definitions


Functions
• “Close to zero” • “Probably not y”
• Support of a fuzzy set
supp(A) = { x " U µA (x) > 0}
• Center of a fuzzy set
– Two-sided: center = mean
! value
• “About y” • “Young/old”
– Left-sided: center = max (x)
for which µ(x) = 1
– Right-sided: center = min (x)
for which µ(x) = 1
Fuzzy Logic More Fuzzy Logic
Operations Operations
• Union of sets
• Equivalence of sets
A" B
A~B
if andonlyif µA "B (x) = max[µA (x), µB (x)] # x $ U
if andonlyif µA (x) = µB (x) " x # U
• Intersection of sets
A" B • Complement of sets
! if andonlyif µA "B (x) = min[µA (x), µB (x)] # x $ U U"A
• A contains B ! if andonlyif µA' (x) = 1" µA (x) # x $ U
A"B
Fuzzy logic is a generalization of crisp logic based
! if andonlyif µA (x) # µB (x) $ x % U on the definition of the membership function

!
Linguistic (Mamdani) Fuzzy Cement Kiln
Control Systems (after Schramm)
• Antecedent and consequent are both fuzzy propositions
– e.g., “If error is small and error rate is negative, then control
command is small”
– What are “small”, “medium”, and “large”?
• Must “fuzzify” physical error/rate, apply fuzzy rules, and “de-
fuzzify” control command
Cement Kiln Fuzzy Controller for
Operator!s Manual Cement Kiln (from Wang)
• Linguistic Controller
– Antecedents
• BZ: Temperature in burning zone
• OX: Oxygen in exhaust gas
• BE: Temperature at end of kiln
– Consequents
• CR: Coal feed rate
• DP: Exhaust damper position
– 27 fuzzy rules, e.g.,
• If BZ is OK and OX is low and BE is low, then CR is
large, and DP is large

Controller is apparently symbolic, but symbols


must have values for computation

Need for Failure-Tolerant Control Systems Probable Cause


The National Transportation Safety Board
determines that the probable cause of the USAir
flight 427 accident was a loss of control of the
airplane resulting from the movement of the
rudder surface to its blowdown limit. The rudder
surface most likely deflected in a direction
opposite to that commanded by the pilots as a
result of a jam of the main rudder PCU servo
valve secondary slide to the servo valve housing
offset from its neutral position and overtravel of
the primary slide.
Gain-Scheduling (Takagi-Sugeno)
Fuzzy Control Systems Fuzzy Logic " Fuzzy Thinking
(Schramm, Gopisetty, and Stengel, 1998)

• Quantitative approach to reasoning under


uncertainty
• “Possibility theory” vs. Probability theory
(Lotfi Zadeh, 1978)
• Relationship to other uncertainty belief
systems of artificial intelligence, e.g.,
– Bayesian belief network
– Dempster-Shafer theory
– Transferable belief model
– Certainty factors

Next Time:
Expert Systems: Inference
and Knowledge
Representation

También podría gustarte