You are on page 1of 35

Predicate Calculus

First-order logic
Whereas propositional logic assumes the world contains facts, first-order logic (like natural language) assumes the world contains Objects: people, houses, numbers, colors, baseball games, wars, Relations: red, round, prime, brother of, bigger than, part of, comes between,

And
Functions: father of, best friend, one more than, plus,

Syntax of FOL: Basic elements


Constants Predicates Functions Variables Connectives Equality Quantifiers TaoiseachJohn, 2, DIT,... Brother, >,... Sqrt, LeftLegOf,... x, y, a, b,... , , , , = ,

Atomic sentences
Atomic sentence = predicate (term1,...,termn) or term1 = term2 Term = function (term1,...,termn) or constant or variable

E.g., Brother(TaoiseachJohn,RichardTheLionheart) > (Length(LeftLegOf(Richard)), Length(LeftLegOf(TaoiseachJohn)))

Complex sentences
Complex sentences are made from atomic sentences using connectives
S, S1 S2, S1 S2, S1 S2, S1 S2,

E.g. Sibling(TaoiseachJohn,Richard) Sibling(Richard,TaoiseachJohn) >(1,2) (1,2) >(1,2) >(1,2)

Truth in first-order logic


Sentences are true with respect to a model and an interpretation Model contains objects (domain elements) and relations among them Interpretation specifies referents for
constant symbols predicate symbols function symbols objects relations functional relations

An atomic sentence predicate(term1,...,termn) is true iff the objects referred to by term1,...,termn are in the relation referred to by predicate

Universal quantification
<variables> <sentence> Everyone at DIT is smart: x At(x,DIT) Smart(x) x P is true in a model m iff P is true with x being each possible object in the model

Roughly speaTaoiseach, equivalent to the conjunction of instantiations of P


... At(TaoiseachJohn,DIT) Smart(TaoiseachJohn) At(Richard,DIT) Smart(Richard) At(DIT,DIT) Smart(DIT)

A common mistake to avoid


Typically, is the main connective with Common mistake: using as the main connective with :
x At(x,DIT) Smart(x) means Everyone is at DIT and everyone is smart

Existential quantification
<variables> <sentence> Someone at DIT is smart: x At(x,DIT) Smart(x)$

x P is true in a model m iff P is true with x being some possible object in the model

Roughly speaTaoiseach, equivalent to the disjunction of instantiations of P


At(TaoiseachJohn,DIT) Smart(TaoiseachJohn) At(Richard,DIT) Smart(Richard) At(DIT,DIT) Smart(DIT) ...

Another common mistake to avoid


Typically, is the main connective with Common mistake: using as the main connective with : x At(x,DIT) Smart(x)

is true if there is anyone who is not at DIT!

Properties of quantifiers
x y is the same as y x x y is the same as y x x y is not the same as y x x y Loves(x,y) y x Loves(x,y)
There is a person who loves everyone in the world

Everyone in the world is loved by at least one person

Quantifier duality: each can be expressed using the other x Likes(x,IceCream) x Likes(x,IceCream)

Equality
term1 = term2 is true under a given interpretation if and only if term1 and term2 refer to the same object E.g., definition of Sibling in terms of Parent:
x,y Sibling(x,y) [(x = y) m,f (m = f) Parent(m,x) Parent(f,x) Parent(m,y) Parent(f,y)]

Using FOL
The kinship domain:
Brothers are siblings
x,y Brother(x,y) Sibling(x,y)

One's mother is one's female parent


m,c Mother(c) = m (Female(m) Parent(m,c))

Sibling is symmetric
x,y Sibling(x,y) Sibling(y,x)

Knowledge engineering in FOL


1. Identify the task 2. Assemble the relevant knowledge 3. Decide on a vocabulary of predicates, functions, and constants 4. Encode general knowledge about the domain 5. Encode a description of the specific problem instance 6. Pose queries to the inference procedure and get answers 7. Debug the knowledge base

Summary
First-order logic:
objects and relations are semantic primitives syntax: constants, functions, predicates, equality, quantifiers

Semantics for Predicate Calculus


An interpretation over D is an assignment of the entities of D to each of the constant, variable, predicate and function symbols of a predicate calculus expression such that:

1: Each constant is assigned an element of D 2: Each variable is assigned a non-empty subset of D;(these are the allowable substitutions for that variable) 3: Each predicate of arity n is defined on n arguments from D and defines a mapping from Dn into {T,F} 4: Each function of arity n is defined on n arguments from D and defines a mapping from Dn into D

The meaning of an expression


Given an interpretation, the meaning of an expression is a truth value assignment over the interpretation.

Truth Value of Predicate Calculus expressions


Assume an expression E and an interpretation I for E over a non empty domain D. The truth value for E is determined by: The value of a constant is the element of D assigned to by I The value of a variable is the set of elements assigned to it by I

More truth values


The value of a function expression is that element of D obtained by evaluating the function for the argument values assigned by the interpretation The value of the truth symbol true is T The value of the symbol false is F The value of an atomic sentence is either T or F as determined by the interpretation I

Similarity with Propositional logic truth values


The value of the negation of a sentence is F if the value of the sentence is T and F otherwise The values for conjunction, disjunction ,implication and equivalence are analogous to their propositional logic counterparts

Universal Quantifier
The value for

Is T if S is T for all assignments to X under I, and F otherwise

Existential Quantifier
The value for

Is T if S is T for any assignment to X under I, and F otherwise

Some Definitions
A predicate calculus expressions S1 is satisfied. Definition If there exists an Interpretation I and a variable assignment under I which returns a value T for S1 then S1 is said to be satisfied under I. S is Satisfiable if there exists an interpretation and variable assignment that satisfies it: Otherwise it is unsatisfiable

Some Definitions

A set of predicate calculus expressions S is satisfied. Definition For any interpretation I and variable assignment where a value T is returned for every element in S the the set S is said to be satisfied,

A set of expressions is satisfiable if and only if there exist an intrepretation and variable assignment that satisfy every element If a set of expressions is not satisfiable, it is said to be inconsistent

If S has a value T for all possible interpretations , it is said to be valid

Some Definitions
A predicate calculus expressions S1 is satisfied. Definition If there exists an Interpretation I and a variable assignment under I which returns a value T for S1 then S1 is said to be satisfied under I. A set of predicate calculus expressions S is satisfied. Definition For any interpretation I and variable assignment where a value T is returned for every element in S the the set S is said to be satisfied, An inference rule is complete. Definition If all predicate calculus expressions X that logically follow from a set of expressions, S can be produced using the inference rule , then the inference rule is said to be complete.

A predicate calculus expression X logically follows from a set S of predicate calculus expressions . For any interpretation I and variable assignment where S is satisfied, if X is also satisfied under the same interpretation and variable assignment then X logically follows from S. Logically follows is sometimes called entailment

Soundness
An inference rule is sound. If all predicate calculus expressions X produced using the inference rule from a set of expressions, S logically follow from S then the inference rule is said to be sound.

Completeness
An inference Rule is complete if given a set S of predicate calculus expressions, it can infer every expression that logically follows from S

Equivalence
Recall that : See attached word document

You might also like