You are on page 1of 26

Unit 3

LOGIC CONCEPTS
Introduction

• 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.
Propositional calculus
• Propositional calculus is a branch of logic. It is also
called propositional logic, statement logic, sentential
calculus, sentential logic, or sometimes zero-order logic.
• It deals with propositions (which can be true or false) and
relations between propositions.
• 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.
• 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:
• a) It is Sunday.
• b) The Sun rises from West (False proposition)
• c) 3+3= 7(False proposition)
• d) 5 is a prime number.
some basic facts about propositional logic:

• Propositional logic is also called Boolean logic as it works on


0 and 1.

• 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.

• Propositions can be either true or false, but it cannot be both.

• Propositional logic consists of an object, relations or function,


and logical connectives.

• These connectives are also called logical operators.


• The propositions and connectives are the basic elements of the
propositional logic.

• Connectives can be said as a logical operator which connects


two sentences.

• A proposition formula which is always true is called tautology,


and it is also called a valid sentence.

• A proposition formula which is always false is


called Contradiction.

• 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:

• 1.) 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:

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

• b) "The Sun is cold" is also a proposition as it is a false fact.


2.) Compound proposition:

• Compound propositions are constructed by combining simpler


or atomic propositions, using parenthesis and logical
connectives.

• Example:

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

• 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.

• 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.
• When an inference rule is used as part of a proof, the meta
variables are replaced in a consistent way with the appropriate
kind of object (in this case, propositions).

• Most rules come in one of two


favours: 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.

• 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

• These 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:

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.

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.
Rules for Disjunction

Rules for Negation

Rules for Falsity


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:
 Every robot has at least two paths
 Every path has at least two robots
 A minimum of one robot exists
Euclid's Five Axioms
 A straight line may be drawn between any two points.
 Any terminated straight line may be extended indefinitely.
 A circle may be drawn with any given point as center and any given radius.
 All right angles are equal.
 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.
Three Properties of Axiomatic Systems
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

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
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).
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. 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
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).
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


Semantic tableaux for propositional logic
• 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.
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.
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
• 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.
• Consider E(x, y) denote "x = y"
• Consider X(a, b, c) denote "a + b + c = 0"
• 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 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 x2≥m. The
statement is true as for every m, there exists for some greater x such that
x2≥m.

You might also like