The document introduces propositional logic (PL) and first-order logic (FOL) in AI, explaining their syntax, rules, and applications. PL deals with simple and compound propositions using logical connectives, while FOL extends PL by representing natural language statements and relationships between objects. Both logics are utilized in various fields but have limitations, such as PL's inability to handle complex relationships and FOL's reliance on quantifiers.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
7 views27 pages
Propositional and First Order Logic
The document introduces propositional logic (PL) and first-order logic (FOL) in AI, explaining their syntax, rules, and applications. PL deals with simple and compound propositions using logical connectives, while FOL extends PL by representing natural language statements and relationships between objects. Both logics are utilized in various fields but have limitations, such as PL's inability to handle complex relationships and FOL's reliance on quantifiers.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27
Propositional Logic in AI
Ms. Amber Malik
Introduction to Propositional Logic in AI • This logic is synonymous with sentential logic, provides ways and means of combining or changing the propositions to create a complicated structure and to build a new logical relationship and properties. It combines logical connections of all the constituent statements, and the true value of the complex statement is derived. While doing, it considers other factors like reasoning, relationship, and interconnection between the constituent statements. • This logic provides better clarity on data and information in an incomplete environment by deeper analysis and inference of the limited information presented to it. Due to this unique feature and powerful algorithms deployed in logical reasoning, it is widely adopted in advanced search in AI in solving complex problems. Syntax • Propositional logic (PL), in order to be effective, then we need to follow a language structure that should be agreed upon by everyone, and it should be easy to adopt by all. PL Language structure consists of simple undividable statements joined together with logical connector. Rules Other Features • A simple sentence is called Atomic Proposition, and it should be either true or false. Example: 9+2 =11 is one such proposition, and it is true. Sunrises in the west is another example, and it is false. • A combination of simple sentences connected by logical connectors is called Compound. Example: Today is Friday and people visit Temple today. It’s raining, and the match is called off. • A Proposition that is always true is known as Tautology (another name for Valid Sentence). • A Proposition that is always false is known as Contradiction. Logical Connectives • It connects two undividable simple sentences or expresses a sentence in a logical sense. Complex statements can be created using logical connectives. • There are 5 types of connectors, namely: Sl. Type Symbol Description Example: Today is Monday 1 Negation ¬P (P), Today is not a Monday (¬ P) Example: Ali is a cricket player (P). Ali is a Hockey 2 Conjunction P^Q player (Q). Ali plays both cricket and Hockey is represented by (P ^ Q) . Example: Ali leaves for Mumbai (P) and Ali leaves 3 Disjunction PvQ for Chennai (Q). Ali leaves for Chennai or Mumbai is represented by (P v Q). It follows the rule of If then clause. If sentence P is true, then sentence Q is true. The condition is 4 Implication P→Q unidirectional. Example: If it is Sunday (P) then I will go to Movie (Q), and it is represented as P → Q Sentence (Q) is dependent on sentence (P), and vice versa. Example: If I have 1000 Rupees then only I will go to Bar. The converse 5 Bi-conditional P⇔Q condition that I will go to Bar if and only if I have Rs 1000. The first statement covers necessity and the second one covers sufficiency. Truth Table • It maps the truth values of propositions for all combinations that are possible with several logical connectives. It follows Boolean logic and propositional calculus. All such scenarios with corresponding truth values are captured in Table known as Truth Table. Truth table Conclusion – Propositional Logic in AI • Due to its ability in solving complex problems this logic is used quite extensively in Business, Education and Medical fields. • But it has some limitations viz., • It cannot address relations like Some, ALL, • It can neither handle logical relationships. • It has limited expressive ability. First Order Logic FOL What is first-order logic (FOL) • FOL is a mode of representation in Artificial Intelligence. It is an extension of PL. • FOL represents natural language statements in a concise way. • FOL is also called predicate logic. It is a powerful language used to develop information about an object and express the relationship between objects. • FOL not only assumes that does the world contains facts (like PL does), but it also assumes the following: – Objects: A, B, people, numbers, colors, wars, theories, squares, etc. – Relations: It is unary relation such as red, round, sister of, brother of, etc. – Function: father of, best friend, third inning of, end of, etc. Parts of first-order logic • FOL also has two parts: • Syntax • Semantics Syntax • The syntax of FOL decides which collection of symbols is a logical expression. • The basic syntactic elements of FOL are symbols. We use symbols to write statements in shorthand notation. Basic elements of FOL Atomic and complex sentences in FOL Atomic Sentence • This is a basic sentence of FOL formed from a predicate symbol followed by a parenthesis with a sequence of terms. • We can represent atomic sentences as a predicate (value1, value2…., value n). Example • John and Michael are colleagues → Colleagues (John, Michael) • German Shepherd is a dog → Dog (German Shepherd) Atomic and complex sentences in FOL Complex sentences are made by combining atomic sentences using connectives. FOL is further divided into two parts: • Subject: the main part of the statement. • Predicate: defined as a relation that binds two atoms together. Example • Colleague (Oliver, Benjamin) ∧ Colleague (Benjamin, Oliver) • “x is an integer” • It has two parts; – first, x is the subject. – second, “is an integer” is called a predicate. Quantifiers and their use in FOL • Quantifiers generate quantification and specify the number of specimen in the universe. • Quantifiers allow us to determine or identify the range and scope of the variable in a logical expression. • There are two types of quantifiers: – Universal quantifier: for all, everyone, everything. – Existential quantifier: for some, at least one. 1. Universal quantifiers • Universal quantifiers specify that the statement within the range is true for everything or every instance of a particular thing. • Universal quantifiers are denoted by a symbol (∀) that looks like an inverted A. In a universal quantifier, we use →. • If x is a variable, then ∀x can read as: – For all x – For every x – For each x Example • Every Student Likes Educative. Explanation • So, in logical notation, it can be written as: • ∀x: student(x) → likes(x, Educative) • This can be interpreted as: There is every x where x is a student who likes Educative. Example • All boys like cricket ∀x: student(x) → likes(x, Educative) 2. Existential quantifiers • Existential quantifiers are used to express that the statement within their scope is true for at least one instance of something. • ∃, which looks like an inverted E, is used to represent them. We always use AND or conjunction symbols. • If x is a variable, the existential quantifier will be ∃x: – For some x – There exists an x – For at least one x Example • Some people like Football. Explanation • So, in logical notation, it can be written as: • ∃x: people(x) ∧ likes Football(x) • It can be interpreted as: There are some x where x is people who like football. example • Some girls like football ꓱx: girls(x) ∧ hate(x, football) Nested quantifiers & their uses • We can use both quantifiers together, but it’s not a type of quantifier; rather, it’s an outlier category. • Nested quantifier refers to when one quantifier is within the scope of another quantifier. • These quantifiers can be represented using the ∃x∀x signs. • Here are some examples to understand this type of quantifier. – ∃xy ∀x ∀y((x< 0) ∧ (y< 0) → (xy = 8)) • This can be interpreted as: For every real number x and y ∈ ℝ, if x is negative and y is also negative, implies for some values of xy must be equal to 8. Example • Every person who buys a policy is smart
∀x ∀y : person(x) ∧ policy(y) ∧ buys(x,y) →
smart(x) • No person buys expensive policy ∀x ∀y : person(x) ∧ policy(y) ∧ expensive(y) → ¬ buy(x,y)