Propositional logic in Artificial Intelligence (AI)
In this page, we will learn about Propositional logic in Artificial intelligence, Propositional logic in Artificial intelligence, Following are some basic facts about propositional logic, Syntax of propositional logic, Logical Connectives, Truth Table, Truth table with three propositions, Precedence of connectives, Logical equivalence, Properties of Operators, Limitations of Propositional logic Frame Representation.
Propositional logic in Artificial intelligence
The simplest kind of logic is propositional logic (PL), in which all statements are made up of propositions. The term "Proposition"refers to a declarative statement that can be true or false. It's a method of expressing knowledge in logical and mathematical terms.
- It is Sunday.
- The Sun rises from West (False proposition)
- 3 + 3 = 7 (False proposition)
- 5 is a prime number.
Following are some basic facts about propositional logic:
- Because it operates with 0 and 1, propositional logic is also known as Boolean logic.
- In propositional logic, symbolic variables are used to express the logic, and any symbol can be used to represent a proposition, such as A, B, C, P, Q, R, and so on.
- Propositions can be true or untrue, but not both at the same time.
- An object, relations or functions, and logical connectives make up propositional logic.
- Logical operators are another name for these connectives.
- The essential parts of propositional logic are propositions and connectives.
- Connectives are logical operators that link two sentences together.
- Tautology, commonly known as a legitimate sentence, is a proposition formula that is always true.
- Contradiction is a proposition formula that is always false.
- Statements that are inquiries, demands, or opinions are not propositions, such as "Where is Rohini","How are you", and "What is your name" are not propositions.
Syntax of propositional logic:
The allowed sentences for knowledge representation are defined by the syntax of propositional logic. Propositions are divided into two categories:
- Atomic Propositions.
- Compound propositions.
- Atomic propositions: Simple assertions are referred to as atomic propositions. It is made up of only one proposition sign. These are the sentences that must be true or untrue in order to pass.
- 2+2 is 4, it is an atomic proposition as it is a true fact.
- "The Sun is cold" is also a proposition as it is a false fact.
- Compound proposition: Simpler or atomic statements are combined with parenthesis and logical connectives to form compound propositions.
- "It is raining today, and street is wet."
- "Ankit is a doctor, and his clinic is in Mumbai."
Logical connectives are used to link two simpler ideas or to logically represent a statement. With the use of logical connectives, we can form compound assertions. There are five primary connectives, which are listed below:
- Negation: A statement like ¬P is referred to as a negation of P. There are two types of literals: positive and negative literals.
Example: Rohan is intelligent and hardworking. It can be written as,
P = Rohan is intelligent,
Q = Rohan is hardworking. →P ∧ Q.
- Conjunction:A conjunction is a sentence that contains ∧ connective such as, P ∧ Q.
Example: "Ritika is a doctor or Engineer",
Here P = Ritika is Doctor. Q = Ritika is Doctor, so we can write it as P ∨ Q.
- Disjunction: A disjunction is a sentence with a connective ∨ , such as P ∨ Q, where P and Q are the propositions.
- Implication: An implication is a statement such as P → Q. If-then rules are another name for implications. It can be expressed as follows: If it rains, the street is flooded.
Because P denotes rain and Q denotes a wet street, the situation is written as P and Q
- Biconditional: A sentence like P Q, for example, is a biconditional sentence. I am alive if I am breathing.
P= I am breathing, Q = I am alive, it can be represented as P ⇔ Q.
Following is the summarized table for Propositional Logic Connectives:
|Connective Symbol||Technical Term||Word||Example|
|∧||Conjunction||AND||P ∧ Q|
|V||Disjunction||OR||P V Q|
|→||Implication||Implies||P → Q|
|⇔||Biconditional||If and only If||P ⇔ Q|
|¬ or ~||Negation||Not||¬P or ¬Q|
We need to know the truth values of propositions in all feasible contexts in propositional logic. With logical connectives, we can combine all possible combinations, and the representation of these combinations in a tabular manner is known as a truth table. The truth table for all logical connectives is as follows:
|P||Q||P ∧ Q|
|P||Q||P V Q|
|P||Q||P → Q|
|P||Q||P ⇔ Q|
Truth table with three propositions:
You can build a proposition composing three propositions P, Q, and R. The truth table is made up of 8Xn Tuples as we have taken three proposition symbols.
|P||Q||R||¬R||P V Q||P V Q → ¬R|
Precedence of connectives:
Propositional connectors or logical operators, like arithmetic operators, have a precedence order. When evaluating a propositional problem, this order should be followed. The following is a list of the operator precedence order:
Note: Use parenthesis to make sure of the correct interpretations for a better understanding. For example: ¬R∨ Q, It can be interpreted as (¬R) ∨ Q.
One of the characteristics of propositional logic is logical equivalence. If and only if the truth table's columns are equal, two assertions are said to be logically comparable. Let's take two propositions P and Q, so for logical equivalence, we can write it as P⇔Q. In below truth table we can see that column for ¬P ∨ Q and P→Q, are identical hence P is Equivalent to P
|P||Q||¬P||¬P V Q||P → Q|
Properties of Operators:
- P ∧ Q= Q ∧ P, or
- P ∨ Q = Q ∨ P.
- (P ∧ Q) ∧ R = P ∧ (Q ∧ R),
- (P ∨ Q) ∨ R= P ∨ (Q ∨ R).
- Identity element:
- P ∧ True = P,
- P ∨ True= True.
- P ∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
- P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
- DE Morgan's Law:
- ¬(P ∧ Q) = (¬P) ∨ (¬Q),
- ¬(P ∨ Q) = (¬ P) ∧ (¬Q).
- Double-negation elimination:
- ¬(¬P) = P.
Limitations of Propositional logic:
- This is not possible to represent relations like ALL, some, or none with propositional logic. Example:
- All the girls are intelligent.
- Some apples are sweet.
- The expressive power of propositional logic is restricted.
- We can't explain propositions in propositional logic in terms of their qualities or logical relationships.