0% found this document useful (0 votes)
18 views47 pages

Artificial Intelligence 2 Units Notes-1

Ai
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)
18 views47 pages

Artificial Intelligence 2 Units Notes-1

Ai
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/ 47

1

Artificial Intelligence and Applications

Introduction to Artificial Intelligence (AI)-........................................................................... 4


Key Features of AI:.............................................................................................................4
Categories of AI:.................................................................................................................4
Applications of AI:...............................................................................................................4
Benefits of AI:..................................................................................................................... 4
Challenges:........................................................................................................................ 4
Emulation of Human Cognitive Processes in AI:................................................................ 6
Key Cognitive Processes Emulated by AI:......................................................................... 6
Knowledge Search Trade-off in AI:.......................................................................................7
Example:............................................................................................................................ 7
The Trade-off:.....................................................................................................................7
Stored Knowledge in AI-........................................................................................................8
Types of Stored Knowledge:.............................................................................................. 8
How Stored Knowledge is Used:........................................................................................8
Benefits:............................................................................................................................. 8
Semantic nets-........................................................................................................................9
Key Components:...............................................................................................................9
Example:............................................................................................................................ 9
How Semantic Networks are Used in AI:........................................................................... 9
Benefits:........................................................................................................................... 10
Challenges:...................................................................................................................... 10
Abstract View of Modeling in AI-.........................................................................................11
Types of Models in AI:...................................................................................................... 11
Modeling Process:............................................................................................................ 11
Example of Modeling:....................................................................................................... 11
In Simple Terms:...............................................................................................................11
Elementary Knowledge in AI:..............................................................................................12
Computational Logic in AI:................................................................................................. 14
Key Concepts in Computational Logic:............................................................................ 14
Why Computational Logic is Important in AI:................................................................... 15
Logical Connectives:........................................................................................................... 16
Following is the summarized table for Propositional Logic Connectives:.........................16
Truth Table:........................................................................................................................... 16
Predicate Logic:................................................................................................................... 18
Key Components of Predicate Logic:............................................................................... 18
Knowledge Organization and Manipulation in AI..............................................................19
1. Knowledge Organization:............................................................................................. 19
Key Methods of Knowledge Organization:................................................................. 19
1. Knowledge Representation:......................................................................................... 19
2. Knowledge Manipulation:............................................................................................. 20
Key Methods of Knowledge Manipulation:................................................................. 20
Knowledge Acquisition....................................................................................................... 22
2

Key Concepts in Knowledge Acquisition:......................................................................... 22


Summary:......................................................................................................................... 23
LISP in Artificial Intelligence (AI)-.......................................................................................24
Why LISP is Suitable for AI.............................................................................................. 24
Applications of LISP in AI................................................................................................. 24
Syntax of LISP...................................................................................................................... 26
Basic Syntax Rules:................................................................................................... 26
Distinction Between LISP and Prolog...............................................................................28
1. Programming Paradigm............................................................................................... 28
2. Syntax.......................................................................................................................... 28
3. Problem-Solving Approach...........................................................................................28
4. Core Applications......................................................................................................... 28
5. Execution Model...........................................................................................................29
6. Strengths...................................................................................................................... 29
7. Weaknesses.................................................................................................................29
LISP Input/Output (I/O)........................................................................................................ 31
1. Input Operations..................................................................................................... 31
2. Output Operations.................................................................................................. 31
Local Variables in LISP........................................................................................................31
1. let for Local Variables............................................................................................. 31
Interaction and Recursion in LISP......................................................................................32
1. Interaction in LISP........................................................................................................ 32
Example: Asking for the User's Name..............................................................................32
Explanation:......................................................................................................................32
Recursive Function Structure:.................................................................................... 33
Example: Factorial Function....................................................................................... 33
Property list and array alternative languages-.................................................................. 34
1. Property List Alternatives............................................................................................. 34
Alternatives in Other Languages:............................................................................... 34
2. Array Alternatives......................................................................................................... 34
Alternatives in Other Languages:............................................................................... 34
Formalized Logic and Properties of Well-Formed Formulae (WFFs)- Or WFRS (Well
Formed Rule System).......................................................................................................... 36
1. What is a Well-Formed Formula (WFF)?..................................................................... 36
Examples of WFFs:.................................................................................................... 36
2. Rules for Constructing WFFs....................................................................................... 36
Symbolic Representation in WFFs..................................................................................... 36
Components of WFFs:............................................................................................... 36
Non-Deductive Inference Methods-.................................................................................... 38
Types of Non-Deductive Inference Methods.................................................................... 38
1. Inductive Reasoning...............................................................................................38
2. Abductive Reasoning............................................................................................. 38
3. Analogical Reasoning.............................................................................................38
4. Statistical Reasoning.............................................................................................. 39
3

5. Heuristic Reasoning............................................................................................... 39
6. Fuzzy Logic............................................................................................................ 39
7. Default Reasoning..................................................................................................39
8. Commonsense Reasoning..................................................................................... 40
Comparison of Deductive and Non-Deductive Methods.................................................. 40
Conclusion........................................................................................................................40
Inconsistencies and Uncertainties in Truth Maintenance Systems (TMS)-.................... 41
Key Concepts................................................................................................................... 41
1. Inconsistencies in TMS.......................................................................................... 41
Example of Inconsistency:..........................................................................................41
2. Uncertainties in TMS.............................................................................................. 41
Example of Uncertainty:............................................................................................. 41
How TMS Handles Inconsistencies and Uncertainties.....................................................41
1. Assumption-Based Truth Maintenance System (ATMS)........................................ 42
2. Justification-Based Truth Maintenance System (JTMS).........................................42
3. Probabilistic TMS (PTMS)...................................................................................... 42
Default Reasoning and Closed World Assumption-......................................................... 43
1. Default Reasoning........................................................................................................43
Definition:................................................................................................................... 43
Key Features:............................................................................................................. 43
Example:.................................................................................................................... 43
Applications:............................................................................................................... 43
Challenges:................................................................................................................ 43
2. Closed World Assumption (CWA)................................................................................ 44
Definition:................................................................................................................... 44
Key Features:............................................................................................................. 44
Example:.................................................................................................................... 44
Applications:............................................................................................................... 44
Challenges:................................................................................................................ 44
Comparison Between Default Reasoning and CWA........................................................ 45
Model and Temporary Logic in Artificial Intelligence-...................................................... 46
In artificial intelligence (AI) and knowledge representation, models and temporary logic
(also known as temporal logic) are two essential concepts used to reason about the
world and handle changes or states over time.................................................................46
Model................................................................................................................................46
Key Features of a Model:........................................................................................... 46
Types of Models in AI:................................................................................................ 46
Applications:............................................................................................................... 46
Temporal Logic................................................................................................................. 46
Key Features of Temporal Logic:................................................................................47
Temporal Operators:...................................................................................................47

UNIT 1
4

Introduction to Artificial Intelligence (AI)-


Artificial Intelligence (AI) refers to the simulation of human intelligence in machines that are
programmed to think, learn, and make decisions like humans. These systems can process
data, recognize patterns, solve problems, and even understand language.

Key Features of AI:

