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

Unit 3 AI

Uploaded by

junglesafari90
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Unit 3 AI

Uploaded by

junglesafari90
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Predicate Logic / First-Order Predicate Logic (FOPL)

1. Propositional Logic

o Propositional logic assumes the world is made of facts.

o Example:

 "It is raining" (a fact we represent as Rain).

2. First-Order Predicate Logic (FOPL)

o FOPL assumes the world contains:

 Objects: Things in the world like people, places, or things.


 Examples: People, houses, numbers, theories, colors (e.g., John,
House1, Blue).

 Relations: Describes relationships or properties of objects.

 Examples:

 Properties: red, prime (e.g., Red(Car) means "The car is red").

 Relationships: brother of, bigger than (e.g., Brother(John,


Mike) means "John is the brother of Mike").

 Functions: Maps objects to other objects.

 Examples:

 Mathematical functions: + or OneMoreThan(3) gives 4.

 Real-world functions: Father(John) gives "John's father."

Summary

 Propositional Logic: Deals with facts only.

 FOPL: Adds the ability to talk about objects, their properties, relationships, and functions.

Syntax of First-Order Predicate Logic (FOPL)

The syntax of FOPL defines the allowed symbols and how to combine them to form valid statements.
Here's a breakdown of its key components:

1. Constants

o Represent fixed values or specific objects in a domain.


o Example:

 KingJohn (a specific person), 2 (a number), Koblenz (a place).

2. Predicates

o Describe properties or relationships between objects.

o Example:

 Brother(x, y) (x is the brother of y), x > y (x is greater than y), x = y (x is equal


to y).

3. Functions

o Refer to objects indirectly through relationships.

o Example:

 Sqrt(4) (the square root of 4), LeftLegOf(x) (the left leg of x).

4. Variables

o Represent terms that can take on different values in the domain.

o Example:

 x, y, a, b (used for general statements).

5. Connectives

o Logical operators used to combine statements:

 ∧ (AND), ∨ (OR), ¬ (NOT), ⇒ (IMPLIES), ⇔ (IFF - if and only if).

6. Quantifiers

o Express generalization or existence:

 Universal quantifier (∀): "For all."

 Example: ∀x Human(x) means "For all x, x is human."

 Existential quantifier (∃): "There exists."

 Example: ∃x Loves(x, Mary) means "There exists an x such that x loves


Mary."

Summary

FOPL syntax includes:

 Constants (fixed values),

 Predicates (properties/relationships),

 Functions (indirect references),

 Variables (general terms),


 Connectives (logical operators),

 Quantifiers (universal/existential).

Syntax of First-Order Predicate Logic (FOPL)

1. Atomic Sentences

 Definition: The simplest facts or relationships expressed with predicates and terms.

 Examples:

1. Brother(KingJohn, RichardTheLionheart)

 Meaning: "King John is the brother of Richard the Lionheart."

2. Length(LeftLegOf(Richard)) > Length(LeftLegOf(KingJohn))

 Meaning: "The length of Richard's left leg is greater than the length of King John's
left leg."

2. Complex Sentences

 Definition: Formed by combining atomic sentences using logical connectives (similar to


propositional logic).

 Logical Connectives:

o ¬S (NOT S): Negation of a statement.

 Example: ¬Brother(KingJohn, Richard) means "King John is NOT Richard's brother."

o S1 ∧ S2 (AND): Both statements must be true.

 Example: Brother(KingJohn, Richard) ∧ King(KingJohn) means "King John is


Richard's brother AND is a king."

o S1 ∨ S2 (OR): At least one statement is true.

 Example: Brother(KingJohn, Richard) ∨ King(Richard) means "Either King John is


Richard's brother OR Richard is a king."

o S1 ⇒ S2 (IMPLIES): If the first statement is true, the second must also be true.

 Example: King(KingJohn) ⇒ Rich(KingJohn) means "If King John is a king, then King
John is rich."

o S1 ⇔ S2 (IFF): Both statements are either true or false together.

 Example: King(KingJohn) ⇔ Rich(KingJohn) means "King John is a king if and only


if King John is rich."
Summary

1. Atomic Sentences: Simple facts or relationships.

2. Complex Sentences: Combine atomic sentences using logical connectives like ¬, ∧, ∨, ⇒, ⇔.

Semantics of FOPL (Quantifiers) – Easy Examples

1. Universal Quantifiers (∀)

 Definition:

o Used to say something is true for all objects.

o Think of it as "for every."

Easy Examples:

1. ∀x (Student(x) ⇒ Studies(x))

o Meaning: "All students study."

o If x is a student, then x also studies.

2. ∀x (Dog(x) ⇒ HasTail(x))

o Meaning: "All dogs have tails."

o If x is a dog, then x must have a tail.

2. Existential Quantifiers (∃)

 Definition:

o Used to say that at least one object exists that satisfies a condition.

o Think of it as "there is at least one."

Easy Examples:

1. ∃x (Student(x) ∧ PlaysFootball(x))

o Meaning: "There is at least one student who plays football."

o Some x exists such that x is a student and x plays football.

2. ∃x (Cat(x) ∧ Black(x))

o Meaning: "There is a black cat."

o Some x exists such that x is a cat and is black.

Summary
1. Universal Quantifiers (∀): Statements that apply to all objects.

o Example: "All dogs have tails."

2. Existential Quantifiers (∃): Statements about the existence of at least one object.

o Example: "There is a black cat."

Connection Between ∀ (For All) and ∃ (There Exists)

Key Idea

 Universal (∀) and Existential (∃) quantifiers are connected through negation.
 A statement with a universal quantifier can often be rewritten as a negated existential quantifier,
and vice versa.

Easy Example:

Statement 1:

 "Everyone dislikes garlic."

o Written as: ∀x ¬Likes(x, Garlic)

o Meaning: For every person (x), that person does NOT like garlic.

Statement 2:

 "There does not exist someone who likes garlic."

o Written as: ¬∃y Likes(y, Garlic)

o Meaning: It is NOT true that there is at least one person who likes garlic.

Connection

 Both statements mean the same thing.

 Logical equivalence:

o ∀x ¬Likes(x, Garlic) ≡ ¬∃y Likes(y, Garlic)

o Universal quantifiers can be replaced with negated existential quantifiers, and vice versa.

Summary

1. ∀x ¬... ("For all, not...") is equivalent to ¬∃... ("It is not true that there exists...").

