0% found this document useful (0 votes)
66 views9 pages

AI Tut Sheet 1

This document provides an overview of predicate logic and first-order logic. It defines predicate logic as dealing with predicates, which are propositions that consist of variables. It then defines key concepts in first-order logic including predicates, quantifiers, atomic and complex sentences, subjects and predicates. The document explains the syntax of first-order logic including basic elements like constants, variables, predicates, functions, connectives, equality and quantifiers. It also discusses atomic and complex sentences. Finally, it covers universal and existential quantifiers, their properties, and provides examples of first-order logic statements using quantifiers.

Uploaded by

Sudesh Kansra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views9 pages

AI Tut Sheet 1

This document provides an overview of predicate logic and first-order logic. It defines predicate logic as dealing with predicates, which are propositions that consist of variables. It then defines key concepts in first-order logic including predicates, quantifiers, atomic and complex sentences, subjects and predicates. The document explains the syntax of first-order logic including basic elements like constants, variables, predicates, functions, connectives, equality and quantifiers. It also discusses atomic and complex sentences. Finally, it covers universal and existential quantifiers, their properties, and provides examples of first-order logic statements using quantifiers.

Uploaded by

Sudesh Kansra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Predicate Logic

Predicate Logic deals with predicates, which are propositions, consist of variables.

Predicate Logic - Definition

A predicate is an expression of one or more variables determined on some specific


domain. A predicate with variables can be made a proposition by either authorizing a
value to the variable or by quantifying the variable.

The following are some examples of predicates.


r E(x, y) denote "x = y"

o Consider X(a, b, c) denote "a + b + c = 0"


o Consider M(x, y) denote "x is married to y."

Quantifier:
The variable of predicates is quantified by quantifiers. There are two types of
quantifier in predicate logic - Existential Quantifier and Universal Quantifier.

Existential Quantifier:
If p(x) is a proposition over the universe U. Then it is denoted as ∃x p(x) and read as
"There exists at least one value in the universe of variable x such that p(x) is true. The
quantifier ∃ is called the existential quantifier.

There are several ways to write a proposition, with an existential quantifier, i.e.,

(∃x∈A)p(x)    or    ∃x∈A    such that p (x)    or    (∃x)p(x)    or    p(x) is true for some x
∈A.

Universal Quantifier:
If p(x) is a proposition over the universe U. Then it is denoted as ∀x,p(x) and read as
"For every x∈U,p(x) is true." The quantifier ∀ is called the Universal Quantifier.

There are several ways to write a proposition, with a universal quantifier.

∀x∈A,p(x)    or    p(x), ∀x ∈A      Or    ∀x,p(x)    or    p(x) is true for all x ∈A.

Negation of Quantified Propositions:


When we negate a quantified proposition, i.e., when a universally quantified
proposition is negated, we obtain an existentially quantified proposition,and when an
existentially quantified proposition is negated, we obtain a universally quantified
proposition.

The two rules for negation of quantified proposition are as follows. These are also
called DeMorgan's Law.

Example: Negate each of the following propositions:

1.∀x p(x)∧ ∃ y q(y)

Sol: ~.∀x p(x)∧ ∃ y q(y))


      ≅~∀ x p(x)∨∼∃yq (y)        (∴∼(p∧q)=∼p∨∼q)
      ≅ ∃ x ~p(x)∨∀y∼q(y)

2. (∃x∈U) (x+6=25)

Sol: ~( ∃ x∈U) (x+6=25)


      ≅∀ x∈U~ (x+6)=25
      ≅(∀ x∈U) (x+6)≠25

3. ~( ∃ x p(x)∨∀ y q(y)

Sol: ~( ∃ x p(x)∨∀ y q(y))


      ≅~∃ x p(x)∧~∀ y q(y)        (∴~(p∨q)= ∼p∧∼q)
      ≅ ∀ x ∼ p(x)∧∃y~q(y))

Propositions with Multiple Quantifiers:


The proposition having more than one variable can be quantified with multiple
quantifiers. The multiple universal quantifiers can be arranged in any order without
altering the meaning of the resulting proposition. Also, the multiple existential
quantifiers can be arranged in any order without altering the meaning of the
proposition.

The proposition which contains both universal and existential quantifiers, the order
of those quantifiers can't be exchanged without altering the meaning of the
proposition, e.g., the proposition ∃x ∀ y p(x,y) means "There exists some x such that p
(x, y) is true for every y."

Example: Write the negation for each of the following. Determine whether the
resulting statement is true or false. Assume U = R.
1.∀ x ∃ m(x2<m)

Sol: Negation of ∀ x ∃ m(x2<m) is ∃ x ∀ m (x2≥m). The meaning of ∃ x ∀ m (x2≥m) is


that there exists for some x such that x2≥m, for every m. The statement is true as
there is some greater x such that x2≥m, for every m.

2. ∃ m∀ x(x2<m)

Sol: Negation of ∃ m ∀ x (x2<m) is ∀ m∃x (x2≥m). The meaning of ∀ m∃x (x2≥m) is


that for every m, there exists for some x such that x 2≥m. The statement is true as for
every m, there exists for some greater x such that x 2≥m.

First-Order Logic in Artificial intelligence


In the topic of Propositional logic, we have seen that how to represent statements
using propositional logic. But unfortunately, in propositional logic, we can only
represent the facts, which are either true or false. PL is not sufficient to represent the
complex sentences or natural language statements. The propositional logic has very
limited expressive power. Consider the following sentence, which we cannot
represent using PL logic.

o "Some humans are intelligent", or


o "Sachin likes cricket."