1. Learning: AI systems can improve over time through machine learning (ML), where
they learn patterns from data.
2. Reasoning: AI can make decisions or predictions based on logical rules or learned
patterns.
3. Adaptation: It adjusts to new inputs and situations dynamically.
4. Automation: AI performs repetitive or complex tasks without constant human
intervention.

Categories of AI:

1. Narrow AI: Specialized systems that perform a single task (e.g., virtual assistants
like Amazon Alexa, Siri).
2. General AI: A theoretical form of AI capable of performing any intellectual task that
humans can do.
3. Superintelligent AI: Hypothetical AI that surpasses human intelligence in virtually
every field.

Applications of AI:

● Healthcare: Disease diagnosis, drug discovery, robotic surgeries.


● Finance: Fraud detection, algorithmic trading, and credit risk assessment.
● Entertainment: Personalized recommendations (e.g., Netflix, Spotify).
● Transportation: Autonomous vehicles, route optimization.
● Customer Service: Chatbots, virtual assistants.
● Environment: Climate modeling, renewable energy optimization.

Benefits of AI:

● Increases efficiency and accuracy.


● Automates repetitive tasks.
● Enhances decision-making with data insights.

Challenges:

● Ethical concerns (e.g., bias in algorithms, job displacement).


● Privacy and security risks.
● High computational and data requirements.
5
6

Emulation of Human Cognitive Processes in AI:


The emulation of human cognitive processes refers to the attempt to create artificial
systems (machines or computers) that mimic the way humans think, learn, and make
decisions.

Humans use a variety of mental processes such as reasoning, problem-solving, learning,


perception, and memory. AI aims to replicate or simulate these abilities in machines to carry
out tasks that would typically require human intelligence.

Key Cognitive Processes Emulated by AI:

1. Perception: Like how humans see, hear, and recognize patterns, AI uses sensors
(like cameras and microphones) to understand the environment (e.g., object
recognition in images).
2. Learning: Similar to how humans learn from experience, AI can improve its
performance by analyzing data (using machine learning algorithms). For example,
AI can get better at recognizing faces after seeing many examples.
3. Reasoning and Problem-Solving: AI can solve problems or make decisions based
on rules and patterns. It's similar to how humans reason through a problem, such as
making decisions based on available information.
4. Memory: Like how we store and retrieve past experiences, AI systems can store
data and use it to make decisions or predictions.
5. Language Understanding: Just as humans understand and generate speech, AI
uses natural language processing (NLP) to understand and communicate with
humans in natural language (e.g., Siri or Google Assistant).

In summary, AI tries to emulate how humans think and act by creating systems that can
perceive, learn, reason, and make decisions, much like our own cognitive abilities.
7

Knowledge Search Trade-off in AI:


In AI, the knowledge search trade-off refers to the balance between the amount of
knowledge a system has access to and the efficiency of searching through that
knowledge to make decisions or solve problems.

Here’s a brief explanation:

1. Search Space: The space of possible solutions or decisions an AI can explore. For
example, in a chess game, the search space is all the possible moves from any given
position.
2. Efficiency vs. Completeness: When an AI searches for a solution, it can either:
○ Be exhaustive (searching through all possible options for the best solution),
but this can be time-consuming and computationally expensive.
○ Use shortcuts (like heuristics, which are rules of thumb) to speed up the
search, but this may miss the best solution.
3. Trade-off: If you use too much knowledge and search too deeply (exhaustive
search), it can be slow and computationally expensive. If you simplify the search
(using less knowledge or heuristics), the solution may not be the best one.

Example:

● Chess AI: A chess-playing AI could search every possible move (exhaustive) to find
the best one, but this would take a long time. Alternatively, it could use heuristics
(rules like "control the center of the board") to make decisions more quickly, but it
might not always find the best possible move.

The Trade-off:

● More Knowledge = Slower Search: The more knowledge (or options) the AI has to
consider, the longer it takes to process and find the optimal solution.
● Less Knowledge = Faster Search, Possible Suboptimal Solution: Reducing the
knowledge or the depth of search speeds up the process, but it might lead to a
less-than-optimal decision.

In practice, AI systems aim to strike a balance, where they use enough knowledge and
search depth to make good decisions without overwhelming computational resources.
8

Stored Knowledge in AI-


Stored knowledge in AI refers to the information, facts, rules, or data that an AI system has
accumulated and keeps available for use when making decisions or solving problems.

This knowledge can be in various forms, such as:

1. Facts and Data: Raw data that the AI system has gathered, such as numbers,
measurements, or observations. For example, a recommendation system for movies
might store user preferences and ratings.
2. Rules and Heuristics: Predefined logic or guidelines used by AI to make decisions.
For instance, an expert system might store rules like "If the weather is rainy, wear a
raincoat."
3. Knowledge Base: A collection of information that the AI system uses to perform
tasks. It can be structured (like a database) or unstructured (like text). For example,
medical diagnosis systems might store a vast knowledge base of symptoms,
diseases, and treatments.
4. Memory and Experience: AI systems can learn and store experiences from
interactions, improving their performance over time. For example, machine learning
models store patterns and insights derived from historical data to predict future
outcomes.
5. Representations: AI stores knowledge in various representations, such as semantic
networks (a web of interconnected concepts), decision trees (used for classification
or decision-making), or neural networks (used to recognize patterns from data).

Types of Stored Knowledge:

1. Declarative Knowledge: Information about "what" something is. For example, "The
Eiffel Tower is in Paris."
2. Procedural Knowledge: Information about "how" to do something. For example, "To
solve a quadratic equation, apply the quadratic formula."

How Stored Knowledge is Used:

● Reasoning: AI uses stored knowledge to make inferences or decisions. For


instance, a self-driving car uses its stored knowledge about road signs, traffic rules,
and navigation maps to make driving decisions.
● Problem-Solving: AI uses stored knowledge to find solutions to problems. For
example, an AI-powered customer service bot may use stored information to answer
customer queries.

Benefits:

● Efficiency: Stored knowledge allows AI to quickly access important information,


making it faster and more efficient in decision-making.
● Improved Accuracy: With the right stored knowledge, AI can make better
predictions, classifications, or recommendations.
9

Semantic nets-
Semantic Networks | Artificial Intelligence | Components | Knowledge Representation -…

A semantic network is a way of representing knowledge in AI and computer science,


specifically for capturing relationships between concepts or entities. It is a graphical structure
where nodes represent concepts (like objects, actions, or ideas) and edges represent the
relationships or associations between those concepts.

Key Components:

1. Nodes: These represent concepts or entities (e.g., "dog", "cat", "animal").


2. Edges: These are the relationships or connections between the nodes (e.g., "is a",
"has", "eats").

Example:

Consider a simple semantic network for animals:

● "Dog" → "is a" → "Animal"


● "Dog" → "has" → "Tail"
● "Dog" → "can" → "Bark"

In this example:

● The node "Dog" is connected to "Animal" via the edge "is a", indicating that a dog is a
type of animal.
● "Dog" is connected to "Tail" via the edge "has", showing that dogs have tails.
● "Dog" is connected to "Bark" via the edge "can", showing that dogs can bark.

How Semantic Networks are Used in AI:

1. Knowledge Representation: Semantic networks are widely used to represent