2. Example:
o "Nobody likes chocolate" can be written as:

 ∀x ¬Likes(x, Chocolate) OR

 ¬∃x Likes(x, Chocolate)

Conversion to FOPL (First-Order Predicate Logic) – Simplified Explanation with Easy Examples

1. Bill is a student

 FOPL: Student(Bill)

o Meaning: Bill belongs to the group of students.

2. All students are smart

 FOPL: ∀x (Student(x) ⇒ Smart(x))

o Meaning: If x is a student, then x is smart.

3. There exists a smart student

 FOPL: ∃x (Student(x) ∧ Smart(x))

o Meaning: There is at least one x who is a student and is smart.

4. Every student loves some student

 FOPL: ∀x (Student(x) ⇒ ∃y (Student(y) ∧ Loves(x, y)))

o Meaning: For every student x, there is at least one student y whom x loves.

5. Bill takes Analysis or Geometry (or both)

 FOPL: Takes(Bill, Analysis) ∨ Takes(Bill, Geometry)

o Meaning: Bill takes at least one of these courses: Analysis or Geometry (or both).

6. Bill takes Analysis and Geometry

 FOPL: Takes(Bill, Analysis) ∧ Takes(Bill, Geometry)

o Meaning: Bill takes both courses: Analysis and Geometry.

7. No student loves Bill

 FOPL: ¬∃x (Student(x) ∧ Loves(x, Bill))


o Meaning: There is no student who loves Bill.

8. Bill has at least one sister

 FOPL: ∃x SisterOf(x, Bill)

o Meaning: There is at least one person x who is a sister of Bill.

9. Every student takes at least one course

 FOPL: ∀x (Student(x) ⇒ ∃y (Course(y) ∧ Takes(x, y)))

o Meaning: For every student x, there is at least one course y that x takes.

10. Every student who takes Analysis also takes Geometry

 FOPL: ∀x (Student(x) ∧ Takes(x, Analysis) ⇒ Takes(x, Geometry))

o Meaning: If a student x takes Analysis, then they must also take Geometry.

PROLOG

Features of Prolog

1. What is Prolog?

o Prolog stands for PROgramming in LOGic.

o It is a programming language designed for symbolic and logic-based computation.

2. Declarative Nature

o Prolog is declarative, meaning you describe what the program should accomplish, not
how to do it.

o This is very different from traditional languages like Java, C++, or Python, which are
imperative (focus on step-by-step instructions).

3. Database with Rules

o A Prolog program is like a database of facts (e.g., Student(Bill) or Parent(Mary, John)), but
more powerful.

o It allows you to add general rules to derive new information.

o Example of a rule:
 Grandparent(X, Z) :- Parent(X, Y), Parent(Y, Z).

 Meaning: X is a grandparent of Z if X is a parent of Y and Y is a parent of Z.

4. Sophisticated Search

o A Prolog interpreter can search through facts and rules to answer queries.

o Example Query:

 If you ask Grandparent(Mary, John)?, Prolog will search its database and rules to
determine if the statement is true.

Why Use Prolog?

 Useful for AI tasks such as:

o Knowledge representation.

o Problem-solving.

o Natural language processing (NLP).

Example of Prolog Facts and Rules

 Facts:

Parent(Mary, John).

Parent(John, Anna).

 Rule:

Grandparent(X, Z) :- Parent(X, Y), Parent(Y, Z).

 Query:

Grandparent(Mary, Anna)?

o Prolog answers: Yes, because Mary is the grandparent of Anna.

Prolog Program

1. What is a Prolog Program?

 A Prolog program is a text file (usually with the .pl extension) that contains the facts and rules for
the program.

 It is like a database where facts are stored and rules are applied to derive new information.
2. The Query Mode in Prolog

 A query in Prolog is represented by the sign ?- at the beginning of the line.

 This asks Prolog to check whether the given statement is true or false, based on the facts and rules
defined in the program.

Example:

prolog

Copy code

?- parent(mary, john).

 Prolog will check if Mary is the parent of John by searching through the facts defined in the
program.

3. Loading a Prolog Program

 To load and run a Prolog program, you need to use a Prolog compiler.

 One popular compiler is SWI-Prolog.

Steps to Load a Program in SWI-Prolog:

1. Write your Prolog code and save it as a .pl file.

o Example: family.pl

2. Launch SWI-Prolog (or any other Prolog interpreter).

3. Load the Prolog program using the consult or [filename]. command.

o Example:

?- [family].

4. Once loaded, you can ask queries about the facts and rules in your program.

4. Example of a Prolog Program

Facts:

parent(mary, john).

parent(john, anna).

parent(anna, bob).

Rule:

grandparent(X, Z) :- parent(X, Y), parent(Y, Z).

Query:

?- grandparent(mary, bob).
 Explanation: Prolog will use the facts and rule to check if Mary is the grandparent of Bob.

 Answer: Yes, Mary is Bob's grandparent.

The Facts in Prolog

1. Simple Facts

 Facts are basic statements that represent information in the system.

o A simple fact is a statement that does not require any arguments.

Example:

prolog

Copy code

sunny.

rainy.

 These facts represent the weather conditions, sunny and rainy.

 No arguments are needed because they are just simple, standalone facts.

2. Facts with Arguments

 Facts with arguments represent relationships or properties between objects.

o These facts include arguments that describe specific entities or relationships between
them.

Example:

prolog

Copy code

likes(john, mary).

father(ram, luv).

 likes(john, mary) means John likes Mary.

 father(ram, luv) means Ram is the father of Luv.

These facts provide more detailed information by including arguments (e.g., john, mary, ram, luv).

3. How to Query Facts in Prolog

 Queries in Prolog are used to check if something is true based on the facts and rules defined
in the program.
Example 1:

eats(fred, oranges).

 This statement says: Fred eats oranges.

Example 2:

eats(tony, apple).

 This statement says: Tony eats apple.

Example 3:

eats(john, apple).

 This statement says: John eats apple.

4. Matching a Query with the Facts Database

 When you ask a query, Prolog checks if the query matches any facts in the database.

Example Query:

?- eats(fred, oranges).

 Prolog will check if the fact eats(fred, oranges) exists in the program.

o If it matches, Prolog will respond with Yes.

o If it does not match, Prolog will respond with No.

Example 2:

?- eats(john, apple).

 If there is a fact eats(john, apple) in the program, Prolog will return Yes.

