×

Propositional Logic

It is a branch of logic which is also known as statement logic, sentential logic, zeroth-order logic, and many more. It works with the propositions and its logical connectivities. It deals with the propositions or statements whose values are true, false, or maybe unknown.

Syntax and Semantics of Propositional Logic

Syntax and semantics define a way to determine the truth value of the sentence.

Syntax: The statements given in a problem are represented via propositional symbols. Each sentence consists of a single propositional symbol. The propositional symbol begins with an uppercase letter and may be followed by some other subscripts or letters. We have two fixed propositional symbols, i.e., True and False.

To convert simple sentences into complex one, following connectives (a connective is used to combine two or more sentences) are used:

  • not(¬): It is known as the negation of a sentence. A literal can be a positive literal or a negative literal.
  • and(?): When a sentence is having (?) as the main connective. It is known as Conjunction, and its parts are known as Conjuncts. For example, (Y1 V Y2) ? (Y3 V Y4) ?…(Yn V Ym), such type of sentences are known as Conjunctive sentences.
  • or(V): When a sentence is having (V) as the main connective. It is known as Disjunction, and its parts are known as Disjuncts. For example, (Y1 ? Y2) V (Y3 ? Y4) V …(Yn ? Ym), such type of sentences are known as Disjunctive sentences.  
  • implies(=>): When (Y1 V Y2) => Y3 is given, it is known as the Implication of a sentence. It is like if->then clause, where if this implies then it will happen. Implication is sometimes referred to as Rules or if-then statement. It can also be denoted as (      ) or (       ).
  • if and only if (ó): It represents implication at both sides where the expression is (a1 V a2)?a3,. Such type of connective is called biconditional implication. It returns true if both sides satisfy one another, else returns false.This can also be denoted as (?).

Precedence Order of the Connectives

Below table shows the precedence order of the connectives in their decreasing order:

Name Symbol
Parenthesis/ Brackets ()
Negation/not ¬ or ~
Conjuction/and ?
Disjunction/or V
Implication ?
Biconditional/ if and only if ó

Semantics: It defines the rules to determine the truth of a sentence with respect to a specific model. A semantic should be able to compute the truth value of any given sentence.

There are following five rules regarding the semantics of the complex sentences P and Q in a given model m :

¬P: Its value will be false, iff it is true in the model m.

(P ? Q): Its value is true, iff both P and Q are true in m.

(P v Q): Its value is true, iff either P is true, or Q is true in m.

(P=> Q): Its value is true, iff the value of P is false, and that of Q is true in m.

(P ? Q): The value will be true, iff P and Q value is either true or false in the given model m.

Note: Here, iff means if and only if.                    

These five connectives can also be understood with the help of the below described truth table:

Examples of Propositional Logic

Example 1: Consider the given statement:

If it is humid, then it is raining.

Solution: Let, P and Q be two propositions.

P=It is humid.

Q=It is raining.

It is represented as (P?Q).

Example 2:  It is noon and Ram is sleeping.

Solution: A= It is noon.

B= Ram is sleeping.

It is represented as (A V B).

Example 3: If it is raining, then it is not sunny.

Solution: P= It is raining.

Q= It is sunny.

It is represented as P ? ( ~Q)

Example 4: Ram is a man or a boy.

Solution: X= Ram is a man.

Y= Ram is a boy.

It is represented as (X ? Y).

Example 5: I will go to Delhi if and only if it is not humid.

Solution: A= I will go to Delhi.

B= It is humid.

It is represented as (A ? B).

There can be many examples of Propositional logic.

Propositional Theorem Proving

Theorem proving means to apply rules of inference directly to the sentences.

There are following concepts which are used for theorem proving:

  • Logical Equivalence: If the value of P and Q is true in the same set of models, then they are said to be logically equivalence.
Rule Name Rule
Idempotency Law   (A ? A) = A(AV A) = A  
Commutative Law   (A ? B) = (B ? A)(AV B) = (B V A)      
De morgan’s Law   ~(A ? B) =( ~A V ~B)~(A V B) = (~A ? ~B)  
Associative Law   AV(B V C) = (A V B) V CA ?(B ? C) = (A ?B) ? C  
Distributive Law A ?(B V C) = (A ? B) V (A ? C)A V (B ? C) = (A V B) ? (A V C)  
Contrapositive Law    A   ? B = ~A    ?   ~B
~A  ?       ~B (Converse of Inverse)  
Implication Removal   A    ?   B = ~A V B
Biconditional Removal A ? B = (A ? B) ? (B  ? A)  
Absorption Law A ? (A V B) ? AAV (A ? B) ?A
Double-negation elimination ~(~A)=A

Table defining the rules used in Propositional logic where A, B, and C represents some arbitrary sentences.

  • Validity: If a sentence is valid in all set of models, then it is a valid sentence. Validity is also known as tautology, where it is necessary to have true value for each set of model.
  • Satisfiability: If a sentence is true atleast for some set of values, it is a satisfiable sentence.