knowledge in a way that can be easily understood and processed by AI systems.
They offer a structured way of storing facts and relationships.
10

2. Inference and Reasoning: AI can use semantic networks to make inferences or


reason about relationships. For example, if an AI system knows that a "dog" is an
"animal", and an "animal" can "bark", the AI can infer that a "dog" can "bark".
3. Natural Language Processing (NLP): In NLP, semantic networks help AI
understand the meaning of words based on their relationships to other words. For
instance, AI can understand that "cat" and "dog" are both animals and related
concepts.

Benefits:

● Intuitive Representation: Semantic networks are intuitive and human-readable,


which makes them easy to visualize and understand.
● Flexible: They can represent complex relationships and hierarchies in a simple
format.
● Reasoning: They allow for easy reasoning through inheritance (e.g., a "dog" inherits
properties of "animal").

Challenges:

● Scalability: As the knowledge base grows, managing large and complex networks
becomes difficult.
● Ambiguity: The meaning of certain relationships can be ambiguous, and
representing complex, subtle connections might require additional structures or
methods.
11

Abstract View of Modeling in AI-


Abstract modeling is a way to view a problem and its solutions from a higher level of
understanding. It's a technical choice that can help save time and effort when managing
code and modeling.

Types of Models in AI:

1. Statistical Models: Use mathematical equations to represent relationships between


variables (e.g., linear regression).
2. Machine Learning Models: Learn from data without explicit programming (e.g.,
decision trees, neural networks).
3. Logical Models: Represent knowledge through formal logic (e.g., expert systems).
4. Simulation Models: Mimic real-world processes (e.g., traffic simulation).

Modeling Process:

1. Problem Definition: Define what you want the model to solve or predict.
2. Data Collection: Gather relevant data for training and testing the model.
3. Model Design: Decide which type of model to use and how to represent the data.
4. Training and Validation: Train the model on data, validate its performance, and
adjust as necessary.
5. Deployment: Use the model in real-world scenarios to make predictions or
decisions.

Example of Modeling:

● Self-Driving Car: The AI model might represent the car’s environment (road,
pedestrians, other vehicles) using sensors and cameras. It learns through experience
(data) and optimizes driving behavior to avoid collisions and follow traffic rules.

In Simple Terms:

● Modeling in AI is like building a "map" of the world or problem you want the AI to
understand. You simplify and abstract the complex reality into something the system
can work with, and the AI uses this model to make decisions or predictions.
12

Elementary Knowledge in AI:

Elementary knowledge refers to the basic, fundamental concepts or facts that are essential
for understanding more complex ideas in AI. It forms the building blocks for more advanced
topics and helps in creating simple AI systems.

Here are the key components of elementary knowledge in AI:


1. Data:

Data is the raw input for AI systems. It can come in many forms such as numbers,
images, text, or sounds. AI uses data to learn and make decisions.
Example: Data about customer purchases helps AI predict what products might interest
other customers.

2. Algorithms:

An algorithm is a set of step-by-step instructions that AI systems follow to solve a problem


or perform a task.
Example: A sorting algorithm tells an AI how to arrange a list of numbers in ascending
order.

3. Machine Learning (ML):

Machine Learning is a type of AI where machines learn from data without being explicitly
programmed. They find patterns or regularities in data and use them to make predictions or
decisions.
Example: A spam filter learns to recognize spam emails by analyzing data from previously
marked emails.

4. Model:

A model in AI is a mathematical or computational representation that an AI system uses to


make decisions or predictions.
Example: A recommendation system model uses your past behavior to suggest new
movies.

5. Neural Networks:

Neural Networks are a type of machine learning model inspired by how the human brain
works. They are particularly good at recognizing patterns in large amounts of data, like
images or speech.
Example: Neural networks help recognize handwritten digits in postal codes or classify
images as "cats" or "dogs."

6. Supervised Learning:
13

In supervised learning, AI learns from labeled data. It is provided with input-output pairs
and learns the mapping between them.
Example: A facial recognition system is trained on images with labels like "John" or
"Jane."

7. Unsupervised Learning:

Unsupervised learning involves learning patterns from data without labeled output. The AI
system tries to find hidden structures in the data.
Example: A clustering algorithm groups customers into similar categories based on
purchasing behavior.

8. Basic Programming Concepts:

● AI is implemented through programming, so understanding basic programming


concepts like variables, loops, conditionals, and functions is essential.
● Example: In Python, you write code like if x > 5: print("Greater") to
control the flow of execution.
14

Computational Logic in AI:


Computational logic refers to the use of formal logical systems and methods to represent
and process information in AI. It involves applying logic to create algorithms and systems
that can reason, make decisions, and solve problems systematically.

Key Concepts in Computational Logic:

1. Propositional Logic:
○ In propositional logic, statements (propositions) can be either true or false.
The goal is to combine and manipulate these propositions using logical
operators like AND, OR, NOT, etc.
○ Example:
■ "It is raining" (True) AND "I have an umbrella" (True) → "I am
prepared" (True).
○ Operators:
■ AND ( ∧ ): Both conditions must be true for the whole expression to
be true.
■ OR ( ∨ ): At least one condition must be true for the whole expression
to be true.
■ NOT ( ¬ ): Reverses the truth value of a condition.
2. Predicate Logic:
○ Predicate logic extends propositional logic by dealing with predicates,
variables, and quantifiers (like "for all" or "there exists"). It allows for more
complex statements about objects and their properties.
○ Example: "All humans are mortal." In logic, this might be written as:
■ ∀x (Human(x) → Mortal(x)), meaning "For all x, if x is a human, then x
is mortal."
○ This type of logic is useful for representing real-world knowledge and
reasoning about entities, relationships, and conditions.
3. Logical Inference:
○ Inference is the process of deriving new knowledge or conclusions from
known facts using logical rules.
○ Example:
■ Fact 1: "All cars have wheels."
■ Fact 2: "My car is a vehicle."

From these facts, we can infer:


"My car has wheels."

○ AI systems use inference to reason and solve problems by applying logical


rules to a knowledge base.
4. Truth Tables:
○ A truth table is a way of showing all possible truth values for a logical
expression. It's used to evaluate the result of logical operations.
○ Example: For the expression "A AND B," the truth table would look like this:
15

Why Computational Logic is Important in AI:

● Reasoning: It provides a foundation for systems to reason logically and make


decisions.
● Knowledge Representation: It helps in representing complex information and
relationships in a formal, structured way.
● Problem Solving: It allows AI systems to break down problems into logical steps
and arrive at conclusions or solutions.
16

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. There
are mainly five connectives, which are given as follows:

1. Negation: A sentence such as ¬ P is called negation of P. A literal can be either


Positive literal or negative literal.
2. 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= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.
3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called
disjunction, where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
4. Implication: A sentence such as P → Q, is called an implication. Implications are
also known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
5. Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, example If
I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.

Following is the summarized table for Propositional Logic Connectives:

Truth Table:
In propositional logic, we need to know the truth values of propositions in all possible
scenarios. We can combine all the possible combination with logical connectives, and the
representation of these combinations in a tabular format is called Truth table. Following are
the truth table for all logical connectives:
17
18