Summary:

 Facts in Prolog represent information about the world, either simple or with arguments.

 Queries ask Prolog to check if a statement is true based on the facts in the program.

 Prolog uses matching to check if the query matches any facts in the database, responding with
Yes or No.

Variables and Unification in Prolog

1. What are Variables in Prolog?

 Variables in Prolog are distinguished from atoms because they start with a capital letter or an
underscore (_).
 They are placeholders that can represent any value during queries or pattern matching.

Examples:

?- eats(fred, What).

What = oranges.

 Here, What is a variable that Prolog replaces with oranges because the fact eats(fred, oranges)
exists in the program.

?- eats(Who, oranges).

Who = fred.

 Here, Who is a variable that Prolog replaces with fred.

2. Unification in Prolog

 Unification is the process by which Prolog matches a query with facts or rules in the database.

 During unification:

o Variables are replaced with values that make the query true.

o If Prolog finds multiple matches, it returns all possible solutions.

3. Example: Facts with Books

Facts:

book(1, title1, author1).

book(2, title2, author1).

book(3, title3, author2).

book(4, title4, author3).

Query 1: Check if we have a book from author2.

?- book(_, _, author2).

 Explanation:

o _ is an anonymous variable, meaning "any value is fine."

o This query checks if there is any book with author2 without specifying the book ID or
title.

 Result:

o Yes, because book(3, title3, author2) exists.

Query 2: Find books by author1.


?- book(_, X, author1).

 Explanation:

o _ ignores the book ID, and X is a variable to store the title.

o This query retrieves titles of books written by author1.

 Result:

o X = title1;

o X = title2.

Query 3: List all book IDs.

?- book(X, _, _).

 Explanation:

o X retrieves all book IDs, while _ ignores the title and author.

 Result:

o X = 1;

o X = 2;

o X = 3;

o X = 4.

Summary:

 Variables in Prolog are placeholders (e.g., What, Who, X) used to match facts dynamically.

 Unification is how Prolog matches queries with facts or rules in the database.

 Prolog can provide multiple solutions by unifying variables with all possible matches.

Rules in Prolog

1. What are Rules in Prolog?

 Rules are statements in Prolog that define relationships or logic between facts.

 A rule consists of:

o Left-hand side: The conclusion (what we want to prove).

o Right-hand side: The condition (what must be true for the conclusion to hold).

Syntax:

conclusion :- condition.
2. Example Rule: All Men Are Mortal

Facts:

human(socrate).

 This states that Socrate is a human.

Rule:

mortal(X) :- human(X).

 This defines that if X is human, then X is mortal.

3. Queries Using Rules

Query 1: Is Socrate Mortal?

?- mortal(socrate).

 Prolog will check:

o Does human(socrate) exist?

o Yes, so mortal(socrate) is true.

 Response:

o Yes.

Query 2: Who is Mortal?

?- mortal(X).

 Prolog will check all facts and apply the rule:

o human(socrate) makes mortal(socrate) true.

 Response:

o X = socrate.

Diagram: Rule Processing

1. Facts in Database:

human(socrate).

2. Rule:

mortal(X) :- human(X).

3. Query and Response:

o Query:?-mortal(socrate).
Response: Yes.
o Query?-mortal(X).
Response: X = socrate.

Summary:

 Rules define logic based on existing facts.

 The condition (right-hand side) must be true for the conclusion (left-hand side) to hold.

 Prolog uses rules to infer new knowledge or answer queries logically.

Step to run Prolog Program


 Download and install SWI prolog

 Create a new file with extension name .pl

 create a database and end the line with dot

 compile the database

 create a query and end the query with dot

Unification

What is Unification?

 Unification is like finding a match between two logical expressions by replacing variables with
actual values or objects.

 It helps Prolog or logic systems make connections between facts and rules to draw
conclusions.

Understanding the Process:

Unification is needed in reasoning to:

1. Make two statements look the same.

2. Use that similarity to draw a logical conclusion.

Generalized Modus Ponens (How It Works):

It’s a logical rule that says:

 If an object has a property and all objects with that property also have another property,
then the object must have the second property.
Easy Example:

Let’s take a simple real-world scenario:

1. Rule:

o “If a person is a student, they study.”

o In logic:

∀x (Student(x) → Studies(x)).

(This means for any person x, if x is a Student, then x Studies.)

2. Fact:

o “Sam is a student.”

o In logic:

Student(Sam).

3. Question:

o Does Sam study?

o In logic:

?- Studies(Sam).

4. Unification Process:

o Replace x in the rule with Sam so that it matches the fact:

If Student(Sam), then Studies(Sam).

o Using the rule, we can now infer:

Studies(Sam).

Another Simple Example:

1. Rule:

o “If it rains, the ground gets wet.”

o In logic:

∀x (Rains(x) → Wet(x)).

2. Fact:

o “It is raining in Delhi.”

o In logic:

Rains(Delhi).
3. Conclusion:

o Using unification, replace x with Delhi in the rule.

o Result:

Wet(Delhi).

o Meaning: If it’s raining in Delhi, the ground in Delhi is wet.

Key Points to Remember:

1. Unification is about matching variables to facts.

2. It allows us to apply general rules to specific cases.

3. Always substitute variables with actual values to infer new facts.

Unification Example: Simplified Explanation

What is the Task?

We are using the UNIFY algorithm to match a query with statements in the knowledge base.

 The query is: "Who does Ravna know?"

o In logic: Knows(Ravna, x)
(Here, x is a variable that can represent anyone Ravna knows.)

 The knowledge base contains these facts:

1. Knows(Ravna, Sita)

2. Knows(y, Ram)

3. Knows(y, Mother(y))

4. Knows(x, Radha)

Steps of Unification

The UNIFY algorithm compares the query Knows(Ravna, x) with each fact from the knowledge base
and tries to find substitutions that make them match.

Fact 1: Knows(Ravna, Sita)

 Matching Knows(Ravna, x) with Knows(Ravna, Sita)

o Here, Ravna matches exactly.

o Substitute x with Sita.

o Result:
x = Sita

Fact 2: Knows(y, Ram)

 Matching Knows(Ravna, x) with Knows(y, Ram)

o Substitute y = Ravna (to match the first argument).

o Substitute x = Ram (to match the second argument).

o Result:

x = Ram, y = Ravna

Fact 3: Knows(y, Mother(y))

 Matching Knows(Ravna, x) with Knows(y, Mother(y))

o Substitute y = Ravna (to match the first argument).

