Page 1 of 12
Home Whiteboard AI Assistant Online Compilers Jobs Tools Articles
Chapters Categories
SQL HTML CSS Javascript Python Java C C++ PHP Scala C# Tailwin
Artificial Intelligence - Propositional Logic
Propositional logic is a branch of logic that deals with propositions, which are statements that
can be either true or false. It makes complex expressions by using logical connectives like AND,
OR, NOT, and IMPLIES, and then applies rules to determine their truth values.
Propositional Logic in Artificial Intelligence
Artificial intelligence (AI) uses propositional logic as one of the major methods of knowledge
representation using logical propositions. Propositions are statements that are either true or false
but not both. More complex expressions are created by combining statements with logical
operators like AND, OR, NOT, and IMPLIES. This enables an AI system to make better decisions
using logical reasoning.
Artificial intelligence applies propositional logic in rule-based reasoning, automated
theorem proving, and expert system decision-making. In machine learning, inference
rules like Modus Ponens and Resolution allow machines to draw conclusions on the
basis of the facts provided.
Propositions, in artificial intelligence, are sentences that are considered to state facts, situations,
or claims about the world to enable the logical reasoning of the machines. The propositional logic
expression consists of symbols (for these truths) and logical operators, often represented with
parenthesis.
Example
Following are few examples of propositions (declarative statements) −
Advertisement
-
The sun rises in the east.
A triangle has four sides. (False)
Water boils at 100C under normal atmospheric pressure.
2 + 2 = 5. (False)
A self-driving car can operate without human intervention.
Page 2 of 12
Facts about Propositional logic
Propositional logic is a formal system applied in mathematics, computer science, and artificial
intelligence for reasoning about logical statements.
It pays no attention to the context and content, it just determines whether propositions are
true or false based on their structure.
In propositional logic, operations are ordered according to precedence: Negation (¬) leads
to conjunction (), then disjunction (), implication (→), and biconditional ().
Truth tables are applied to determine whether a logical expression is valid, satisfiable, or
equivalent.
Propositional logic is limited because it can't express a relationship between the objects and
quantifiers like "for all" or "there exists," where these are handled by First Order Logic.
A proposition must be a declarative statement that holds a truth value of true or false, like
the sky is blue. Statements like "Where is Krish?" is not a proposition because it is not
declarative statement.
Key Components of Propositional Logic
Propositional logic involves basic building blocks such as propositions, logical connectives, and
truth tables to form logical expressions which simplifies knowledge representation that help AI to
reason and Advertisement
make decisions based on facts.
-
Propositions (Statements)
Propositional logic deals with two kinds of propositions, atomic and compound propositions which
form the base for logical expressions.
Page 3 of 12
Atomic proposition: An atomic proposition is an basic statement which cannot be split
into smaller units. It has a single proposition sign.
For example, statement like "The car is parked in the garage".
Compound Proposition: A compound proposition is formed by combining two or more
atomic propositions using logical connectives like AND, OR, NOT, Implies.
For example, "She likes coffee OR she likes tea".
Logical Connectives
Logical connectives, also known as logical operators, are symbols that connect or alter propositions
in propositional logic. They help to form complex propositions and determine the relationships
between the components. Below are the main types −
Conjunction
The combination of two propositions is only true if both of the propositions are true.
Example
The sun is shining AND it is a warm day.
P = The sun is shining.
Q = It is a warm day. → P Q.
The combination of above two statements become P Q. The statement, ("The sun is shining AND it
is a warm day") is TRUE only if both the statements is true, if either P or Q is FALSE the entire
statement is FALSE.
Disjunction (OR, )
The disjunction of two propositions is true if at least one of the propositions is true.
Example
"It is raining OR it is snowing." True if either condition is true, or both.
P = It is raining.
Q = It is snowing. → P Q.
Advertisement
Negation (NOT, ¬) -
The negation of a proposition reverses its truth value, if the proposition is true, the negation is
false, and vice versa.
For example, "The car is NOT parked in the driveway."(True if the car is not parked in the
driveway.)
Page 4 of 12
Implication (IF-THEN, →)
An implication says that if the first proposition is true, then the second has to be true as well. It is
only false when the first statement is right and the second statement is wrong. It is sometimes
called if-then rules.
For example, "If it rains, then the ground gets wet." (False only if it rains and the ground does
not get wet.)
Biconditional (IF AND ONLY IF, )
A biconditional statement is true whenever the two propositions have the same truth value-both
true or both false.
For example, "She is happy IF AND ONLY IF she passed the exam." (True only if she passed the
exam and is happy, or neither of them is true.)
Table for Propositional Logic Connectives
The following table presents the fundamental connectives used in Propositional Logic, along with
their symbols, meanings, and examples −
Connective Symbols Words Terms Example
AND Conjunction AB
OR Disjunction AB
→ Implies Implication A→B
If and only if Biconditional AB
either A or B but
Exclusive Or AB
not both
¬ or ~ NOT Negation ¬A or ~B
Truth Table
A truth table is a systematic representation of all possible truth values of propositions and their
logical combinations in propositional logic, particularly in artificial intelligence.
It helps to determine the validity of logical statements by showing how the truth value of a
Advertisement
compound proposition changes with respect to the truth values of its individual components.
-
Conjunction
The AND operation of P Q is true if both the propositional variable P and Q are true.
The truth table is as follows −
Page 5 of 12
P Q PQ
True True True
True False False
False True False
False False False
Disjunction
The OR operation of two Propositional variable P Q is true if atleast any of the propositional
variable p or q is true.
The truth table is as follows −
P Q PQ
True True True
True False True
False True True
False False False
Implication
An implication P → Qrepresents if P then Q. It is false if P is true and Q is false. The rest cases are
true.
The truth table is as follows −
P Q P→Q
True True True
True False False
False True True
False False True
Advertisement
-
Bi-conditional
P Q is Bi-conditional if both P and Q have both truth value i.e, both are false or both are true.
The truth table is as follows −
P Q PQ