0% found this document useful (0 votes)
14 views

Unit 3 Topic 2 Propositional Logic

Uploaded by

devpvt1109
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Unit 3 Topic 2 Propositional Logic

Uploaded by

devpvt1109
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

Propositional Logic

Dr. Gaurav Srivastav


CSE(AI)

1
Basic
• The central component of a knowledge-based agent is its knowledge base, or KB.

• A knowledge base is a set of sentences. (Here “sentence” is used as a technical term.

• It is related but not identical to the sentences of English and other natural languages.)

• Each sentence is expressed in a language called a knowledge representation language


and represents some assertion about the world.

• When the sentence is taken as being given without being derived from other sentences,
we call it an axiom.
Logic
These sentences are expressed according to the syntax of the representation language, which
specifies all the sentences that are well formed. The notion of syntax is clear enough in
ordinary arithmetic:

“x + y = 4” is a well-formed sentence, whereas “x4y+ =” is not.

3
Logic (Contd..)
A logic must also define the semantics, or meaning, of sentences. The semantics defines the
truth of each sentence with respect to each possible world. For example, the semantics for
arithmetic specifies that the sentence “x + y= 4” is true in a world where x is 2 and y is 2,
but false in a world where x is 1 and y is 1. In standard logics, every sentence must be either
true or false in each possible world—there is no “in between.”

4
Propositional Logic

• The syntax of propositional logic defines the allowable sentences.

• The atomic sentences consist of a single proposition symbol.

• Each such symbol stands for a proposition that can be true or false.

• Complex sentences are constructed from simpler sentences, using


parentheses and operators called logical connectives.

5
A BNF (Backus–Naur Form) grammar of sentences in
propositional logic, along with operator precedence's, from
highest to lowest.

6
Basic Facts

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

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

• A proposition formula which has both true and false values is called

• Statements which are questions, commands, or opinions are not propositions such as
"Where is ABC", "How are you", "What is your name", are not propositions.
Conti…
• 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.

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


9
Logical Connectives
• Logical connectives are used to connect two simpler propositions or representing a sentence
logically. We can create compound propositions with the help of logical connectives.

• Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal
or negative literal.

• Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a conjunction.

• Example: Rohan is intelligent and hardworking. It can be written as,

P= ABC is intelligent,
Q= ABC is hardworking.

→ P∧ Q.

10
Conti…

11
Propositional Logic Connectives

12
Properties
Satisfiable

• A atomic propositional formula is satisfiable if there is an interpretation for which it is true.

Tautology:

• A propositional formula is valid or a tautology it is true for all possible interpretations.

Contradiction

• A propositional formula is contradictory (unsatisfiable) if there is no interpretation for which it is


true.

Contingent

• A propositional logic can be contingent which means it can be neither a tautology nor a
contradiction.
13
Truth Table
• A truth table is a tabular representation of all the combinations of values for inputs and
their corresponding outputs. It is a mathematical table that shows all possible outcomes
that would occur from all possible scenarios that are considered factual, hence the name.
Truth tables are usually used for logic problems as in Boolean algebra and electronic
circuits.
Truth Table

15
Properties of Operators
• Commutativity:
• P∧ Q= Q ∧ P, or
• P ∨ Q = Q ∨ P.
• Associativity:
• (P ∧ Q) ∧ R= P ∧ (Q ∧ R),
• (P ∨ Q) ∨ R= P ∨ (Q ∨ R)
• Identity element:
• P ∧ True = P,
• P ∨ True= True.
• Distributive:
• 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.

16
Limitations of Propositional logic
• We cannot represent relations like ALL, some, or
none with propositional logic.
Example:
• All the girls are intelligent.
• Some apples are sweet.

• Propositional logic has limited expressive power.


• In propositional logic, we cannot describe statements
in terms of their properties or logical relationships.

17
Thanks

18

You might also like