o Substitute x = Mother(Ravna) (to match the second argument).

o Result:

y = Ravna, x = Mother(Ravna)

Fact 4: Knows(x, Radha)

 Matching Knows(Ravna, x) with Knows(x, Radha)

o The first argument, Ravna, does not match the variable x.

o No unification is possible.

o Result:

FAIL

Summary Table

Query Fact Unification Result

Knows(Ravna, x) Knows(Ravna, Sita) x = Sita

Knows(Ravna, x) Knows(y, Ram) x = Ram, y = Ravna

Knows(Ravna, x) Knows(y, Mother(y)) y = Ravna, x = Mother(Ravna)

Knows(Ravna, x) Knows(x, Radha) FAIL

Diagram Representation

1. Query: Knows(Ravna, x)

2. Matching Facts:
Knows(Ravna, Sita) → x = Sita

Knows(y, Ram) → x = Ram, y = Ravna

Knows(y, Mother(y)) → x = Mother(Ravna), y = Ravna

Knows(x, Radha) → FAIL

Key Takeaways

1. Unification means finding substitutions to make two logical statements match.

2. If no substitutions can make the statements identical, unification fails.

3. Variables (x, y) are placeholders that get replaced with actual values during unification.

Simplified Explanation of the Unify Algorithm

Purpose of Unify Algorithm


The Unify algorithm tries to match two logical expressions (P and Q) by finding substitutions for
variables. If it’s possible to make P and Q identical, the algorithm returns the required
substitutions; otherwise, it returns FAIL.

Steps of the Algorithm

Step 1: Check if P and Q are variables or constants

 If P and Q are identical, no substitution is needed.

o Example: x = x → No change needed. Return NIL.

 If P is a variable:

o If P is part of Q, unification is not possible (FAIL) to avoid infinite loops.

o Otherwise, replace P with Q.

o Example:

 P = x, Q = 5 → Substitute x = 5.

 P = x, Q = f(x) → FAIL because x is part of f(x).

 If Q is a variable, do the same as above but swap P and Q.

Step 2: Check predicate symbols in P and Q

 If the predicate names (like Knows, Loves, etc.) in P and Q are different, unification fails.

o Example: Knows(John, Mary) vs. Likes(John, Mary) → FAIL.


Step 3: Check the number of arguments

 If P and Q have different numbers of arguments, they cannot unify.

o Example:

 Knows(John) vs. Knows(John, Mary) → FAIL.

Step 4: Initialize substitutions

 Start with no substitutions (SUBST = NIL). This will store all the changes made during the
unification process.

Step 5: Match arguments one by one

 For each pair of arguments in P and Q:

o Call the Unify algorithm recursively on the arguments.

o If FAIL occurs for any argument pair, stop and return FAIL.

o Otherwise, update P and Q with the substitution. Add the substitution to SUBST.

Step 6: Return the substitutions

 After all arguments are unified, return SUBST, which contains all the substitutions needed to
make P and Q identical.

Easy Example

Input:
Unify Knows(John, x) and Knows(y, Mary).

Step-by-Step Execution:

1. Predicate Check:

o Both have the same predicate, Knows. Proceed.

2. Argument Count Check:

o Both have two arguments. Proceed.

3. Match 1st Argument:

o John and y: Substitute y = John.

4. Match 2nd Argument:

o x and Mary: Substitute x = Mary.


Result:
Substitutions are:

y = John

x = Mary

Key Points

 FAIL occurs if:

1. Variables lead to infinite loops.

2. Predicate symbols or argument counts don’t match.

 Successful Unification provides a list of substitutions.

Skolemization Explained

What is Skolemization?

Skolemization is a process used in logic to eliminate existential quantifiers from logical


expressions. It achieves this by replacing the existentially quantified variables with Skolem
constants or Skolem functions, simplifying the formula for inference.

Why is Skolemization Needed?

 In first-order logic, existential quantifiers (∃) represent the existence of something, making
them difficult to work with during inference.

 Skolemization removes these quantifiers while retaining the logical meaning of the expression.

Steps in Skolemization

1. Existential Quantifiers Without Universal Quantifiers

o Replace the existential variable with a new Skolem constant.

o Example:

 ∃x Rich(x) becomes Rich(G1), where G1 is a new constant.

2. Existential Quantifiers Preceded by Universal Quantifiers

o Replace the existential variable with a Skolem function.

o The function’s arguments correspond to the variables in the preceding universal


quantifiers.

o Example:
 ∀x ∃y P(x, y) becomes ∀x P(x, f(x)), where f(x) is a Skolem function.

Examples

Example 1: Constant Replacement

Input: ∃x Rich(x)

 There are no universal quantifiers. Replace x with a Skolem constant G1.


Output: Rich(G1)

Example 2: Function Replacement

Input: ∀x ∃y P(x, y)

 The existential quantifier ∃y is preceded by the universal quantifier ∀x.


 Replace y with a Skolem function f(x).
Output: ∀x P(x, f(x))

Example 3: Nested Quantifiers

Input: ∃u ∀v ∀x ∃y : P(f(u), v, x, y) ⇒ Q(v, u, y)

1. Start with ∃u. Replace u with a Skolem constant a.


Result: ∀v ∀x ∃y : P(f(a), v, x, y) ⇒ Q(v, a, y)

2. Now, for ∃y, replace y with a Skolem function g(v, x) (because y is preceded by universal
quantifiers ∀v and ∀x).
Result: ∀v ∀x P(f(a), v, x, g(v, x)) ⇒ Q(v, a, g(v, x))

Key Points to Remember

 Skolem Constant: Used when there are no universal quantifiers.

 Skolem Function: Used when existential quantifiers are preceded by universal quantifiers.

 Skolemization makes logical formulas easier to use in inference while preserving their
meaning.

Forward and Backward Chaining

Forward Chaining (Data-Driven Approach)

 What It Is: Works from given facts to arrive at a conclusion step by step.

 How It Works:

1. Start with facts in the working memory.

2. Check which rule's condition matches these facts in the rule base.
3. If a rule matches, execute its action, which may add new facts to the working memory.

4. Repeat the process until the desired conclusion is reached or no more rules apply.

 Key Features:

o Driven by the data available.

o Does not require the goal to be specified beforehand.

o Can seem disorganized because it processes rules sequentially without targeting a


specific outcome.

 Example:

o Rule 1: If it rains, the ground gets wet. (Rain → Wet ground)