Predicate Logic:
Predicate Logic (also known as First-Order Logic) is an extension of propositional logic
that allows us to express statements involving objects, their properties, and relationships
between them. While propositional logic is limited to simple true/false propositions, predicate
logic provides a more powerful framework for expressing more complex logical statements.

Key Components of Predicate Logic:

1. Predicates:
○ A predicate is a function that takes one or more arguments and returns a
truth value (true or false).
○ Predicates represent properties or relations between objects.
○ Example: "isTall(x)" could be a predicate that says whether an object x is tall.
2. Variables:
○ Variables (like x, y, z) are used to represent objects or individuals in a
domain.
○ They are placeholders that can be replaced by specific values or entities.
3. Constants:
○ A constant represents a specific, unchanging object or entity in the domain.
○ Example: "John" could be a constant representing a specific person.
4. Quantifiers:
○ Universal Quantifier (∀): Indicates that a statement is true for all possible
values of a variable.
■ Example: ∀x (Human(x) → Mortal(x)) means "All humans are
mortal."
○ Existential Quantifier (∃): Indicates that there exists at least one value of a
variable for which the statement is true.
■ Example: ∃x (Cat(x) ∧ LovesFish(x)) means "There exists at least
one cat that loves fish."
5. Logical Connectives:
○ Just like propositional logic, predicate logic uses logical connectives such as
AND (∧), OR (∨), NOT (¬), IMPLIES (→), and IF AND ONLY IF (↔) to
combine statements and form complex expressions.
19

Knowledge Organization and Manipulation in AI


In Artificial Intelligence (AI), knowledge organization and manipulation are crucial for
creating systems that can reason, learn, and make decisions. These processes help AI
systems structure and utilize vast amounts of data efficiently and logically. Let's break down
both concepts:

1. Knowledge Organization:

Knowledge organization refers to how information or knowledge is structured, categorized,


and stored in AI systems. It ensures that the system can retrieve and use this knowledge
effectively to solve problems, answer queries, or make decisions.

Key Methods of Knowledge Organization:

1. Knowledge Representation:
○ Knowledge representation is the process of encoding real-world knowledge
in a form that an AI system can use. It involves choosing the right structure to
represent facts, relationships, and entities.
○ Common methods of knowledge representation include:
■ Logic-based Representation: Using propositional and predicate logic
to represent knowledge, which allows formal reasoning.
■ Semantic Networks: Using a graph structure where nodes represent
concepts, and edges represent relationships between them.
■ Frames: Organizing knowledge into structured objects that represent
concepts and their associated properties.
■ Ontologies: A formal representation of knowledge that defines
concepts and the relationships between them in a specific domain.
■ Scripts and Schemas: Representing common sequences of events
or actions (like a "going to a restaurant" script).
2. Taxonomy:
○ A taxonomy is a hierarchical classification system that groups knowledge
into categories based on shared characteristics.
○ Example: In a biological classification system, animals might be categorized
into mammals, birds, fish, etc.
3. Hierarchical Models:
○ In this approach, knowledge is organized in layers of increasing abstraction.
For example, a hierarchy in AI might organize concepts from specific
instances to general categories.
○ Example: "Animal → Mammal → Dog → Golden Retriever."
4. Conceptual Graphs:
○ These are graphical representations of knowledge that capture concepts and
their relationships in a visual format.
○ They allow AI systems to represent and reason about concepts (such as
"person", "action", or "event") and their attributes or relations (like "John runs"
or "Mary loves pizza").
5. Associative Networks:
20

○ This method organizes knowledge by connecting related concepts using


associations or links. For example, the concept "dog" might be associated
with "pet", "bark", and "tail".

2. Knowledge Manipulation:
Knowledge manipulation refers to the processes by which AI systems use, process, and
infer new knowledge from the organized data. This includes reasoning, problem-solving,
learning, and decision-making.

Key Methods of Knowledge Manipulation:

