Unit 3
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.
Atomic Propositions
Compound propositions
Example:
Example:
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)
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:
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:
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.
For an axiomatic system to be valid, from our robot paths to Euclid, the
system must have only one property: consistency.
Consistency
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
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
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
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
Quantifier:
Existential Quantifier:
There are several ways to write a proposition, with an existential quantifier, i.e.,
Universal Quantifier:
The two rules for negation of quantified proposition are as follows. These are
also called DeMorgan's Law.
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.
2. ∃ m∀ x(x2<m)