o Rule 2: If the ground is wet, then plants grow. (Wet ground → Plants grow)

o Fact: It is raining.

o Process:

 Fact "Rain" triggers Rule 1 → Fact "Wet ground" is added.

 Fact "Wet ground" triggers Rule 2 → Fact "Plants grow" is added.

Forward chaining is ideal when:

1. All facts are provided upfront:

o The problem statement includes all the necessary facts.

o Example: You know the weather conditions (e.g., raining, sunny) and want to deduce
possible outcomes (e.g., plants growing, traffic delays).

2. Many possible goals exist, but fewer patterns of data:

o It is unclear which goal to focus on initially.

o Example: In a medical diagnosis, many diseases might match similar symptoms, so


forward chaining works step-by-step from symptoms to conclusions.

3. No clear goal can be guessed at the start:

o The goal isn't obvious at the beginning of the problem-solving process.

o Example: In troubleshooting, you might start with facts about a malfunctioning device
and gradually deduce the issue by applying rules.
See forward and backward chaining illustration diagram and diff of
forward and backward chaining from ppt

Backward Chaining/Reasoning

What is Backward Chaining?

 Works from the conclusion (goal) back to the facts.

 Known as the goal-driven approach.


How it Works:

1. Match a goal in memory to the conclusions in the rule base.

2. When a rule matches, it generates sub-goals (facts to verify).

3. Repeat this process until all sub-goals are verified or no further rules can be applied.

4. The system appears focused and logical because it directly targets the solution.

Example:

Goal: Is the patient sick with flu?


Rule: If a patient has a fever and a sore throat, they have the flu.

1. The system starts with the goal: "Patient has flu?"

2. Checks for fever: "Does the patient have a fever?"

o If yes, proceeds to the next condition.

3. Checks for sore throat: "Does the patient have a sore throat?"

o If yes, concludes: "The patient has flu."

When to Use Backward Chaining:

1. Goal is known upfront:

o Example: Diagnosing a specific disease, like identifying if a patient has pneumonia.

2. System can request additional data during the process:

o Example: In medical diagnosis, the system may ask for lab test results to proceed
further.

Applications:

 Game theory: Strategy planning in games.

 Automated theorem proving: Proving mathematical/logical statements.

Forward and Backward Chaining Simplified

 Backward Chaining (Top-down approach):

 When to Use:

 You already know what you're looking for (goal is predefined).

 How it Works:

 Starts with the goal and works backward to find the facts that support it.

 Example:

 Goal: "Is the patient sick with flu?"

 Checks conditions (like fever, sore throat) to confirm or deny the conclusion.
 Forward Chaining (Bottom-up approach):

 When to Use:

 You don’t know the final solution or goal from the start.

 How it Works:

 Starts with the facts and works forward to derive a conclusion.

 Example:

 Given symptoms like fever, cough, and sore throat, the system concludes, "The patient may
have the flu."

 Key Differences:

 Aspect  Backward Chaining  Forward Chaining

 Approach  Top-down (goal-driven)  Bottom-up (data-driven)

 Start Point  From the goal  From the facts

 When to
 Clear goal known upfront  Goal is unknown or broad
Use

 Diagnosing a disease, theorem  Decision-making, expert


 Examples
proving systems

 Quick Tip for Exams:

 Backward Chaining = "Working from goal to facts."

 Forward Chaining = "Working from facts to goal."

Resolution in Logic

Resolution Principle Overview:

 Introduced by Robinson (1965): A method for deriving conclusions in logic, particularly useful
in automated theorem proving.

 Principle:

o Given two clauses, A and B, if there is a complementary literal (e.g., one is P and the
other is ¬P) between them, remove the literals and combine the rest of the clauses to
create a resolvent.

Steps of Resolution:

1. Convert to Clause Form:

o Convert all statements to clause form (a conjunction of disjunctions of literals).

2. Negate the Goal:


o To prove a statement P, negate it and convert it to clause form, then add it to the set
of clauses.

3. Repeat Until Contradiction or Success:

o Select two clauses (parent clauses).

o Resolve them by finding complementary literals and combining the rest of the literals
(with appropriate substitutions).

o If the resolvent is empty, a contradiction is found, and the statement is false.

o If no contradiction is found, add the resolvent to the set and repeat.

Example with Marcus and Caesar:

Given Statements (in logical form):

 Marcus was a man


Man(Marcus)

 Marcus was a Pompeian


Pompeian(Marcus)

 All Pompeians were Romans


∀x Pompeian(x) ⇒ Roman(x) → ¬Pompeian(x1) ∨ Roman(x1)

 Caesar was a ruler


Ruler(Caesar)

 All Romans were either loyal to Caesar or hated him


∀x Romans(x) ⇒ Loyalto(x,Caesar) ∨ Hate(x,Caesar)
→ ¬Roman(x2) ∨ Loyal(x2,Caesar) ∨ Hate(x2,Caesar)

 Everyone is loyal to someone


∀x ∃y Loyal(x,y)
→ Loyal(x3, f(x3))

 Men only try to assassinate rulers they are not loyal to


∀x ∀y Men(x) ∧ Ruler(y) ∧ TryAssassinate(x,y) ⇒ ¬Loyalto(x,y)
→ ¬Man(x4) ∨ ¬Ruler(y1) ∨ ¬TryAssassinate(x4, y1) ∨ ¬Loyalto(x4, y1)

 Marcus tried to assassinate Caesar


TryAssassinate(Marcus, Caesar)

Question: Does Marcus hate Caesar?

1. Negate the Goal:

o To prove Hate(Marcus, Caesar), negate it:


¬Hate(Marcus, Caesar)

2. Apply Resolution:

o Now, apply resolution to the set of clauses with the negation of the goal.
o Find complementary literals and create resolvents by combining clauses until a
contradiction is found or the goal is confirmed.

Example of Resolution Steps:

1. Resolving ¬Hate(Marcus, Caesar) with ¬Roman(x2) ∨ Loyal(x2,Caesar) ∨ Hate(x2,Caesar):

o Complementary literals: ¬Hate(Marcus, Caesar) and Hate(x2, Caesar)

o Resolve these and continue.

2. Continue Resolving until an empty clause is found (indicating a contradiction), or no more


resolvents can be generated.

Conclusion:

By applying the resolution principle, if an empty clause is derived, it indicates a contradiction,


meaning Marcus must hate Caesar.

See its diag in ppt

