0% found this document useful (0 votes)
17 views

Unit 3

The document discusses concepts in logical artificial intelligence including propositional logic, natural deductions, and rules of inference. It provides examples of propositional logic including atomic and compound propositions. Propositional logic represents the simplest form of logic using propositions that can be true or false. The document also outlines syntax and rules for propositional logic, including introduction and elimination rules for conjunction, implication, and truth. It describes natural deduction systems for representing proofs in a tree or sequential format.

Uploaded by

skrao
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Unit 3

The document discusses concepts in logical artificial intelligence including propositional logic, natural deductions, and rules of inference. It provides examples of propositional logic including atomic and compound propositions. Propositional logic represents the simplest form of logic using propositions that can be true or false. The document also outlines syntax and rules for propositional logic, including introduction and elimination rules for conjunction, implication, and truth. It describes natural deduction systems for representing proofs in a tree or sequential format.

Uploaded by

skrao
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Unit 3

LOGIC CONCEPTS
Logical AI involves representing knowledge of an agent's world, its goals and
the current situation by sentences in logic. The agent decides what to do by
inferring that a certain action or course of action is appropriate to achieve the
goals. We characterize briefly a large number of concepts that have arisen in
research in logical AI. Reaching human-level AI required programs that deal
with the common sense informatic situation. Human-level logical AI requires
extensions to the way logic is used in formalizing branches of mathematics and
physical science. It also seems to require extensions to the logics themselves,
both in the formalism for expressing knowledge and the reasoning used to reach
conclusions. A large number of concepts need to be studied to achieve logical
AI of human level.

Propositional calculus
Propositional calculus is a branch of logic. It is also called propositional
logic, statement logic, sentential calculus, sentential logic, or
sometimes zeroth-order logic. It deals with propositions (which can be true or
false) and relations between propositions, including the construction of
arguments based on them. Compound propositions are formed by connecting
propositions by logical connectives. Propositions that contain no logical
connectives are called atomic propositions.
Unlike first-order logic, propositional logic does not deal with non-logical
objects, predicates about them, or quantifiers. However, all the machinery of
propositional logic is included in first-order logic and higher-order logics. In
this sense, propositional logic is the foundation of first-order logic and higher-
order logic.
Propositional logic in Artificial intelligence
Propositional logic (PL) is the simplest form of logic where all the statements
are made by propositions. A proposition is a declarative statement which is
either true or false. It is a technique of knowledge representation in logical and
mathematical form.

Example:
1. a) It is Sunday.
2. b) The Sun rises from West (False proposition)
3. c) 3+3= 7(False proposition)
4. d) 5 is a prime number.
Following are some basic facts about propositional logic:
o Propositional logic is also called Boolean logic as it works on 0 and 1.
o In propositional logic, we use symbolic variables to represent the logic,
and we can use any symbol for a representing a proposition, such A, B, C,
P, Q, R, etc.
o Propositions can be either true or false, but it cannot be both.
o Propositional logic consists of an object, relations or function, and logical
connectives.
o These connectives are also called logical operators.
o The propositions and connectives are the basic elements of the
propositional logic.
o Connectives can be said as a logical operator which connects two
sentences.
o A proposition formula which is always true is called tautology, and it is
also called a valid sentence.
o A proposition formula which is always false is called Contradiction.
o A proposition formula which has both true and false values is called
o Statements which are questions, commands, or opinions are not
propositions such as "Where is Rohini", "How are you", "What is your
name", are not propositions.

Syntax of propositional logic:


The syntax of propositional logic defines the allowable sentences for the
knowledge representation. There are two types of Propositions:

Atomic Propositions

Compound propositions

o Atomic Proposition: Atomic propositions are the simple propositions. It


consists of a single proposition symbol. These are the sentences which
must be either true or false.

Example:

1. a) 2+2 is 4, it is an atomic proposition as it is a true fact.


2. b) "The Sun is cold" is also a proposition as it is a false fact.
o Compound proposition: Compound propositions are constructed by
combining simpler or atomic propositions, using parenthesis and logical
connectives.

Example:

1. a) "It is raining today, and street is wet."