Let’s understand validity and satisfiability with the help of examples:

Example 1:

(P V Q)    ?   (P ? Q)

P Q P V Q P ? Q (P V Q)        (P ? Q)  
False False False False True
False True True False False
True False True False False
True True True True True

So, from the above truth table, it is clear that the given expression is satisfiable but not valid.

Example 2:

A B A ? B (A  ? B) ? A ((A ? B) ? A) ? B  
False False True False True
False True True False True
True False False False True
True True True True True

((A  ? B) ? A)  ? B

So, it is clear from the truth table that the given expression is valid as well as satisfiable.

Note: If the given expression is valid, it is by default satisfiable.


Related Topics

Informed Search/ Heuristic Search in AI

An informed search is more efficient than an uninformed search because in informed search, along with the current state information,  some additional information is also present, which make it easy to reach the...

6 minutes read.

Dynamic Routing

Dynamic Routing Dynamic routing is used to update the routing table and find networks on the routers. It is easier than static routing and default routing, but it is more expensive in terms of...

3 minutes read.

Hill Climbing Algorithm in AI

Hill Climbing Algorithm: Hill climbing search is a local search problem. The purpose of the hill climbing search is to climb a hill and reach the topmost peak/ point of...

4 minutes read.

Propositional Logic

It is a branch of logic which is also known as statement logic, sentential logic, zeroth-order logic, and many more. It works with the propositions and its logical connectivities. It deals with the...

5 minutes read.

Local Search Algorithms and Optimization Problem

The informed and uninformed search expands the nodes systematically in two ways: keeping different paths in the memory and selecting the best suitable path, Which leads to a solution state required to reach the goal...

2 minutes read.

Probabilistic Reasoning

Probabilistic Reasoning Probabilistic Reasoning is the study of building network models which can reason under uncertainty, following the principles of probability theory. Bayesian Networks Bayesian network is a data structure which is used to represent the dependencies among variables....

7 minutes read.

Knowledge Representation in AI

In this section, we will understand how to represent the knowledge in the form which could be understood by the knowledge-based agents. The knowledge that is stored in the system is related to...

5 minutes read.

Utility Functions in Artificial Intelligence

The agents use the utility theory for making decisions. It is the mapping from lotteries to the real numbers. An agent is supposed to have various preferences and can choose the one...

3 minutes read.

Artificial Satellites

Many objects like stars, satellites and the moon are visible in the night sky. Satellites are objects revolving around the planet or a more significant object. Moon is the most...

6 minutes read.

Inference Rules in Proposition Logic

Inference rules are those rules which are used to describe certain conclusions. The inferred conclusions lead to the desired goal state. In propositional logic, there are various inference rules which can be applied to...

3 minutes read.

Minimax Strategy

In artificial intelligence, minimax is a decision-making strategy under game theory, which is used to minimize the losing chances in a game and to maximize the winning chances. This strategy is also known...

3 minutes read.

Neural Networks

Neural Networks are one of the most popular techniques and tools in Machine learning. Neural Networks were inspired by the human brain as early as in the 1940s. Researchers studied the...

5 minutes read.

Heuristic Functions in Artificial Intelligence

Heuristic Functions in AI: As we have already seen that an informed search make use of heuristic functions in order to reach the goal node in a more prominent way....

3 minutes read.

Hidden Markov Models

Hidden Markov Model is a partially observable model, where the agent partially observes the states. This model is based on the statistical Markov model, where a system being modeled follows the Markov process...

4 minutes read.

Reinforcement Learning in AI

Reinforcement Learning in AI Reinforcement LearningMarkov’s Decision ProcessQ leaningGreedy Decision MakingNIM GameNIM Game Implementation with Python Reinforcement Learning Reinforcement Learning is about learning from experience, where agents are given a set of rewards...

15 minutes read.

Classical Planning

Classical Planning is the planning where an agent takes advantage of the problem structure to construct complex plans of an action. The agent performs three tasks in classical planning: Planning: The agent plans after...

4 minutes read.

Natural Language Processing

Natural Language Processing in AI Topics Covered in Language Module Natural Language ProcessingSyntax and SemanticsContext-Free GrammarNLTKN-gramsTokenizationBag of WordsNaïve Bayes In language, we will cover how Artificial Intelligence is used to process human language...

13 minutes read.

5 algorithms that demonstrate artificial intelligence bias

Unfortunately, in the machine learning algorithm, AI bias is the output due to the prejudiced assumption made due to the algorithm development process. AI systems have biases due to the...

3 minutes read.

8 best topics for research and thesis in artificial intelligence

AI, abbreviated as Artificial Intelligence, is a field which has a long history. Artificial Intelligence is the ability of machines that perform the same function as human beings, like problem-solving,...

3 minutes read.

Uninformed Search Strategies - Artificial Intelligence

Breadth-first search (BFS) It is a simple search strategy where the root node is expanded first, then covering all other successors of the root node, further move to expand the next...

8 minutes read.