Unit 4 Ai
Unit 4 Ai
• Fact Extraction: This is the initial step where raw data is collected, often from
real-world situations, sensors, or input from the user. These facts are
unstructured and need to be organized into a formal structure.
• Conceptualization: In this step, the facts are abstracted into concepts, often by
identifying entities, relationships, and attributes. The AI system identifies key
elements like objects (e.g., "Car", "Person"), actions (e.g., "Drives", "Owns"), and
properties (e.g., "Red", "Expensive").
• Formalization: The facts are then represented in formal structures, which could
be logical formulas, semantic networks, frames, or other models. Formalization
involves the translation of natural language or raw data into a form that allows
the system to reason and manipulate the knowledge.
2. Importance of Mapping in AI
• Consistency and Accuracy: The mapping process ensures that facts are stored
consistently and without ambiguity, which is crucial for AI systems to avoid
errors in reasoning or decision-making.
In this network:
Semantic networks allow easy navigation and querying, making them effective
for representing hierarchical relationships.
Frame: Car
Attributes:
- Owner: John
- Color: Red
- Type: Sedan
• The fact is represented by filling the slots with specific values, such as "John" for
the Owner and "Red" for the Color.
Frames are useful for representing complex objects with many attributes and are ideal
for systems that need to handle structured data with predefined properties.
• Here, Owns(John, Car) is a predicate indicating that John owns a car, and Color(Car,
Red) indicates that the car is red. Logic-based representations allow formal
reasoning through inference rules, making them highly useful for systems
requiring rigorous reasoning.
• Production Rules: In rule-based systems, facts are represented as if-then
rules. For example, the fact "John owns a red car" might be mapped as:
• These rules can be triggered based on facts, allowing the system to perform
reasoning automatically.
• Ambiguity: Natural language or raw data can be ambiguous, and different facts
might be interpreted in multiple ways. For example, the fact "John is tall" might
vary depending on the context or the definition of "tall". Mapping such facts
requires a clear definition of terms and context.
• Complexity: Some facts or concepts may be too complex to represent easily.
For example, representing abstract ideas like "happiness" or "justice" can be
challenging and may require advanced representation schemes.
• Scalability: As the amount of data grows, efficiently managing and storing facts
in representations becomes more difficult. Complex systems with large
knowledge bases must ensure that facts are indexed and stored in ways that
allow fast retrieval.
1. Logic-based Representation
Key Concepts:
• Predicate Logic: Deals with more complex relationships, allowing for quantified
expressions (e.g., "For all x, if x is a bird, then x can fly").
Strengths:
Weaknesses:
• Rigid Structure: The formal nature of logic makes it less intuitive for representing
knowledge that is inherently fuzzy or approximate.
2. Semantic-based Representation
Key Concepts:
Strengths:
• Intuitive: Semantic networks and ontologies are often easier to understand and
visualize due to their graph-based structure. This makes it easier for humans to
work with.
Weaknesses:
3. Frame-based Representation
Frames are data structures used to represent stereotyped situations or objects. They
contain attributes (slots) that define the properties of an entity, and each slot can hold
information (e.g., default values, procedures, or constraints).
Key Concepts:
• Frames: A frame is similar to a record or object in object-oriented programming,
consisting of slots that contain information about an object or concept (e.g., a
frame for "Car" might include slots for "color", "engine type", and "wheels").
• Inheritance: Frames support inheritance, meaning a child frame can inherit the
attributes of a parent frame, similar to object-oriented programming.
Strengths:
Weaknesses:
• Limited Inferencing: While frames can store complex information, they do not
inherently support formal logical reasoning, which makes automated inference
more difficult compared to logic-based systems.
Comparison of Approaches:
Ease of Use Difficult for non- More intuitive and Moderately easy;
experts; requires visual; easier to intuitive for experts
formal training understand but complex for large
systems
Q3. Explain the difference between procedural and declarative knowledge. Provide
examples of each and discuss their roles in knowledge-based systems. How do
they impact reasoning and problem-solving in AI systems?
Answer – 1. Definition:
2. Examples:
o The fact that "The Earth orbits the Sun" is declarative knowledge. It’s a
statement of fact, not a procedure for how to orbit the Sun.
o In a medical diagnostic system, a fact like "If the patient has a fever and
cough, they may have the flu" is declarative knowledge. It states a rule or
relationship between symptoms and potential diagnoses.
• Procedural Knowledge:
o Procedural knowledge is essential for reasoning in environments that
require the execution of steps or operations, such as in planning and task
execution. In AI problem-solving, procedural knowledge directly impacts
how an agent acts to achieve its goals.
• Declarative Knowledge:
• Complementary Roles:
• Goal-Independence: The reasoning process does not start with a specific goal
but rather generates potential conclusions.
The forward reasoning process will take these facts, apply the rules, and move forward
to infer that the patient might have flu.
• Hypothesis Testing: The process works backward to confirm if the facts lead to
the goal.
Start Point Starts from facts and moves to Starts from the goal and works
conclusions. backward.
Use Case Suitable for systems with Suitable for systems where the goal
abundant facts but unclear is well-defined, like in expert
goals. systems.
In AI, matching is most associated with pattern matching. In systems like expert
systems or rule-based systems, matching plays a key role in identifying which rules or
facts apply to the current problem. The basic steps of matching can be divided into:
• Structural matching: Ensuring that the structures (such as logic expressions,
facts, or rules) have the same format or are compatible in structure.
• Variable matching: Substituting the variables in the patterns or rules with actual
values or other variables to find equivalence or compatibility.
o Example: Suppose we have a rule that says "If it is raining, the ground is
wet." If the fact "It is raining" is known, matching will find this rule and
derive the new fact that "The ground is wet."
o How matching is applied: The system begins by trying to match the goal
against the conclusions of rules. If a match is found, the system then
looks for facts that can satisfy the rule's premises. This process is
recursive, where each matching step leads the system closer to proving
the goal.
o Rule specificity: More specific rules may take precedence over more
general ones.
o Rule importance: Some rules may be given higher priority based on their
significance in the knowledge domain.
o Example: If the system has a rule "If the weather is sunny, it is warm," but
no rule states what happens if the weather is cloudy, the system may
assume the default that "It is warm" when the weather is cloudy, based on
the assumption that the weather is generally warm.
o Example: If the system initially concludes "The ground is dry" but later
learns that it rained, it will retract the previous conclusion and conclude
that "The ground is wet."
Monotonic Reasoning:
If new facts are added (e.g., "Socrates is a philosopher"), the conclusion "Socrates is
mortal" remains unchanged.
Non-Monotonic Reasoning:
Default Reasoning:
• In robotics: A robot might assume a surface is flat and walk on it, but if it detects
a slope, it will revise the assumption.
Statistical reasoning refers to the process of making inferences and decisions under
uncertainty using statistical methods. It is particularly useful in AI systems when the
available knowledge is incomplete, imprecise, or uncertain. Unlike traditional
deterministic reasoning, statistical reasoning deals with probabilities and distributions
to make decisions based on data patterns.
In AI, statistical reasoning helps systems learn from data, handle noisy or ambiguous
information, and make predictions or classifications. The primary statistical techniques
used in AI systems include Bayesian networks, Markov models, and hidden Markov
models (HMMs). These methods use statistical principles to reason about uncertain
knowledge and incorporate new evidence as it becomes available.
For example:
• Hidden Markov Models: HMMs are used in tasks like speech recognition and
sequence prediction. They model systems that transition between different
states over time, where the current state is partially observable. For instance, in
speech recognition, HMMs can be used to predict the next word or sound based
on the previous context.
Key Features of Statistical Reasoning:
1. Uncertainty Handling: It can deal with situations where exact knowledge is not
available, instead representing the knowledge as probabilities.
Fuzzy logic is a mathematical framework used for reasoning about inherently vague or
imprecise concepts. Unlike traditional Boolean logic, where variables can only take
binary values (true or false), fuzzy logic allows variables to take a range of values
between 0 and 1. This enables the representation of partial truths or degrees of
membership in a set, which is closer to how humans think and reason in real-world
scenarios.
In fuzzy logic, a concept is not strictly defined but is described in terms of "fuzziness" or
"degrees of truth." This is achieved through fuzzy sets, where each element has a
membership value that ranges from 0 (not belonging) to 1 (fully belonging). Fuzzy rules,
often in the form of "IF-THEN" statements, are used to derive conclusions from fuzzy
inputs.
Fuzzy logic helps AI systems reason about imprecise or uncertain information. For
example, in a temperature control system, instead of just categorizing temperatures as
"high" or "low," fuzzy logic can categorize them as "somewhat high," "very high," or
"medium." These categories help the system make decisions based on the varying
degrees of truth.
2. Fuzzy Inference: The application of fuzzy rules to make decisions. For example,
"IF temperature is somewhat high THEN turn on fan moderately."
3. Defuzzification: The process of converting fuzzy output values back into crisp
values for decision-making. For instance, the system may decide to turn the fan
on at 60% speed based on the fuzzy logic model.
Examples of Application:
In knowledge representation, filler structures are used to define and organize the values
of attributes associated with objects, their relationships, and the overall representation
of knowledge in an AI system. These structures are important in modeling complex
systems where relationships and attributes need to be effectively represented and
reasoned upon. The two primary types of filler structures in knowledge representation
are weak fillers and strong fillers.
• Flexibility: Weak fillers allow a wide variety of potential values for attributes or
relationships. They can represent incomplete or uncertain knowledge.
• Under-specification: Weak fillers tend to be less specific about the exact values
or details of the objects, attributes, and relationships they represent. This makes
them useful when dealing with incomplete or vague knowledge.
• Use in Uncertainty: These structures are especially useful when the exact
details are either unknown or not required. For example, in probabilistic
reasoning or fuzzy logic systems, weak fillers can represent a range of
possibilities, rather than a fixed value.
A strong filler, in contrast, is much more specific and rigid. It enforces strict constraints
on the values that can be assigned to attributes, ensuring a more concrete and defined
representation of the object or concept.
• Rigidity: Strong fillers impose clear constraints on the values that can be
assigned. The system is forced to adhere to these constraints, making it less
flexible than weak fillers.
• Specification: Strong fillers are well-defined and precise, ensuring that the
system has a complete and unambiguous representation of an object and its
attributes.
Answer – Introduction:
Knowledge representation (KR) is a core area in Artificial Intelligence (AI) that aims to
represent the information or knowledge about the world in a structured and
understandable way for intelligent systems. Two commonly used structures for
knowledge representation are semantic networks and frames. Both structures help in
organizing knowledge, enabling reasoning, and aiding knowledge retrieval efficiently.
These structures allow an AI system to understand and make inferences based on the
data available.
1. Semantic Networks:
• Node 1: Animal
Here, the relationships are represented by edges like "is a" (e.g., Dog is a Mammal), and
you can infer that since a dog is a mammal and mammals are animals, a dog is an
animal. This inheritance mechanism simplifies reasoning.
2. Frames:
• Frame: Car
o Slots:
If we create a more specific frame for a sports car, it might inherit properties from the
Car frame:
o Slots:
Here, the Sports Car frame inherits most of its properties from the Car frame but has
specific attributes such as a higher max speed and a different model. This
demonstrates how frames can represent complex objects with properties and allow
reasoning through inheritance.
Comparison and Integration:
• Frames are better suited for representing complex entities and structured data
that involve multiple properties. They support more detailed reasoning about
objects and allow inheritance of attributes, making them ideal for modeling real-
world objects with many features.
For example, the sentence "John gave Mary a book" can be represented in CD as:
• PTRANS (John, Mary, Book): This represents the action of giving, with John as
the agent, Mary as the recipient, and the book as the object.
• ACTOR: John
• RECIPIENT: Mary
• THEME: Book
The CD representation abstracts the sentence structure into these core actions and
relationships, regardless of the word order or specific linguistic elements in the
sentence.
Scripts are particularly useful for modeling situational knowledge in AI systems. They
provide a framework for understanding the structure and flow of common events, such
as "going to a restaurant" or "visiting a doctor." These scripts can be used to help AI
systems reason about and predict behaviors or infer missing details in given situations.
• Actions: The actions performed by the participants (e.g., order food, serve food).
• Preconditions: The conditions that must hold for the script to be enacted.
Example of a Script:
1. Preconditions: The person is hungry, they have money, and they know a
restaurant.
In this script, each action is linked to a participant (e.g., customer, waiter), and a typical
sequence of events is outlined. AI systems using scripts can easily fill in missing details
(e.g., "What happens if the customer doesn’t have enough money?") by reasoning within
the framework of the script.