2. b) "Ankit is a doctor, and his clinic is in Mumbai."
Natural deductions
The system we will use is known as natural deduction. The system consists of
a set of rules of inference for deriving consequences from premises. One
builds a proof tree whose root is the proposition to be proved and whose leaves
are the initial assumptions or axioms (for proof trees, we usually draw the root
at the bottom and the leaves at the top).
For example, one rule of our system is known as modus ponens. Intuitively,
this says that if we know P is true, and we know that P implies Q, then we can
conclude Q.
P P⇒Q
(modus ponens)
Q
The propositions above the line are called premises; the proposition below the
line is the conclusion. Both the premises and the conclusion may contain
metavariables (in this case, P and Q) representing arbitrary propositions. When
an inference rule is used as part of a proof, the metavariables are replaced in a
consistent way with the appropriate kind of object (in this case, propositions).
Most rules come in one of two flavors: introduction or elimination rules.
Introduction rules introduce the use of a logical operator, and elimination rules
eliminate it. Modus ponens is an elimination rule for ⇒. On the right-hand side
of a rule, we often write the name of the rule. This is helpful when reading
proofs. In this case, we have written (modus ponens). We could also have
written (⇒-elim) to indicate that this is the elimination rule for ⇒.
Different presentations of natural deduction
Tree-like presentations
Gentzen's discharging annotations used to internalise hypothetical judgments
can be avoided by representing proofs as a tree of sequents Γ ⊢A instead of a
tree of A true judgments.
Sequential presentations
Jaśkowski's representations of natural deduction led to different notations such
as Fitch-style calculus (or Fitch's diagrams) or Suppes' method, of
which Lemmon gave a variant called system L. Such presentation systems,
which are more accurately described as tabular, include the following.

 1940: In a textbook, Quine[9] indicated antecedent dependencies by line


numbers in square brackets, anticipating Suppes' 1957 line-number
notation.
 1950: In a textbook, Quine (1982) demonstrated a method of using one or
more asterisks to the left of each line of proof to indicate dependencies.
This is equivalent to Kleene's vertical bars. (It is not totally clear if
Quine's asterisk notation appeared in the original 1950 edition or was
added in a later edition.)
 1957: An introduction to practical logic theorem proving in a textbook
by Suppes (1999). This indicated dependencies (i.e. antecedent
propositions) by line numbers at the left of each line.
 1963: Stoll (1979) uses sets of line numbers to indicate antecedent
dependencies of the lines of sequential logical arguments based on natural
deduction inference rules.
 1965: The entire textbook by Lemmon (1965) is an introduction to logic
proofs using a method based on that of Suppes.
 1967: In a textbook, Kleene (2002) briefly demonstrated two kinds of
practical logic proofs, one system using explicit quotations of antecedent
propositions on the left of each line, the other system using vertical bar-
lines on the left to indicate dependencies
Rules for Conjunction
Conjunction (∧) has an introduction rule and two elimination rules:
P Q P∧Q P∧Q

P∧Q (∧-intro) P (∧-elim-left) Q (∧-elim-right)

Rule for T
The simplest introduction rule is the one for T. It is called "unit". Because it
has no premises, this rule is an axiom: something that can start a proof.
T (unit)
Rules for Implication
In natural deduction, to prove an implication of the form P ⇒ Q, we assume
P, then reason under that assumption to try to derive Q. If we are successful,
then we can conclude that P ⇒ Q.
In a proof, we are always allowed to introduce a new assumption P, then
reason under that assumption. We must give the assumption a name; we have
used the name x in the example below. Each distinct assumption must have a
different name.
[x : P] (assum)

Because it has no premises, this rule can also start a proof. It can be used as if
the proposition P were proved. The name of the assumption is also indicated
here.
However, you do not get to make assumptions for free! To get a complete
proof, all assumptions must be eventually discharged. This is done in the
implication introduction rule. This rule introduces an implication P ⇒ Q by
discharging a prior assumption [x : P]. Intuitively, if Q can be proved under
the assumption P, then the implication P ⇒ Q holds without any assumptions.
We write x in the rule name to show which assumption is discharged. This rule
and modus ponens are the introduction and elimination rules for implications.
[x : P]
⋮ P P⇒Q
Q (⇒-elim, modus ponens)
Q
P⇒Q (⇒-intro/x)

A proof is valid only if every assumption is eventually discharged. This must


happen in the proof tree below the assumption. The same assumption can be
used more than once.
Rules for Disjunction
P Q P ∨ P ⇒ Q ⇒
(∨- (∨-
Q R R
P ∨ intro- P ∨ intro- (∨-
Q left) Q right) R elim)

Rules for Negation


A negation ¬P can be considered an abbreviation for P ⇒ ⊥:
P⇒⊥ ¬P

¬P (¬-intro) P⇒⊥ (¬-elim)

Rules for Falsity


[x : ¬P]
⋮ ⊥ (ex falso quodlibet,
⊥ EFQ)
(reductio ad absurdum, P
P RAA/x)

Reductio ad absurdum (RAA) is an interesting rule. It embodies proofs by


contradiction. It says that if by assuming that P is false we can derive a
contradiction, then P must be true. The assumption x is discharged in the
application of this rule. This rule is present in classical logic but not
in intuitionistic (constructive) logic. In intuitionistic logic, a proposition is not
considered true simply because its negation is false.