Knowledge Representation
Knowledge Based Systems
Definition and Importance of Knowledge
 Knowledge is the body of facts and principles accumulated by humankind,
and it plays a crucial role in intelligence.
 Intelligence requires access to knowledge, and in both biological
organisms and computers, knowledge is stored in various forms.
o In biological organisms, it’s stored in neurons.
o In computers, it’s stored as symbolic structures like magnetic spots
and voltage states.

Knowledge Vs Data
 Data refers to raw facts (e.g., a patient's medical record).
 Knowledge is the learned information (e.g., a physician’s medical training
and experience).
Example:
 Data: Patient’s history, vital signs, drug responses.
 Knowledge: What the physician learned during education and practice.
Knowledge is derived from data and information.

Types of Knowledge
1. Procedural Knowledge: Knowledge of how to perform tasks (e.g., steps to
solve an algebraic equation).
2. Declarative Knowledge: Passive knowledge expressed as facts (e.g.,
personal data in a database).
3. Heuristic Knowledge: Knowledge used to solve complex problems, often
through judgment or rule of thumb.

Knowledge-Based Agents
A knowledge-based agent combines general knowledge with percepts to
infer hidden aspects of the current state and decide on actions.
Process:
1. It TELLs the knowledge base what it perceives.
2. It ASKs the knowledge base what action to perform.
3. It performs the chosen action.

Components of Knowledge-Based System


 The Knowledge Base stores the knowledge separately from the control
and inferencing components.
 This allows new knowledge to be added or existing knowledge to be
refined without affecting the rest of the system.

Properties of Knowledge Representation Strategies


1. Representational Adequacy: The ability to represent required knowledge.
2. Inferential Adequacy: The ability to manipulate knowledge to produce
new knowledge.
3. Inferential Efficiency: Directing inferential mechanisms to the most
productive directions.
4. Acquisitional Efficiency: Acquiring new knowledge using automatic
methods.

Approaches to Knowledge Representation


1. Simple Relational Knowledge: Using columns to systematically store facts,
providing little opportunity for inference.
2. Inheritable Knowledge: Knowledge where objects inherit values from
classes. This method allows for inference mechanisms like property
inheritance.
3. Inferential Knowledge: Using formal logic to derive new facts (e.g., “All
dogs have tails” can be represented as dog(x) ➡ hasatail(x)).
4. Procedural Knowledge: Knowledge encoded in procedures or small
programs that define how to do specific tasks.

Representation of Knowledge
1. Propositional Logic
2. First-Order Predicate Logic (FOPL)
3. Frames & Associative Networks
4. Scripts
5. Case Grammar Theory
6. Production Rules
7. Inference System
8. Forward & Backward Deduction
Each of these methods offers ways to represent knowledge, ensuring that
systems can store, manipulate, and infer from information effectively.
See its all diags in ppt
Ontology Engineering
What is Ontology Engineering?
Ontology engineering refers to the process of developing ontologies for a
specific domain. This involves:
 Defining terms in the domain and relationships between them.
 Defining concepts (classes) in the domain.
 Organizing concepts in a subclass-superclass hierarchy.
 Defining attributes and properties (slots) for each class, including
constraints on their values.
 Defining individuals and filling in their property values.

Ontology Engineering vs Object-Oriented Modeling


1. Ontology Engineering:
o Reflects the structure of the world.
o Focuses on concepts.
o Formal classes are sets, defined by other classes, attributes, and
associations.
o Properties refer to attributes and associations.
o Follows the Open World Assumption (lack of knowledge doesn’t
imply negation).
2. Object-Oriented Modeling:
o Reflects the structure of data and behavior (code).
o Focuses on behavior (methods).
o Classes are templates for creating objects.
o Attributes and associations have different meanings.
o Follows the Closed World Assumption (lack of knowledge implies
negation).
Open World Assumption (OWA) vs Closed World Assumption (CWA)
 Open World Assumption: Lack of knowledge about a fact doesn't imply
the negation of the fact.
o Example: If Americana is the only pizza, but we don’t know its base,
it doesn’t mean the pizza doesn’t have a base.
 Closed World Assumption: Lack of knowledge implies the negation of the
fact.
o Example: If ItalianPizza has bases CrispBase and HardBase, lack of
further bases would violate the constraint in a closed world.

Logic: Open vs Closed


 Open (Monotonic) Logic: Different answers for queries when more
knowledge is added.
 Closed Logic: Constraints are fixed; no addition can change existing
answers.
Example:
 In Open World: Americana pizza exists, but its base might not be known.
 In Closed World: A fact about a pizza base must be definite.

Axioms for OWL Ontology


An OWL ontology consists of axioms that define the relationships between
classes, roles, and individuals.
 Class Axioms:
o C ⊑ D: Class C is a subclass of class D.
o C ≡ D: Class C is equivalent to class D.
 Role Axioms:
o R ⊑ S: Role R is a subclass of role S.
o Func(R): Role R is functional (one-to-one relation).
o Trans(S): Role S is transitive (if A relates to B and B relates to C, then
A relates to C).
 Individual Axioms:
o a:C: Individual 'a' is an instance of class C.
o <a,b>:R: Individual 'a' is related to individual 'b' through role R.
Example:
 Fish ⊑ Animal ⊓ CanSwim
 Jellyfish ⊑ Fish ⊓ ¬hasVertebra

Ontology Engineering Process


Ontology engineering is an iterative process that involves:
1. Determining scope.
2. Considering reuse of existing ontologies.
3. Enumerating terms.
4. Defining classes.
5. Defining properties and constraints.
6. Creating instances.
This process may be repeated as the ontology evolves.

Research Issues in Ontology Engineering


1. Content Acquisition: Gathering and integrating knowledge from various
sources.
2. Analysis and Evaluation: Ensuring the ontology is accurate and useful.
3. Maintenance: Keeping the ontology up to date.
4. Ontology Merging: Combining multiple ontologies into a cohesive whole.
Conclusion
 No single correct ontology exists for any domain; ontology design is
subjective.
 Ontology design is creative, and different people may design different
ontologies for the same domain.
 The application’s needs and the designer’s understanding of the domain
will influence ontology design choices.
 The quality of an ontology is best assessed by its performance in real-
world applications.
Categories and Objects
Overview
 Ontology involves organizing everything in the world into a hierarchy of
categories. This categorization helps structure knowledge and facilitates
reasoning about the world.
 The organization of objects into categories is a key part of knowledge
representation, as it enables efficient storage, retrieval, and inference of
information.
 While interaction with the world happens at the level of individual
objects, reasoning typically occurs at the level of categories. This allows
us to generalize, make predictions, and infer new knowledge based on the
properties of categories rather than focusing on each object individually.
Subclass Relations and Taxonomy
 Subclass Relations organize categories into a taxonomy or taxonomic
hierarchy, which is a structured way of categorizing entities. A taxonomy
arranges categories based on hierarchical relationships, where more
specific categories (subclasses) are nested under broader categories
(superclasses).
 Taxonomies have been a key organizational tool for centuries, especially
in technical fields. For example, in systematic biology, a taxonomy is used
to classify all living and extinct species, grouping them based on shared
characteristics and evolutionary relationships.
 Taxonomies are also crucial in general commonsense knowledge. They
help in structuring how we think about and categorize everyday concepts,
making it easier to reason about the relationships between different
categories.
 First-order logic (FOL) simplifies the process of expressing facts about
categories. It allows us to:
o Relate objects to categories (e.g., "a dog is an animal").
o Quantify over category members (e.g., "every animal has a
backbone").
This ability to represent facts about categories is fundamental to reasoning
and inference in knowledge representation systems.
Example of Category Representation in First-Order Logic
Shopper’s Goal and Categorization
A shopper typically aims to buy a basketball rather than a specific basketball
like BB9. This illustrates the distinction between categories and individual
objects.
Two Choices for Representing Categories
1. Predicates: We can represent a category using predicates like
Basketball(b) where b is an object belonging to the category of
basketballs.
2. Reification: Alternatively, we can represent the category itself as an
object. For example, BB9 ∈ Basketballs means that BB9 is an element of
the category Basketballs.

Example Continued
1. Subclass Relations:
o A category can be a subcategory of another category, establishing a
taxonomic hierarchy:
 Basketballs ⊂ Balls (All basketballs are a type of ball).
2. Properties of Category Members:
o All members of a category have certain properties. For example:
 If x ∈ Basketballs, then Spherical(x) (All basketballs are
spherical).
3. Recognition of Category Members by Properties:
o A category's members can be identified by specific properties. For
example:
 If x ∈ Balls, and Orange(x) ∧ Round(x) ∧ Diameter(x) = 9.5,
then x ∈ Basketballs (A ball with these properties is a
basketball).
4. Category Properties:
o A category itself can also have properties. For instance:
 Dogs ∈ Domesticated Species (Dogs are members of the
category of domesticated species).

Further Example
 Categories Classify Objects: Categories are used to classify objects based
on common properties or definitions. For example:
o ∀x ∈ Tomatoes ⇒ Red(x) ∧ Round(x) (All tomatoes are red and
round).
 Representing Categories:
o Predicates: Tomato(x) means x is a tomato.
o Sets: We can also represent categories using sets. For instance,
Tomatoes as a set of tomatoes (reification).

Roles of Category Representation


1. Instance Relations (is-a):
o x1 ∈ Tomatoes means x1 is an instance of the category Tomatoes.
2. Taxonomical Hierarchies (Subset):
o Tomatoes ⊂ Fruit indicates that tomatoes are a subset of the
broader category Fruit.
3. Inheritance of Properties:
o Members of a category inherit the properties of that category. For
instance, since all tomatoes are red and round, these properties are
inherited by each instance of the category Tomatoes.
4. Decompositions:
o Categories may have exhaustive decompositions, meaning that the
members of a category can be fully classified and decomposed
based on their properties or relationships within the hierarchy.
Physical Composition
The PartOf relation is used to express that one object is a part of another.
This relation can form part-of hierarchies, similar to subset hierarchies,
where an object can be considered part of a broader entity.
Example:
 PartOf(Bucharest, Romania) (Bucharest is part of Romania).
 PartOf(Romania, EasternEurope) (Romania is part of Eastern Europe).
 PartOf(EasternEurope, Europe) (Eastern Europe is part of Europe).
 PartOf(Europe, Earth) (Europe is part of Earth).
Properties of the PartOf Relation:
 Transitive: If PartOf(x, y) and PartOf(y, z) hold true, then PartOf(x, z) must
also be true. For example, if Bucharest is part of Romania, and Romania is
part of Eastern Europe, then Bucharest is also part of Eastern Europe.
 Reflexive: Every object is part of itself, meaning PartOf(x, x) holds true.

Measurements
In both scientific and commonsense knowledge, objects can have
measurable properties such as height, mass, cost, etc. The values assigned to
these properties are referred to as measures.
Conversion Between Units:
Measurements often involve converting between different units. For
example, length can be expressed in inches or centimeters:
 Length(L1) = Inches(1.5) = Centimeters(3.81) (Converting 1.5 inches to
3.81 centimeters).
The conversion between units can be expressed as:
 Centimeters(2.54 × d) = Inches(d) (For example, 1 inch = 2.54 centimeters).
Example of Measures:
 Diameter(Basketball12) = Inches(9.5) (The diameter of Basketball12 is 9.5
inches).
 ListPrice(Basketball12) = $(19) (The price of Basketball12 is $19).
 d ∈ Days ⇒ Duration(d) = Hours(24) (If d is a day, its duration is 24 hours).
These measurements and conversions help describe objects and their
properties in a standardized and logical manner.
Mental Events and Mental Objects
Overview
Events are actions or occurrences that can be described using formal logic or
event calculus. In this context, mental events and mental objects can be
understood as events and objects occurring within the mind.

Events
In event calculus, fluents and events are reified. A fluent refers to a state or
fact that can change over time. For example, At(Shankar, Berkeley) refers to
the fact that Shankar is in Berkeley, but this alone doesn’t tell us whether it is
true or not. To assert its truth at a given time t, we use the predicate T, as in
T(At(Shankar, Berkeley), t).
Events are instances of event categories, and can be described using
predicates. For example:
 The event E1 of Shankar flying from San Francisco to Washington, D.C. can
be described as:
o E1 ∈ Flyings ∧ Flyer(E1, Shankar) ∧ Origin(E1, SF) ∧ Destination(E1,
DC)
This formalization captures the details of the event (the flyer, the origin, and
destination) and places it within the broader category of "flying events."

Mental Events
Mental events are cognitive activities or processes that occur within an
individual's mind. These events can include:
 Thinking
 Remembering
 Perceiving
 Imagining
 Experiencing emotions
 Making decisions
 Problem-solving
Mental events are subjective experiences, and they encompass both
conscious and unconscious states. For example, thinking about an upcoming
event or feeling anxious about a situation would both be mental events, as
they are processes that occur in the mind.

Mental Objects
Mental objects are the content or objects of thought within the mind. These
are the things, ideas, or concepts that we think about during mental events.
They can be:
 Concrete: Representations of sensory experiences, like the mental image
of an apple or a dog.
 Abstract: Ideas or concepts like justice, love, or mathematical equations.
In philosophy, the study of mental objects focuses on how the mind
represents or perceives the external world. For example, the mind might
represent the concept of "freedom" or "equality" as a mental object, even
though these are abstract concepts without physical form.
Key Differences:
 Mental Events: The activities or processes (e.g., thinking, imagining) that
occur within the mind.
 Mental Objects: The specific concepts, ideas, or representations that are
the focus of mental events.
Both mental events and objects are fundamental in understanding cognition
and consciousness, as they form the basis for how we perceive and process
the world around us.
Simple Overview of Belief Representation
In AI, beliefs are important for making decisions and planning, especially
when agents need to consider themselves and others.

How Are Beliefs Represented?


1. Beliefs as Mental Objects:
Beliefs are treated as things in the mind that can be thought about, and
are represented in a language that computers can understand.
2. Inference Rules:
Once beliefs are represented in a formal way, we can use rules to reason
about them. These rules help agents make new conclusions based on
what they already believe.

How Do Agents Reason About Their Beliefs?


1. Basic Reasoning:
If an agent a believes p (a fact), and also believes that if p is true, then q is
true, then the agent can also believe q.
For example:
If the agent believes "If it rains, the ground will be wet" and it believes "It
rains", then it can believe "The ground is wet."
2. Meta-Beliefs:
An agent can also believe that it believes something. For example, if the
agent believes p, it can also believe "I believe p."

Examples of Belief Representation


1. Learning a Fact:
When a robot learns something new, like p, it can hold the belief "I know
p." This is represented as:
"After learning p, the robot believes p."
2. Lois Knows Superman Can Fly:
If we say Lois knows Superman can fly, it can be written as:
"Lois believes Superman can fly."
But if Superman is the same as Clark Kent, Lois also knows Clark Kent can
fly because Superman = Clark Kent.

Conclusion
In simple terms, beliefs in AI are treated as things that agents can think about,
and we use rules to make them reason logically. This allows agents to make
decisions based on what they know or believe.
Reasoning Systems for Categories (Simplified)

What is Reasoning?
 Reasoning is the logical process of drawing conclusions or making
predictions based on existing knowledge.
 It enables AI systems to think rationally, similar to humans.

Types of Reasoning
1. Deductive Reasoning:
o Derives a specific conclusion from general facts.
o Example:
 Premise 1: All humans eat veggies.
 Premise 2: Suresh is a human.
 Conclusion: Suresh eats veggies.
2. Inductive Reasoning:
o Makes generalizations based on specific observations.
o Example:
 Premise: All pigeons we saw are white.
 Conclusion: All pigeons are white.
3. Abductive Reasoning:
o Finds the most likely explanation for an observation.
o Example:
 Premise: The cricket ground is wet.
 Conclusion: It might have rained.
4. Common Sense Reasoning:
o Relies on everyday experiences to make assumptions.
o Example:
 If I put my hand in fire, it will burn.
5. Monotonic Reasoning:
o Once a conclusion is drawn, it cannot be invalidated by new facts.
o Example:
 The Earth revolves around the Sun.
6. Non-monotonic Reasoning:
o Conclusions can change with new information.
o Example:
 Birds can fly → Pitty is a bird → Pitty can fly.
 Add info: Pitty is a penguin → Pitty cannot fly.
Organizing and Reasoning with Categories
1. Semantic Networks:
o Definition: Graphical systems to organize and reason with
categories.
o Benefits:
 Visualize relationships.
 Infer properties efficiently.
2. Description Logics:
o Definition: A formal language for defining categories and their
relationships.
o Tasks:
 Subsumption: Check if one category is a subset of another.
 Classification: Check if an object belongs to a category.
 Consistency: Ensure definitions don’t conflict.

Frames and Slots


1. Frames:
o Represent objects or concepts with properties (called slots).
o Proposed by Marvin Minsky (1975).
2. Slots:
o Define characteristics of frames.
o Have facets like domain, range, default value, etc.
o Can have demons: Functions activated on certain conditions.
 If-needed: Activates when the slot is read.
 If-added: Activates when a value is added to the slot.
Example
Frame: Person
 Super-class: Class
 Slots:
o Age:
 Domain: Person
 Range: Integer (0–140)
 Default: None
Slot Example:
 Slot: Age
o Value: 28
o Range: Integer (0–140)
o Max Cardinality: 1

This structure simplifies reasoning, ensuring AI systems can categorize and


infer efficiently.
Diags from ppt
What is Default Logic?
 It’s a way of making assumptions to draw conclusions when information
is incomplete or uncertain.
 Default: Assume something is true unless proven otherwise.

What is Default Reasoning?


 Purpose: To avoid listing all exceptions. Instead, start with general rules
and add exceptions later.
 Two Types:
o Monotonic Reasoning: Once a conclusion is made, it doesn’t
change even if new facts are added.
o Non-Monotonic Reasoning: Conclusions can change if new facts
are added.

How Does Default Reasoning Work?


1. Normal Assumption (H): Assume everything is normal unless specified
otherwise.
2. What Follows (F): Use the assumption to draw conclusions.
3. Explanation: Justify why the conclusion is valid.

Examples
Basic Example
 Default: "Articles about AI are interesting."
 Facts:
o If an article is about AI, it is interesting.
 Conclusion: Articles about AI are interesting.
Adding Exceptions
 Fact: Some AI articles are boring.
 Rule: If an article is boring, it is not interesting.
 Result: We cannot assume all AI articles are interesting anymore.

Overriding Rules
 Specific rules override general rules.
 Example:
o General Rule: "Articles about AI are interesting."
o Specific Rule: "Articles about formal logic are boring."
o Result: Formal logic articles are not interesting, even if they are
about AI.
Key Points to Remember
1. Default Logic: Assume truth unless contradicted.
2. Non-Monotonic Reasoning: New information can change old conclusions.
3. Conflicts: Specific rules always win over general ones.
4. Purpose: Simplifies reasoning when information is incomplete.

You might also like