1. Reasoning:
○ Reasoning is the process by which an AI system draws conclusions from
existing knowledge.
○ Types of reasoning:
■ Deductive Reasoning: From general facts to specific conclusions.
(E.g., "All humans are mortal, Socrates is human, therefore Socrates
is mortal.")
■ Inductive Reasoning: From specific facts to general conclusions.
(E.g., "I have seen 10 white swans, therefore all swans must be
white.")
■ Abductive Reasoning: Involves finding the most likely explanation for
a set of observations. (E.g., "The ground is wet, the most likely
explanation is that it rained.")
○ Inference Engines are used to perform reasoning in AI systems, helping the
system draw conclusions based on a knowledge base.
2. Problem-Solving:
○ AI systems use organized knowledge to solve problems. This process
involves breaking down a problem into smaller components and using
available knowledge to find solutions.
○ Techniques include:
■ Search Algorithms: Such as depth-first search, breadth-first search,
and A* search, which explore possible solutions systematically.
■ Heuristic Methods: Using "rules of thumb" to make decisions based
on experience or patterns.
3. Learning:
○ Machine Learning (ML): AI systems learn patterns from data and improve
over time without explicit programming. This involves manipulating large
datasets to extract useful knowledge and update models.
○ Types of Learning:
■ Supervised Learning: The system is trained on labeled data and
learns to map input to output.
■ Unsupervised Learning: The system learns patterns from unlabeled
data (e.g., clustering or dimensionality reduction).
■ Reinforcement Learning: The system learns by interacting with an
environment and receiving feedback in the form of rewards or
penalties.
21

4. Decision-Making:
○ AI systems use knowledge to make decisions. This could involve reasoning
about potential outcomes, weighing risks, and choosing the best course of
action.
○ Common decision-making models include:
■ Decision Trees: A tree-like structure where each node represents a
decision and branches represent possible outcomes.
■ Markov Decision Processes (MDPs): A mathematical model used
for decision-making in environments with uncertainty and
randomness.
■ Game Theory: A framework for understanding strategic
decision-making, particularly in multi-agent environments.
5. Natural Language Processing (NLP):
○ AI systems use knowledge manipulation to understand, interpret, and
generate human language.
○ NLP tasks like parsing, information extraction, and machine translation
involve organizing knowledge about language structure and meaning and
manipulating it to achieve desired outcomes.
6. Expert Systems:
○ Expert systems are AI systems that manipulate organized knowledge to
mimic the decision-making ability of a human expert. They rely on a
knowledge base of facts and rules to make inferences and solve specific
problems in fields like medicine, engineering, and finance.
22

Knowledge Acquisition
Knowledge Acquisition in AI refers to the process of gathering and collecting knowledge
from various sources to create or enhance an AI system's knowledge base. It involves
obtaining both explicit knowledge (e.g., facts, rules, and data) and implicit knowledge
(e.g., experience, intuition) to make AI systems capable of reasoning, decision-making, and
problem-solving.

Key Concepts in Knowledge Acquisition:

1. Sources of Knowledge:
○ Human Experts: Knowledge can be obtained from people who are experts in
a particular domain. This might involve interviewing experts, reading
literature, or observing their decisions.
○ Existing Databases and Knowledge Bases: Many AI systems acquire
knowledge from existing structured data sources, such as relational
databases, ontologies, or knowledge graphs.
○ Documents and Text: AI can extract knowledge from texts, articles, and
other documents using Natural Language Processing (NLP) techniques.
○ Experience: Knowledge can be gathered through interaction with the
environment (e.g., reinforcement learning or expert systems).
○ Sensors and Real-World Data: AI systems can acquire knowledge from data
captured through sensors or online data sources (such as weather data or IoT
devices).
2. Methods of Knowledge Acquisition: Knowledge acquisition can be performed
through various techniques. These techniques can be broadly classified into manual
methods, automatic methods, and semi-automatic methods.
○ Manual Knowledge Acquisition:
■ Expert Interviews: Directly interviewing domain experts to gather
facts, rules, and heuristics.
■ Observation: Observing experts or practitioners to capture implicit
knowledge based on experience.
■ Surveys and Questionnaires: Asking targeted questions to experts
or users to gather information.
■ Knowledge Engineering: Manually designing the knowledge base,
sometimes with the help of knowledge engineers who understand both
the problem domain and AI system design.
○ Automatic Knowledge Acquisition:
■ Machine Learning: AI systems can learn from data using algorithms
like decision trees, neural networks, and clustering techniques. This is
an example of automatic knowledge acquisition from large datasets.
■ Data Mining: AI systems can automatically extract useful knowledge
from large datasets using techniques like classification, regression,
association rules, or clustering.
■ Natural Language Processing (NLP): AI can analyze and extract
useful information from textual data, such as extracting entities and
relationships from unstructured text (e.g., articles, social media posts).
23

■ Reinforcement Learning: An AI agent can acquire knowledge


through trial and error by interacting with its environment and receiving
feedback in the form of rewards or penalties.
○ Semi-Automatic Knowledge Acquisition:
■ Crowdsourcing: Gathering knowledge from a large group of people,
often through online platforms. This can be a hybrid of human input
and AI automation (e.g., using humans to label data, which is then
used to train machine learning models).
■ Hybrid Approaches: Combining expert knowledge with machine
learning techniques. For example, a human expert might define rules,
and an AI system could refine them using data-driven approaches.
3. Challenges in Knowledge Acquisition:
○ Knowledge Representation: It can be difficult to represent the acquired
knowledge in a way that makes it usable and consistent for an AI system
(e.g., converting human knowledge into formal logical rules or structured
data).
○ Ambiguity and Uncertainty: Human knowledge may be ambiguous,
contradictory, or incomplete. Ensuring that AI systems can handle such
uncertainties is challenging.
○ Scalability: Acquiring vast amounts of knowledge can be time-consuming
and resource-intensive. It’s difficult to scale the process for large systems or
dynamic environments.
○ Quality and Consistency: The accuracy and reliability of the acquired
knowledge can vary. Ensuring high-quality knowledge is crucial, especially for
critical applications like medical diagnosis or legal systems.
○ Dynamic Environments: Knowledge may evolve over time, so the
acquisition process must be continuous to keep the AI system up-to-date.

Summary:

● Knowledge Acquisition is a critical step in building AI systems capable of


reasoning, learning, and decision-making.
● It involves gathering knowledge from a variety of sources, such as experts, data,
documents, or experience.
● Methods for knowledge acquisition range from manual methods (e.g., expert
interviews) to automatic methods (e.g., machine learning, data mining, NLP).
● Challenges in knowledge acquisition include ambiguity, uncertainty, scalability, and
the representation of knowledge.
● AI tools like knowledge engineering software, machine learning frameworks, and
NLP tools help facilitate the acquisition and organization of knowledge.
24

LISP in Artificial Intelligence (AI)-


LISP (short for LISt Processing) was specifically designed for AI research by John
McCarthy in 1958. It quickly became the dominant programming language for AI because of
its flexibility, symbolic reasoning capabilities, and support for recursive algorithms.
Many of the foundational AI systems and research projects were developed using LISP.

Why LISP is Suitable for AI

1. Symbolic Processing:
○ AI often deals with symbols, rather than numbers, to represent knowledge,
logic, and reasoning.
○ LISP excels at manipulating symbolic data, such as symbols and
expressions, making it ideal for tasks like natural language processing,
theorem proving, and expert systems.
2. Recursive Functions:
○ Many AI problems, such as tree traversal or search algorithms, are naturally
recursive.
○ LISP’s syntax and structure make it easy to implement and debug recursive
algorithms.
3. Dynamic Typing:
○ In AI, systems often deal with diverse types of data.
○ LISP’s dynamic typing allows variables to hold any type of data, adapting to
changing requirements in AI models.
4. Flexible Syntax:
○ LISP’s syntax is simple and uniform, allowing programs to manipulate their
own code.
○ This makes it easy to create AI programs that modify themselves or learn new
rules dynamically.
5. Garbage Collection:
○ Automatic memory management enables AI programs to handle large
amounts of dynamically generated data without worrying about memory
allocation or deallocation.
6. First-Class Functions:
○ Functions in LISP are treated as first-class citizens, meaning they can be
passed as arguments, returned as values, or stored in data structures.
○ This is crucial for AI tasks, such as defining and applying rules dynamically.
7. Prototyping and Experimentation:
○ LISP’s interactive environment (REPL - Read-Eval-Print Loop) supports rapid
prototyping and testing, which is essential for AI researchers to experiment
with new algorithms and ideas.

Applications of LISP in AI
25

1. Expert Systems:
○ Early AI expert systems, like MYCIN (a medical diagnostic system), were built
using LISP.
○ These systems encoded knowledge in the form of rules and performed
reasoning using symbolic data.
2. Natural Language Processing (NLP):
○ LISP was used in early NLP systems for tasks like parsing, sentence
generation, and machine translation.
○ Its symbolic processing capabilities made it well-suited for representing and
manipulating language constructs.
3. Theorem Proving:
○ AI systems that solve logical proofs or perform formal reasoning were
implemented in LISP.
○ For example, the Logic Theorist, one of the first AI programs, used symbolic
reasoning to prove mathematical theorems.
4. Robotics:
○ Early robotics systems used LISP for high-level reasoning, such as path
planning, rule-based decision-making, and symbolic representation of the
environment.
5. Machine Learning:
○ Although less common now, LISP was used for early implementations of
learning algorithms because of its flexibility and support for recursive
functions.
6. Knowledge Representation:
○ AI systems often need to represent and manipulate knowledge, such as
ontologies, taxonomies, and knowledge graphs.
○ LISP’s ability to define symbolic relationships and rules made it ideal for these
tasks.
26

Syntax of LISP
LISP has a simple and unique syntax based on S-expressions (symbolic expressions).
Everything in LISP, from data structures to code, is represented in parentheses.

Basic Syntax Rules:

1. Parentheses:
○ LISP uses fully parenthesized prefix notation.
○ Example: (+ 1 2) means "add 1 and 2."
2. Atoms:
○ Atoms are the simplest elements in LISP and include:
■ Numbers: 42, 3.14
■ Strings: "hello"
■ Symbols: x, my-var
3. Lists:
○ A list is a sequence of elements (atoms or other lists) enclosed in
parentheses.
○ Example: (1 2 3) or (x y z)
4. Functions:
○ Functions are written in the form:

Relational Operators:

These operators compare two numbers and return T (true) or NIL (false).

Equal:

Syntax: (= num1 num2)

Example:

(= 5 5) ; Result: T

Not Equal:

Syntax: (/= num1 num2)

Example:

(/= 5 3) ; Result: T

Greater Than:

Syntax: (> num1 num2)

Example:
27

(> 7 3) ; Result: T

Less Than:

Syntax: (< num1 num2)

Example:

(< 3 7) ; Result: T

Greater Than or Equal To:

Syntax: (>= num1 num2)

Example:

(>= 5 5) ; Result: T

Less Than or Equal To:

Syntax: (<= num1 num2)

Example:

(<= 4 6) ; Result: T
28

Distinction Between LISP and Prolog

LISP and Prolog are both high-level programming languages commonly used in Artificial
Intelligence (AI). However, they differ significantly in terms of paradigm, syntax, and their
approach to solving problems. Here's a comparison:

1. Programming Paradigm

● LISP:
○ Primarily a functional programming language.
○ Focuses on recursive functions, symbolic computation, and list manipulation.
○ Developers explicitly define procedures or algorithms.
● Prolog:
○ A logic programming language.
○ Focuses on declarative programming, where the programmer specifies
what the solution is, not how to compute it.
○ The system derives solutions using rules and facts through automated
reasoning (backtracking).

2. Syntax

● LISP:
○ Uses prefix notation with extensive use of parentheses.
○ Syntax is highly uniform and uses S-expressions for both code and data.

Prolog:

● Syntax is based on facts, rules, and queries.


● Uses infix notation for predicates and avoids excessive parentheses.

3. Problem-Solving Approach

● LISP:
○ Problems are solved through procedures and functions explicitly defined by
the programmer.
○ It supports iterative and recursive approaches.
● Prolog:
○ Problems are solved through logic inference.
○ Prolog uses a knowledge base of facts and rules, then searches for a
solution using backward chaining and unification.

4. Core Applications
29

● LISP:
○ Widely used for symbolic computation and problems requiring dynamic
data structures.
○ Common in areas like:
■ Natural Language Processing (NLP)
■ Expert Systems
■ Machine Learning (historical relevance)
● Prolog:
○ Ideal for logical reasoning, knowledge representation, and problems
requiring rule-based inference.
○ Common in:
■ Expert Systems
■ Theorem Proving
■ Semantic Web and Ontologies

5. Execution Model

● LISP:
○ Programs execute as sequences of function calls and expressions.
○ Uses an interpreter or compiler for execution.
● Prolog:
○ Prolog employs a goal-driven execution model.
○ It resolves goals (queries) by applying rules and facts through backtracking.

6. Strengths

● LISP:
○ Highly flexible and extensible.
○ Powerful for recursive algorithms and symbolic computation.
○ Suitable for programs requiring self-modification or dynamic rule creation.
● Prolog:
○ Naturally suited for problems involving logical reasoning, constraint solving,
and relational data.
○ Easier for modeling real-world problems with rules and relationships.

7. Weaknesses

● LISP:
○ Requires a procedural approach, which can be less intuitive for certain logical
problems.
○ Syntax can be verbose and challenging for beginners due to excessive
parentheses.
30

● Prolog:
○ Less efficient for numeric computation or procedural tasks.
○ Debugging can be challenging, especially in complex rule bases.
31

LISP Input/Output (I/O)


LISP provides powerful functions for performing Input/Output (I/O) operations, such as
reading from the user, files, or streams and writing to them.

1. Input Operations

● read: Reads a single LISP object (e.g., number, symbol, or list) from the input.

(let ((value (read)))

read-line: Reads a full line of text as a string.

(let ((line (read-line)))

2. Output Operations

● write: Writes a LISP object to the output stream.

(write "Hello, LISP!") ; Output: Hello, LISP!

write-line: Writes a string to the output followed by a newline.

(write-line "Hello, world!") ; Output: Hello, world!

Local Variables in LISP


In LISP, local variables are typically declared within the scope of functions or blocks using
constructs like let

1. let for Local Variables

● The let construct allows you to declare local variables and their values within a
specific scope.
● Syntax:

(let ((var1 value1)


(var2 value2)
...)
body)
32

Interaction and Recursion in LISP


LISP, as a functional programming language, heavily utilizes recursion to perform iterative
tasks. Interaction in LISP often involves combining user input/output with recursion for
problem-solving.

1. Interaction in LISP

Interaction in LISP refers to taking input from the user and providing output dynamically. This
is commonly achieved using I/O functions like read, read-line, write, write-line,
and format.

Example: Asking for the User's Name

(defun ask-for-name ()

(format t "What is your name? ") ; Prompt the user

(let ((name (read-line))) ; Read a line of input

(format t "Hello, ~a!~%" name))) ; Greet the user

(ask-for-name)

Explanation:

1. format t: This prints to the console. The t specifies the output stream (t refers to
standard output).
○ "What is your name?": The prompt to display.
○ "Hello, ~a!": Uses ~a as a placeholder to insert the value of name.
2. read-line: Captures the input entered by the user as a string.
3. let: Creates a local variable name to hold the user's input.
4. ~%: Prints a newline character for better formatting in output.

What is your name? Alice

Hello, Alice!
33

2. Recursion in LISP

Recursion is a fundamental concept in LISP, as it handles iterative processes through


recursive function calls. Due to its close relationship with mathematical logic, recursion is
deeply integrated into the language.

Recursive Function Structure:

A recursive function typically has:

1. Base Case: Defines when the recursion should stop.


2. Recursive Case: The function calls itself with a smaller subset of the problem.

Example: Factorial Function


(defun factorial (n)
(if (<= n 1) ; Base case
1
(* n (factorial (- n 1))))) ; Recursive case

(factorial 5) ; Returns 120


34

Property list and array alternative languages-


LISP, known for its flexibility with data structures like property lists and arrays, has
equivalents in other languages. Here’s a look at alternatives to these structures in different
programming languages:

1. Property List Alternatives

A property list (plist) in LISP is a list where keys and values alternate, often used for simple
key-value data storage. For example:

(setq plist '(:name "Alice" :age 25 :city "New York"))

Alternatives in Other Languages:

1. Python: Dictionaries
○ A dictionary is Python's built-in key-value pair data structure, similar to a plist.

python
plist = {"name": "Alice", "age": 25, "city": "New York"}

2.
3. JavaScript: Objects
○ JavaScript objects serve as key-value stores, similar to property lists.

javascript
let plist = { name: "Alice", age: 25, city: "New York" };

4.
5. Ruby: Hash
○ Ruby's Hash is a key-value data structure akin to a plist.
6. ruby
plist = { name: "Alice", age: 25, city: "New York" }

2. Array Alternatives

Arrays in LISP are flexible multi-dimensional structures, often initialized and accessed with
built-in functions like make-array and aref.

Alternatives in Other Languages:

1. Python: Lists
○ Python lists serve as dynamic arrays for holding sequential data.

python
array = [1, 2, 3, 4]
35

element = array[0] # Access element at index 0

2.
3. JavaScript: Arrays
○ JavaScript provides dynamic arrays with built-in methods.

javascript
let array = [1, 2, 3, 4];
let element = array[0];

4.
5. Ruby: Arrays
○ Ruby arrays work much like Python lists.

ruby
array = [1, 2, 3, 4]

6. element = array[0]
36

Formalized Logic and Properties of Well-Formed Formulae


(WFFs)- Or WFRS (Well Formed Rule System)
In formalized logic, well-formed formulae (WFFs) refer to syntactically correct expressions
constructed using a formal language. These formulae must adhere to specific rules to
ensure logical validity. Here's a breakdown:

1. What is a Well-Formed Formula (WFF)?

● A WFF is a symbolic expression built using:


○ Logical connectives (e.g., ∧, ∨, ¬, →, ↔). (Refer to Page Number 13)
○ Predicates, variables, constants, and quantifiers (e.g., ∀, ∃).

Examples of WFFs:

1. P∧QP \wedge QP∧Q ("P and Q")


2. ¬P→Q\neg P \rightarrow Q¬P→Q ("If not P, then Q")

2. Rules for Constructing WFFs

1. Atomic Formulae:
○ The simplest WFFs are atomic formulae, such as P(x)P(x)P(x) or QQQ.
○ They contain no logical connectives.
2. Compound Formulae:
○ Constructed by combining atomic formulae with logical connectives.
○ Example: P∧QP \wedge QP∧Q, ¬P\neg P¬P, P→QP \rightarrow QP→Q.
3. Quantifiers:
○ Use of universal (∀\forall∀) or existential (∃\exists∃) quantifiers.
○ Example: ∀x(P(x)→Q(x))\forall x (P(x) \rightarrow Q(x))∀x(P(x)→Q(x)).
4. Parentheses:
○ Parentheses are used to clarify the precedence of operations.
○ Example: P∧(Q∨R)P \wedge (Q \vee R)P∧(Q∨R) is different from
(P∧Q)∨R(P \wedge Q) \vee R(P∧Q)∨R.

Symbolic Representation in WFFs


Components of WFFs:

1. Logical Connectives:
○ ¬\neg¬: Negation (not)
○ ∧\wedge∧: Conjunction (and)
○ ∨\vee∨: Disjunction (or)
○ →\rightarrow→: Implication (if-then)
○ ↔\leftrightarrow↔: Biconditional (if and only if)
2. Quantifiers:
37

○ ∀\forall∀: Universal quantifier ("for all")


○ ∃\exists∃: Existential quantifier ("there exists")
3. Predicates:
○ Represent properties or relations.
○ Example: P(x)P(x)P(x), where PPP is a property of xxx.
4. Variables and Constants:
○ Variables are placeholders for objects in the domain.
○ Constants represent specific objects.
38

Non-Deductive Inference Methods-


Reasoning under Uncertainty in Artificial Intelligence

Non-deductive inference methods involve reasoning processes where the conclusions are
not guaranteed to be true, even if the premises are true. Instead, these methods provide
conclusions that are probable, plausible, or likely based on the evidence. Unlike
deductive reasoning, which is strictly logical and guarantees certainty, non-deductive
reasoning accommodates uncertainty and incomplete information.

Types of Non-Deductive Inference Methods

1. Inductive Reasoning

● Definition: Derives general conclusions from specific observations or examples.


● Key Feature: The conclusion is likely but not guaranteed.
● Example:
○ Premise 1: All observed swans are white.
○ Premise 2: A new swan is observed.
○ Conclusion: The new swan is likely to be white.
● Use in AI: Machine learning models use induction to generalize patterns from
training data.

2. Abductive Reasoning

● Definition: Starts with an observation and seeks the most likely explanation.
● Key Feature: Often referred to as "inference to the best explanation."
● Example:
○ Observation: The ground is wet.
○ Possible Explanations:
1. It rained.
2. Someone spilled water.
○ Conclusion: It likely rained (the most plausible explanation).
● Use in AI: Diagnostic systems (e.g., medical diagnosis or fault detection) use
abduction to find probable causes for observed symptoms or failures.

3. Analogical Reasoning

● Definition: Draws conclusions based on similarities between two situations or


objects.
● Key Feature: Relies on the assumption that similarities in some aspects imply
similarities in others.
● Example:
39

○ Premise: Planets orbiting stars behave like electrons orbiting a nucleus.


○ Conclusion: Planets may follow similar rules to electrons in terms of forces.
● Use in AI: Case-based reasoning systems solve new problems by comparing them
to previously solved cases.

4. Statistical Reasoning

● Definition: Uses probability and statistics to infer conclusions about populations or


events.
● Key Feature: Provides conclusions with quantified levels of confidence.
● Example:
○ Premise: 90% of people in a group like chocolate.
○ Premise: Alice is in the group.
○ Conclusion: Alice likely likes chocolate (90% probability).
● Use in AI: Bayesian networks and probabilistic models rely heavily on statistical
reasoning.

5. Heuristic Reasoning

● Definition: Employs rules of thumb or educated guesses to arrive at conclusions.


● Key Feature: Useful when detailed data or computational resources are unavailable.
● Example:
○ Premise: In general, higher prices mean better quality.
○ Conclusion: This expensive laptop is likely of good quality.
● Use in AI: Heuristic search algorithms (e.g., A* search) use heuristic reasoning to
find solutions efficiently.

6. Fuzzy Logic

● Definition: Reasoning based on degrees of truth rather than binary true/false values.
● Key Feature: Handles uncertainty and vagueness.
● Example:
○ Premise: The weather is "somewhat hot."
○ Conclusion: It’s likely summer, but not guaranteed.
● Use in AI: Fuzzy control systems are used in appliances like washing machines and
air conditioners to handle vague inputs.

7. Default Reasoning

● Definition: Assumes typical or default values in the absence of specific information.


● Key Feature: Useful for reasoning under incomplete data.
● Example:
40

○ Premise: Birds typically fly.


○ Observation: A sparrow is a bird.
○ Conclusion: The sparrow probably flies.
● Use in AI: Expert systems often use default reasoning to make assumptions about
the unknown.

8. Commonsense Reasoning

● Definition: Relies on general knowledge and everyday experience to draw


conclusions.
● Key Feature: Not strictly formal but highly practical.
● Example:
○ Premise: If you touch fire, it burns.
○ Observation: A matchstick is lit.
○ Conclusion: Touching it will likely cause a burn.
● Use in AI: Systems like OpenAI's GPT and others incorporate commonsense
reasoning to answer questions plausibly.

Comparison of Deductive and Non-Deductive Methods


Aspect Deductive Reasoning Non-Deductive Reasoning

Certaint Guarantees true conclusions if Provides likely or plausible conclusions.


y premises are true.

Basis Strict logical rules. Evidence, patterns, or probabilities.

Example All humans are mortal. Socrates is a Most humans enjoy music. John is a
human. → Socrates is mortal. human. → John likely enjoys music.

Use in Automated theorem proving. Machine learning, diagnostics, and


AI decision-making under uncertainty.

Conclusion

Non-deductive inference methods are essential for reasoning in real-world scenarios, where
information is often incomplete or uncertain. They are widely applied in artificial
intelligence for tasks such as learning, diagnosis, and decision-making, bridging the gap
between theoretical reasoning and practical applications.
41

Inconsistencies and Uncertainties in Truth Maintenance


Systems (TMS)-
A Truth Maintenance System (TMS) is a mechanism used in artificial intelligence (AI) to
manage and update a system's knowledge base, ensuring consistency and handling
uncertainty. It plays a crucial role in reasoning systems, especially when dealing with
dynamically changing information or conflicting data.

Key Concepts

1. Inconsistencies in TMS

Inconsistencies occur when a knowledge base contains contradictory information. This can
happen in reasoning systems when:

● A new piece of information conflicts with existing knowledge.


● Incorrect assumptions or inferences lead to contradictions.

Example of Inconsistency:

● Fact 1: A→BA \rightarrow BA→B (If AAA, then BBB).


● Fact 2: AAA is true.
● Fact 3: BBB is false.

This creates a logical inconsistency because if AAA is true and A→BA \rightarrow BA→B,
BBB must be true.

2. Uncertainties in TMS

Uncertainty arises when:

● Information is incomplete or probabilistic.


● It is unclear which of multiple conflicting pieces of information is valid.

Example of Uncertainty:

● Fact 1: P(x)P(x)P(x) (x might be a bird).


● Fact 2: Birds typically fly.
● Fact 3: Some birds, like penguins, do not fly.

Here, uncertainty arises about whether P(x)P(x)P(x) implies xxx can fly.

How TMS Handles Inconsistencies and Uncertainties


42

TMS employs several mechanisms to resolve inconsistencies and manage uncertainties:

1. Assumption-Based Truth Maintenance System (ATMS)

● Keeps track of assumptions that lead to a particular inference.


● If an inconsistency is detected, the system retracts assumptions causing the conflict.
● Example:
○ AAA: "It is sunny."
○ BBB: "It is raining."
○ ATMS maintains dependencies and retracts one assumption if the other is
proven true.

2. Justification-Based Truth Maintenance System (JTMS)

● Stores justifications for each belief.


● A belief is supported by either facts or inferences.
● If a belief becomes inconsistent, the TMS identifies and modifies the justification.

3. Probabilistic TMS (PTMS)

● Handles uncertainties by associating probabilities with beliefs.


● Instead of strict true/false values, it assigns confidence levels to facts and updates
them based on new evidence.
● Example:
○ Initial belief: P(x)P(x)P(x) is 70% likely.
○ New evidence increases P(x)P(x)P(x) to 90%.
43

Default Reasoning and Closed World Assumption-


Default reasoning and the closed world assumption (CWA) are two essential concepts in
knowledge representation and reasoning within artificial intelligence (AI). They help
systems draw conclusions when information is incomplete or uncertain.

1. Default Reasoning

Definition:

Default reasoning involves making plausible assumptions or inferences when there is no


evidence to the contrary. It allows reasoning systems to operate effectively even with
incomplete information by assuming "defaults" or typical cases.

Key Features:

● Non-monotonic: Conclusions can change when new information becomes available.


● Assumptions: Relies on default rules, which are overridden when contradictory
evidence is encountered.

Example:

● Rule: "Most birds can fly."


● Observation: Tweety is a bird.
● Default Conclusion: Tweety can fly.

However, if new information reveals that Tweety is a penguin, the system retracts the
conclusion.

Applications:

● Expert Systems: Diagnosing a patient with a "default" disease based on common


symptoms until further evidence suggests a rarer condition.
● Natural Language Understanding: Assuming the most common meanings of
ambiguous words or phrases unless context dictates otherwise.

Challenges:

● Conflicting Defaults: Handling multiple conflicting defaults can be complex.


○ Example: "Birds can fly" vs. "Penguins cannot fly."
44

● Prioritization: Determining which defaults to apply when multiple ones are relevant.

2. Closed World Assumption (CWA)

Definition:

The closed world assumption is the principle that anything not explicitly stated to be true
is assumed to be false. It simplifies reasoning by assuming the system has complete
knowledge of the world.

Key Features:

● Negation as Failure: If a fact cannot be proven true, it is assumed to be false.


● Simplifies Reasoning: Reduces the complexity of handling unknown information.
● Assumes Completeness: Useful in systems where the knowledge base is
comprehensive.

Example:

● Database: A system contains the facts:


○ "John is a teacher."
○ "Alice is a doctor."
● Query: Is Bob a teacher?
○ CWA Answer: No, because Bob is not explicitly listed as a teacher in the
database.

Applications:

● Databases: Relational databases often use CWA when queries return "false" for
missing information.
● Logic Programming: Prolog uses CWA to infer negative facts when a query fails to
find evidence.

Challenges:

● Incomplete Knowledge: CWA assumes that the system knows everything relevant,
which may not be true in real-world scenarios.
● Open World Assumption (OWA): In contrast to CWA, OWA assumes that the
absence of information does not imply falsity, which is more suitable for dynamic or
incomplete environments.
45

Comparison Between Default Reasoning and CWA


Aspect Default Reasoning Closed World Assumption
(CWA)

Basis Makes plausible assumptions in the Assumes anything not explicitly


absence of contradictory evidence. true is false.

Nature Non-monotonic (new information can Typically monotonic within its


override defaults). scope of knowledge.

Focus Deals with "typical" or "likely" Assumes knowledge base is


scenarios. complete.

Handling Allows for exceptions and overrides. Assumes missing facts are
Uncertainty false.

Example "Birds typically fly." Tweety can fly "Bob is not a teacher" if not
unless proven otherwise. explicitly stated in the database.
46

Model and Temporary Logic in Artificial Intelligence-


In artificial intelligence (AI) and knowledge representation, models and temporary logic (also
known as temporal logic) are two essential concepts used to reason about the world and
handle changes or states over time.

Model

A model in AI is a simplified representation of a system or domain used to understand,


predict, or make decisions. It defines objects, their properties, relationships, and rules.

Example: A model of a classroom includes students, a teacher, and relationships like


"students learn from the teacher."\

Key Features of a Model:

● Abstraction: Simplifies complex real-world phenomena to focus on relevant aspects.


● Structure: Includes objects (or entities), their attributes, and relationships.
● Rules: Defines constraints, behaviors, and interactions between components.

Types of Models in AI:

1. Mathematical Models: Represent phenomena using equations or formulas.


○ Example: A model predicting temperature based on weather patterns.
2. Logical Models: Use logical frameworks to represent facts, rules, and reasoning.
○ Example: A knowledge base in first-order logic.
3. Probabilistic Models: Handle uncertainty by assigning probabilities to events.
○ Example: Bayesian networks.
4. State-Based Models: Focus on the states of a system and transitions between
them.
○ Example: Finite state machines in robotics.

Applications:

● Machine Learning: Models learn patterns and make predictions (e.g., neural
networks).
● Expert Systems: Logical models represent domain knowledge for reasoning.
● Simulations: Models simulate real-world processes for testing and optimization.

Temporal Logic

Temporal logic is used to reason about time-dependent events or states. It adds


time-based operators like "always," "eventually," and "until" to logical statements.
47

Example: "The lights must turn on whenever motion is detected."

Key Features of Temporal Logic:

● Adds temporal operators to classical logic to represent time-based reasoning.


● Used to express statements like:
○ "Something will eventually happen."
○ "An event will always hold true."
○ "If an event occurs, another will follow."

Temporal Operators:

Second Unit ends

You might also like