Axiomatic System
An axiom is a basic statement assumed to be true and requiring no proof of its
truthfulness. It is a fundamental underpinning for a set of logical statements.
Not everything counts as an axiom. It must be simple, make a useful statement
about an undefined term, evidently true with a minimum of thought, and
contribute to an axiomatic system
An axiomatic system is a collection of axioms, or statements about undefined
terms. You can build proofs and theorems from axioms. Logical arguments are
built from with axioms.
You can create your own artificial axiomatic system, such as this one:

1. Every robot has at least two paths


2. Every path has at least two robots
3. A minimum of one robot exists

This might describe a routine for a computer to control activity in a warehouse,


but it is also a set of axioms. We have two undefined terms, "robot" and "path."
We have not defined "robot" or "path," but we can build on those undefined
terms to construct various proofs. Let's prove a path exists:

1. By the third axiom, a robot exists.


2. By the first axiom, the existing robot must have at least one path.
3. Therefore, at least one path for a robot exists.

Such an axiomatic system is limited, but it would be enough to build a network


of robots to work in a warehouse. Euclid, the ancient Greek mathematician,
created an axiomatic system with five axioms. From that basic foundation we
derive most of our geometry (and all Euclidean geometry).

Euclid's Five Axioms

Euclid (his name means "renowned," or "glorious") was born circa (around)
325 BCE and died 265 BCE. He is the Father of Geometry for formulating these
five axioms that, together, form an axiomatic system of geometry:

1. A straight line may be drawn between any two points.


2. Any terminated straight line may be extended indefinitely.
3. A circle may be drawn with any given point as center and any given radius.
4. All right angles are equal.
5. If two straight lines in a plane are met by another line, and if the sum of the
internal angles on one side is less than two right angles, then the straight lines
will meet if extended sufficiently on the side on which the sum of the angles is
less than two right angles.

Mathematicians have, for centuries, accepted the first four axioms and built
great achievements on them. The fifth axiom has provoked a lot of controversy
over those same centuries. A different translation or wording produced this
alternative:

 5'. For any given point not on a given line, there is exactly one line
through the point that does not meet the given line.

That is the "parallel postulate," but it is also a recasting of the fifth axiom. The
reason for the controversy about the fifth axiom is that axiomatic systems
usually fulfill three conditions, or have three properties.

Three Properties of Axiomatic Systems

For an axiomatic system to be valid, from our robot paths to Euclid, the
system must have only one property: consistency.

An axiomatic system is stronger for also


having independence and completeness. Let's look at each quality in turn.

Consistency

An axiomatic system is consistent if the axioms cannot be used to prove a


particular proposition and its opposite, or negation. It cannot contradict itself. In
our simple example, the three axioms could not be used to prove that some
paths have no robots while also proving that all paths have some robots.
Independence

An axiomatic system must have consistency (an internal logic that is not self-
contradictory). It is better if it also has independence, in which axioms are
independent of each other; you cannot get one axiom from another. All axioms
are fundamental truths that do not rely on each other for their existence. They
may refer to undefined terms, but they do not stem one from the other.

Completeness

The third important quality, but not a requirement of an axiomatic system, is


completeness. Whatever we attempt to test with the system will either be proven
or its negative will be proven. Mathematicians have argued for centuries that
Euclid's fifth axiom is really a theorem, but others counter that the other four
axioms cannot be used to prove it. Without the fifth axiom, Euclid's axiomatic
system lacks completeness.

Your World

Axioms may seem a little removed from your everyday life. Rather than
pointing to some commonplace object and saying, "That shows an axiom,"
consider that the shaping of your mental processes -- the way you think --
depends on axioms. To do well in geometry, you learn to think logically,
building proofs from axioms.

When you branch out into other mathematics, like non-Euclidean geometry,
different axioms produce different results, like allowing parallel lines to meet.
Axiomatic systems like those are useful for ideas like geosynchronous orbits for
satellites, radio communications, and land surveying.

Semantic Tableaux
A semantic tableau is a tree representing all the ways the conjunction of the
formulas at the root can be true. We expand the formulas based on the structure
of the compound formulas. This expansion forms a tree. If all branches in the
tableau lead to a contradiction, then there is no way the conjunction of the
formulas at the root can be true. A path of the tree represents the conjunction of
the formulas along the path. Semantic tableaux was invented by E.W. Beth and
J. Hintikka (1965).
General Form of Tableaux

A branch is closed is a and ¬a both appear on the path from