To represent the above statements, PL logic is not sufficient, so we required some


more powerful logic, such as first-order logic.

First-Order logic:
o First-order logic is another way of knowledge representation in artificial intelligence.
It is an extension to propositional logic.
o FOL is sufficiently expressive to represent the natural language statements in a
concise way.
o First-order logic is also known as Predicate logic or First-order predicate logic.
First-order logic is a powerful language that develops information about the objects
in a more easy way and can also express the relationship between those objects.
o First-order logic (like natural language) does not only assume that the world contains
facts like propositional logic but also assumes the following things in the world:
o Objects: A, B, people, numbers, colors, wars, theories, squares, pits,
wumpus, ......
o Relations: It can be unary relation such as: red, round, is adjacent, or n-any
relation such as: the sister of, brother of, has color, comes between
o Function: Father of, best friend, third inning of, end of, ......
o As a natural language, first-order logic also has two main parts:

a. Syntax
b. Semantics

Syntax of First-Order logic:


The syntax of FOL determines which collection of symbols is a logical expression in
first-order logic. The basic syntactic elements of first-order logic are symbols. We
write statements in short-hand notation in FOL.

Basic Elements of First-order logic:


Following are the basic elements of FOL syntax:

Constant 1, 2, A, John, Mumbai, cat,....

Variables x, y, z, a, b,....
Predicates Brother, Father, >,....

Function sqrt, LeftLegOf, ....

Connectives ∧, ∨, ¬, ⇒, ⇔

Equality ==

Quantifier ∀, ∃

Atomic sentences:
o Atomic sentences are the most basic sentences of first-order logic. These sentences
are formed from a predicate symbol followed by a parenthesis with a sequence of
terms.
o We can represent atomic sentences as Predicate (term1, term2, ......, term n).

Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).


                Chinky is a cat: => cat (Chinky).

Complex Sentences:
o Complex sentences are made by combining atomic sentences using connectives.

First-order logic statements can be divided into two parts:

o Subject: Subject is the main part of the statement.


o Predicate: A predicate can be defined as a relation, which binds two atoms together
in a statement.

Consider the statement: "x is an integer.", it consists of two parts, the first part x is
the subject of the statement and second part "is an integer," is known as a predicate.

Quantifiers in First-order logic:


o A quantifier is a language element which generates quantification, and quantification
specifies the quantity of specimen in the universe of discourse.
o These are the symbols that permit to determine or identify the range and scope of
the variable in the logical expression. There are two types of quantifier:

a. Universal Quantifier, (for all, everyone, everything)


b. Existential quantifier, (for some, at least one).

Universal Quantifier:
Universal quantifier is a symbol of logical representation, which specifies that the
statement within its range is true for everything or every instance of a particular
thing.

The Universal quantifier is represented by a symbol ∀, which resembles an inverted A.

Note: In universal quantifier we use implication "→".

If x is a variable, then ∀x is read as:

o For all x
o For each x
o For every x.

Example:
All man drink coffee.

Let a variable x which refers to a cat so all x can be represented in UOD as below:
∀x man(x) → drink (x, coffee).

It will be read as: There are all x where x is a man who drink coffee.

Existential Quantifier:
Existential quantifiers are the type of quantifiers, which express that the statement
within its scope is true for at least one instance of something.

It is denoted by the logical operator ∃, which resembles as inverted E. When it is used


with a predicate variable then it is called as an existential quantifier.

Note: In Existential quantifier we always use AND or Conjunction symbol ( ∧).

If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:

o There exists a 'x.'


o For some 'x.'
o For at least one 'x.'

Example:
Some boys are intelligent.
∃x: boys(x) ∧ intelligent(x)

It will be read as: There are some x where x is a boy who is intelligent.

Points to remember:
o The main connective for universal quantifier ∀ is implication →.
o The main connective for existential quantifier ∃ is and ∧.

Properties of Quantifiers:
o In universal quantifier, ∀x∀y is similar to ∀y∀x.
o In Existential quantifier, ∃x∃y is similar to ∃y∃x.
o ∃x∀y is not similar to ∀y∃x.

Some Examples of FOL using quantifier:

1. All birds fly.


In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as follows.
              ∀x bird(x) →fly(x).

2. Every man respects his parent.


In this question, the predicate is "respect(x, y)," where x=man, and y= parent.
Since there is every man so will use ∀, and it will be represented as follows:
              ∀x man(x) → respects (x, parent).

3. Some boys play cricket.


In this question, the predicate is "play(x, y)," where x= boys, and y= game. Since
there are some boys so we will use ∃, and it will be represented as:
              ∃x boys(x) → play(x, cricket).

4. Not all students like both Mathematics and Science.


In this question, the predicate is "like(x, y)," where x= student, and y= subject.
Since there are not all students, so we will use ∀ with negation, so following
representation for this:
              ¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].

5. Only one student failed in Mathematics.


In this question, the predicate is "failed(x, y)," where x= student, and y= subject.
Since there is only one student who failed in Mathematics, so we will use following
representation for this:
              ∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧ student(y)
→ ¬failed (x, Mathematics)].

Free and Bound Variables:


The quantifiers interact with variables which appear in a suitable way. There are two
types of variables in First-order logic which are given below:

Free Variable: A variable is said to be a free variable in a formula if it occurs outside


the scope of the quantifier.

          Example: ∀x ∃(y)[P (x, y, z)], where z is a free variable.

Bound Variable: A variable is said to be a bound variable in a formula if it occurs


within the scope of the quantifier.

          Example: ∀x [A (x) B( y)], here x and y are the bound variables.

You might also like