the root of the tree to the leaf of the branch (i.e., there is a
contradiction on the branch). a need not be a prime
proposition.
If all branches of the tree are closed, then the tableau is
closed and we can conclude the conjunction of the formulas
at the root are not satisfiable, therefore the set of formulas is
inconsistent.
We will number all the formulas in the tableau, and use these
along with rules to justify the expansion of the tableau. (The
order that formulas get assigned numbers doesn’t matter, as
long as each formula has a unique number.)
Showing Inconsistency
If all branches of a tableau are closed, the set of formulas at the root are
inconsistent. We can use semantic tableaux to show a set of formulas is
inconsistent.
Showing Validity
For an argument to be invalid, there has to be a way for the premises to be true
and the conclusion to be false.
For an argument to be invalid, there has to be a way for the premises to be true
and the conclusion to be false. Equivalently, . . . there has to be a way for the
premises to be true and the negation of the conclusion to be true.
For an argument to be invalid, there has to be a way for the premises to be true
and the conclusion to be false. Equivalently, . . . there has to be a way for the
premises to be true and the negation of the conclusion to be true. To show an
argument is valid, we put the premises and the negation of the conclusion at the
root of a tableau. If we can close all the branches of the tableau, then this set of
formulas is inconsistent. This means the argument is valid and we can write:
p1, p2, p3, . . . `ST q

In semantic tableaux, we are proving p1, p2, p3 |= q by showing p1, p2, p3, ¬q
is an inconsistent set of formulas. Semantic tableaux is based on the idea of
proof by contradiction. It is a refutation-based system. Semantic tableaux is a
form of backward proof because we start from the conclusion and decompose it
and the premises into to smaller and smaller parts until we reach a
contradiction.
Tableaux Expansion Rules
each of the binary logical connectives
the negation of a formula with each binary logicalconnective
double negation
The rule numbers are provided to show you thecorrespondence with Kelly’s
text book. We will use namesrather than numbers for the rules.
There is a summary sheet available on the course web page with the semantic
tableaux expansion rules.
Rules for Conjunction

This rule can be applied to a formula with more than two conjuncts in a single
step.
A semantic tableaux rule only applies to one formula (i.e., one line of the tree).
Closing a tableau requires two formulas that contradict each other (i.e., two
lines of the proof).
A branch means there are two ways to make the formula true. A branch
captures disjunction.
Rules for Disjunction
This rule can be applied to a formula with more than two disjuncts in a single
step.
Heuristic
Apply the non-branching rules first
Usually this will result in shorter proofs.
Rule for Negation

Rules for Implication

Rules for Equivalence


Soundness and Completeness
Semantic tableaux for propositional logic is sound andcomplete.
Soundness: if p1, p2, . . . , pn `ST q then p1, p2, . . . , pn |= q
Semantic tableaux only proves tautologies.
Completeness: if p1, p2, . . . , pn |= q then p1, p2, . . . , pn `ST q
Semantic tableaux can be used to prove all tautologies.
Showing Inconsistency
Sales of houses fall off if interest rates rise. r ⇒ s
2. Auctioneers are not happy if sales of houses fall off.
s ⇒ ¬h
3. Interest rates are rising. r
4. Auctioneers are happy. h
where
s = sales of houses fall off
r = interest rates rise
h = auctioneers are happy
resolution and refutation
Resolution is one kind of proof technique that works this way - (i) select two
clauses that contain conflicting terms (ii) combine those two clauses and (iii)
cancel out the conflicting terms.
For example we have following statements,
(1) If it is a pleasant day you will do strawberry picking
(2) If you are doing strawberry picking you are happy.

Above statements can be written in propositional logic like this -


(1) strawberry_picking ← pleasant
(2) happy ← strawberry_picking

And again these statements can be written in CNF like this -


(1) (strawberry_picking ∨~pleasant) ∧
(2) (happy ∨~strawberry_picking)

By resolving these two clauses and cancelling out the conflicting


terms 'strawberry_picking' and '~strawberry_picking', we can have
one new clause,
(3) ~pleasant ∨ happy

How ? See the figure on right.

When we write above new clause in infer or implies form, we have


'pleasant → happy' or 'happy ← pleasant'
i.e. If it is a pleasant day you are happy.

But sometimes from the collection of the statements we have, we want to know
the answer of this question - "Is it possible to prove some other statements from
what we actually know?" In order to prove this we need to make some
inferences and those other statements can be shown true using Refutation proof
method i.e. proof by contradiction using Resolution. So for the asked goal we
will negate the goal and will add it to the given statements to prove the
contradiction.
Let's see an example to understand how Resolution and Refutation work. In
below example, Part(I) represents the English meanings for the
clauses, Part(II) represents the propositional logic statements for given english
sentences, Part(III) represents the Conjunctive Normal Form (CNF) of Part(II)
and Part(IV) shows some other statements we want to prove using Refutation
proof method.
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.

o Consider 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:

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 x 2≥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 x2≥m. The statement is true as
for every m, there exists for some greater x such that x2≥m.

You might also like