UNIT 3 - KNOWLEDGE REPRESENTATION
Issues, predicate logic, resolution, representing knowledge using
rules, forward versus backward reasoning, matching, control
knowledge, weak slot and filler structure-semantic nets, frames,
strong slot - learning curve analysis by logistic regression.
WHAT IS KNOWLEDGE REPRESENT
Knowledge Representation (KR) in AI focuses on how machines store and
organize real-world information so they can reason, learn, and make intelligent
decisions like humans.
Represents knowledge in a structured form that computers can process.
Helps AI systems perform reasoning and problem-solving tasks.
Enables intelligent applications like medical diagnosis and language
understanding.
Allows machines to use stored knowledge and past experiences effectively.
ISSUES OF KNOWLEDGE REPRESENTATION
There are some common issues of knowledge representation in AI. They are:
Relationship Issue
Granularity Issue
Attribute Issue
All the issues of knowledge representation in AI are discussed in short below.
Relationship Issue
Relationship issues in big data analytics refer to the disconnects that occur
between data models, analytical tools, operational systems, and business
strategy. These challenges manifest as broken pipelines, fragmented data
relationships (e.g., between tables), and misalignment between human intent
and machine execution
Consider the below two representations for same facts:
language(Danny, Javascript)
1. This tells Danny is Javascript Developer or Danny’s language is
2. Javascript. This can be also represented in the way below:
Language = Javascript
Developer = Danny
There is a little bit difference in relationship representation in above two case.
Granularity Issue
Granularity in big data analytics refers to the level of detail or precision in a
dataset. The core challenge arises when data is too detailed (causing
processing overload) or too aggregated (hiding critical insights), creating a
constant tug-of-war between computational cost and analytical depth
See the below statements:
If Harry feeds a dog
Feeds(harry, dog)
If Harry gives the dog a bone
Gives(harry, dog, bone)
These two statements are not same. So, we should choose primitives carefully.
In this condition we may need an additional statement which will relate the
giving as feeding
Attribute issues
Attribute issues in big data analytics stem from poor data quality. If a dataset's
descriptive variables (attributes) are inaccurate, missing, or improperly formatted,
predictive models fail due to the "garbage in, garbage out" rule, leading to flawed,
biased, or unreliable business decisions.
Common Attribute Issues with Examples
Incomplete Data: Missing attribute values prevent algorithms from finding
meaningful patterns.
Example: An e-commerce platform's demographic analysis fails because a large
percentage of customer profiles are missing "age" or "income" attributes.
Inconsistent Data: The same attribute is represented in different formats,
confusing analytical engines.
Example: A global database tracks "Country" where some records show "USA",
some show "United States", and others show "US". The system reads these as
three distinct categories.
Inaccurate Data: The attribute values do not reflect real-world facts, often due to
human entry errors or system malfunctions.
Example: An IoT sensor reports a building’s temperature as 500°C, resulting in
skewed operational analytics due to an equipment glitch.
Irrelevant or High-Dimensionality Data: Datasets possess too many attributes,
leading to "noise accumulation" that overwhelms analytics tools.
Example: A machine learning model predicting loan defaults is fed 500 attributes
(e.g., shoe size, favorite color), causing the algorithm to overfit and lose predictive
accurac
Predicate logic
In the predicate logic or First order Predicate Logic of knowledge
representation, it is assumed that the word contains object, relations, and
functions. The Predicate logic is a symbolized reasoning in which we can
divide the sentence into a well-defined subject and predicate. The subject
is defined by the predicate. It should be noted that the predicate can only
refer to a single subject.
Example:
Ravi likes peanuts
Predicate logic for above statement: like (Ravi,Peanuts)
Here, Ravi is subject, like is a predicate and peanuts is
the value that the predicate defines for the subject.
Representation in Predicate Logic
Key Components
1. Constants: These represent specific objects or entities.
Example: Alice, 2, NewYork
2. Variables: These stand for unspecified objects or entities.
Example: x, y, z
3. Predicates: These define properties or relationships.
Example: Likes(Alice, Bob) means "Alice likes Bob"
4. Functions: It map objects to other objects.
Example: MotherOf(x) refers to the mother of x
5. Quantifiers: These define the scope of variables:
Example: ∀x(Person(x)→Mortal(x))∀x(Person(x)→Mortal(x)) means "All
Universal Quantifier (∀): Applies a predicate to all elements.
persons are mortal"
Example: ∃x(Person(x)∧Likes(x,IceCream))∃x(Person(x)∧Likes(x,IceCream))
Existential Quantifier (∃): Shows the existence of at least one element.
means "Someone likes ice cream"
6. Logical Connectives: Include conjunction(∧∧), disjunction (∨∨), implication
(→→), biconditional (↔↔) and negation (¬¬).
Syntax, Semantics and Logical Reasoning
The syntax of First-Order Logic defines the rules for constructing valid logical
expressions, while semantics assigns meaning to those expressions based on a
domain of interpretation. Together, they allow AI systems to represent knowledge
and derive conclusions through logical reasoning.
For example, consider the following statements:
∀x(Cat(x)→Mammal(x))∀x(Cat(x)→Mammal(x)) means “All cats are mammals”
∀x(Mammal(x)→Animal(x))∀x(Mammal(x)→Animal(x)) means “All mammals
are animals”
Cat(Tom) means “Tom is a cat”
Using logical inference, we can derive:
Mammal(Tom) meaning “Tom is a mammal”
Animal(Tom) meaning “Tom is an animal”
This shows how First-Order Logic enables AI systems to infer new knowledge from
existing facts and relationships
RESOLUTION
Resolution refers to two distinct but vital concepts: Entity Resolution (unifying
fragmented records into a single truth) and Resolution Inference (a logical
reasoning algorithm used to deduce new knowledge).
1. Entity Resolution (ER) in Knowledge Representation
Big data is inherently noisy, redundant, and fragmented. Entity resolution cleans
and consolidates this data before it is structured into a Knowledge Graph.
The Process: ER maps this to a canonical node in a Knowledge Graph through
three steps:
1. Blocking: Reduces the massive comparison space by grouping similar entities
together.
2. Scoring: Applies probabilistic matching (using string similarity, contextual
embeddings, or relational proximity) to calculate match confidence.
3. Clustering: Resolves scored pairs into a unified entity representation.
2. Resolution Inference (Logical Reasoning)
Once big data is represented as formal logic or semantic rules, AI systems use the
Resolution Algorithm to deduce new facts and solve problems.
The Process: It acts as an automated theorem prover that operates on proof by
contradiction. To prove a hypothesis (goal) is true:
1. The system converts the Knowledge Base rules and facts into Conjunctive Normal
Form (CNF).
2. It adds the negation of the goal to the Knowledge Base.
3. It repeatedly resolves complementary clauses (e.g., resolving P and \(\neg P\)) to
derive an empty clause, which indicates a contradiction and mathematically proves
the original hypothesis is true.
Unification: This resolution process relies heavily on Unification, which is the
technique of finding variable substitutions to make different logical statements
identical (e.g., making Dog(X) and Dog(Fido) match)
REPRESENTING KNOWLEDGE USING RULES
Representing knowledge using rules in big data analytics bridges raw,
unstructured data and automated decision-making.
[Link] of Rule-Based Representations
Production Rules: Structured as IF [condition] THEN [action]. They capture
causal, heuristic, or diagnostic relationships (e.g., IF customer_cart contains [item
A] AND [item B] THEN recommend .
Logic-Based Representation: Uses formal logic (propositional or first-order) to
define universally true facts and rules that the computer uses to infer new ones.
Semantic Networks & Frames: Organizes rules hierarchically, representing
concepts as nodes and relationships as edges (e.g., Car -> is a -> Vehicle).
[Link] Rules from Big Data
Unlike traditional systems where experts manually write rules, big data analytics
uses data mining algorithms to discover hidden rules directly from massive
volumes of data.
Association Rule Mining: Algorithms like Apriori evaluate transaction databases
to discover interesting relationships (e.g., "Market Basket Analysis"). Rules are
generated using two core metrics:
o Support: The frequency of itemsets appearing in the dataset.
o Confidence: The probability that a rule is true when IF occurs
Decision Trees: Data is recursively partitioned based on attribute values to
formulate branching rules that predict outcomes or classify data.
3. Reasoning and Inference
Once rules are formulated, the Inference Engine interprets them using two
primary methods
Forward Chaining (Data-driven): Starts with the available data/facts and applies
rules forward to extract new facts until a conclusion or goal is reached.
Backward Chaining (Goal-driven): Starts with a hypothetical goal, works
backward, and checks if there are enough supporting facts and rules in the
database to prove it.
FORWARD VERSUS BACKWARD REASONING
Forward Chaining is great for working with large datasets and adapting to
changing information
Examples of Forward Chaining.
1. Fire Alarm Systems: Sensors detect smoke or heat (facts), and rules trigger
alarms or sprinklers (conclusions).
Fact: Smoke detected.
Rule: If smoke is detected, trigger the alarm.
Action: Alarm sounds.
2. Recommendation Systems: Systems like Netflix or Amazon use user data
(facts) to apply rules and suggest products or content (conclusions).
Fact: User watches action movies.
Rule: If a user watches action movies, recommend similar genres.
Action: Suggest action-packed films.
Backward Chaining is a top-down approach that evaluates whether the goal can
be reached by verifying the necessary facts and rules. It prioritizes efficiency and
relevance, making it ideal for solving specific problems with a clear goal in mind.
Examples of Backward Chaining
1. Medical Diagnosis: A doctor suspects a patient has diabetes (goal) and seeks
evidence to confirm it.
Goal: Confirm diabetes.
Step 1: Check if blood sugar levels exceed thresholds.
Step 2: If not, check for symptoms like frequent urination or fatigue.
Step 3: Verify family history of diabetes.
Conclusion: If all supporting facts align, the diagnosis is confirmed.
2. Troubleshooting a Car Engine: A car won’t start (goal).
Goal: Identify the cause of failure.
Step 1: Check if the battery is dead.
Step 2: If functional, test the fuel pump.
Step 3: If fuel pump works, inspect the ignition system.
Conclusion: The root cause (e.g., faulty spark plugs) is identified.
MATCHING
Matching between current state and the precondition of the rule Indexing
One way to select applicable rules is to do a simple search through all the
rules, comparing each one's preconditions to the current state and
extracting all the ones that match. But there are two problems with this
simple solution: It will be necessary to use a large number of rules.
Scanning through all of them at every step of the search would be
hopelessly inefficient. It is not always immediately obvious whether a rule's
prese are satisfied by a particular state. Rules should be applied if their
preconditions approximately match the current situation
Example: A speech-understanding program Rules: A description of a
physical waveform to Phones (a, e, ...) Physical signal: differences in the
way individuals speak and result of background noise
CONTROL KNOWLEDGE
Control knowledge in Big Data Analytics refers to the governance, compliance,
and operational mechanisms used to manage, structure, and secure vast datasets.
It establishes policies for data access, privacy, and quality, ensuring organizations
safely convert massive, unstructured data into actionable, compliant intelligence.
Key Components of Knowledge Control
Data Cleansing and Selection: Control algorithms establish rules to eliminate
noise, handle missing values, and standardize raw inputs.
Metadata Management: This governs the tracking of data origins, lineage, and
transformation over time.
Machine Learning Feedback: Systems adjust analytical models dynamically
based on previous outputs, validating insights continuously.
\
Cluster Management: For infrastructure like Hadoop, job flow and resource
allocation constraints act as the control systems for data operations.
WEAK SLOT AND FILLER STRUCTURE-SEMANTIC NETS
Semantic networks work as an alternative of predicate logic for knowledge
representation. In Semantic networks, you can represent your knowledge
in the form of graphical networks. This network consists of nodes
representing objects and arcs which describe the relationship between
those objects. Also, it categories the object in different forms and links
those objects. This representation consists of two types of relations:
•IS-A relation (Inheritance)
•Kind-of-relation
Example: Following are some statements which we need to represent in
the form of nodes and arcs.
Statements:
a. Jerry is a cat.
b. Jerry is a mammal
c. Jerry is owned by Priya.
d. Jerry is brown coloured.
e. All Mammals are animal.
In the above diagram, we have represented the different type of knowledge
in the form of nodes and arcs. Each object is connected with another object
by some relation.
Drawbacks in Semantic representation:
1. Semantic networks take more computational time at runtime as we
need to traverse the complete network tree to answer some
questions. It might be possible in the worst-case scenario that after
traversing the entire tree, we find that the solution does not exist in
this network.
2. Semantic networks try to model human-like memory (Which has 1015
neurons and links) to store the information, but in practice, it is not
possible to build such a vast semantic network.
3. These types of representations are inadequate as they do not have
any equivalent quantifier, e.g., for all, for some, none, etc.
4. Semantic networks do not have any standard definition for the link
names.
5. These networks are not intelligent and depend on the creator of the
system.
Advantages of Semantic network:
1. Semantic networks are a natural representation of knowledge.
2. Semantic networks convey meaning in a transparent manner.
3. These networks are simple and easily understandable.
FRAMES
A frame is a record like structure which consists of a collection of attributes
and its values to describe an entity in the world. Frames are the AI data
structure which divides knowledge into substructures by representing
stereotypes situations. It consists of a collection of slots and slot values.
These slots may be of any type and sizes. Slots have names and values
which are called facets.
Facets: The various aspects of a slot are known as Facets. Facets are
features of frames which enable us to put constraints on the frames.
Example: IF-NEEDED facts are called when data of any particular slot is
needed. A frame may consist of
any number of slots, and a slot may include any number of facets and
facets may have any number of values. A frame is also known as slot-filter
knowledge representation in artificial intelligence.
Frames are derived from semantic networks and later evolved into our
modern-day classes and objects. A single frame is not much useful.
Frames system consist of a collection of frames which are connected. In
the frame, knowledge about an object or event can be stored together in
the knowledge base. The frame is a type of technology which is widely
used in various applications including Natural language processing and
machine visions.
Example: 1
Slots Filters
Title Artificial Intelligence
Genre Computer Science
Author Peter Norvig
Edition Third Edition
Year 1996
Page 1152
Let's take an example of a frame for a book
Example 2:
Let's suppose we are taking an entity, Peter. Peter is an engineer as a
profession, and his age is 25, he lives in city London, and the country is
England. So following is the frame representation for this:
Slots Filter
Name Peter
Profession Doctor
Age 25
Marital status Single
Weight 78
Advantages of frame representation:
1. The frame knowledge representation makes the programming
easier by grouping the related data.
2. The frame representation is comparably flexible and used by
many applications in AI.
3. It is very easy to add slots for new attribute and relations.
4. It is easy to include default data and to search for missing values.
5. Frame representation is easy to understand and visualize.
Disadvantages of frame representation:
1. In frame system inference mechanism is not be easily processed.
2. Inference mechanism cannot be smoothly proceeded by
frame representation.
3. Frame representation has a much-generalized approach.
STRONG SLOT
Conceptual Dependency (CD)
Conceptual Dependency originally developed to represent knowledge
acquired from natural language input.
Goals
• To help in the drawing of inference from sentences.
• To be independent of the words used in the original input.
CD provides:
• A structure into which nodes representing information can be placed
• A specific set of primitives
• At a given level of granularity.
Examples of Primitive Acts are:
1. ATRANS: Transfer of an abstract relationship. e.g., give.
2. PTRANS: Transfer of the physical location of an object. e.g., go.
3. PROPEL: Application of a physical force to an object. e.g., push.
4. MTRANS: Transfer of mental information. e.g., tell.
5. MBUILD: Construct new information from old. e.g., decide.
6. SPEAK: Utter a sound. e.g., say.
7. ATTEND: Focus a sense on a stimulus. e.g., listen, watch.
8. MOVE: Movement of a body part by owner. e.g., punch, kick.
9. GRASP: Actor grasping an object. e.g., clutch.
10. INGEST: Actor ingesting an object. e.g., eat.
11. EXPEL: Actor getting rid of an object from body.
Six primitive conceptual categories provide building blocks which are the set of
allowable dependencies in the concepts in a sentence:
1. PP - Real world objects.
2. ACT - Real world actions.
3. PA - Attributes of objects.
4. AA - Attributes of actions.
5. T - Times.
6. LOC - Locations.
Advantages
• Using these primitives involves fewer inference rules.
• Many inference rules are already represented in CD structure.
• The holes in the initial structure help to focus on the points still to
be established.
Disadvantages
• Knowledge must be decomposed into fairly low-level primitives.
• Impossible or difficult to find correct set of primitives.
• A lot of inference may still be required.
• Representations can be complex even for relatively simple actions.
Scripts
A script is a structure that prescribes a set of circumstances which could be
expected to follow on from one another. It is similar to a thought sequence
or a chain of situations which could be anticipated. It could be considered
to consist of a number of slots or frames but with more specialized roles.
Scripts are beneficial because: • Events tend to occur in known runs or
patterns. • Causal relationships between events exist. • Entry conditions
exist which allow an event to take place • Prerequisites exist upon events
taking place.
E.g., when a student progresses through a degree scheme or when a
purchaser buys a house. The components of a script include:
1. Entry Conditions - These must be satisfied before events in the script can
occur.
2. Results - Conditions that will be true after events in script occur.
3. Props - Slots representing objects involved in events.
4. Roles - Persons involved in the events.
5. Track - Variations on the script. Different tracks may share components
of the same script.
6. Scenes - The sequence of events that occur. Events are
represented in conceptual dependency form.
Scripts are useful in describing certain situations such as robbing a bank.
This might involve:
• Getting a gun.
• Hold up a bank.
• Escape with the money.
Here the Props might be
• Gun, G.
• Loot, L.
• Bag, B
• Getaway car, C.
The Roles might be:
• Robber, S.
• Cashier, M.
• Bank Manager, O.
• Policeman, P.
The Entry Conditions might be:
• S is poor.
• S is destitute.
The Results might be:
• S has more money.
• O is angry.
• M is in a state of shock.
• P is shot.
There are 3 scenes: obtaining the gun, robbing the bank and the getaway.
The full Script could be described in Fig. If a particular script is to be
applied it must be activated and the activating depends on its significance.
If the topic is important then the script should be opened.
The danger lies in having too many active scripts much as one might have
too many windows open on the screen or too many recursive calls in a
program. Provided events follow a known trail we can use scripts to
represent the actions involved and use them to answer detailed questions.
Different trails may be allowed for different outcomes of Scripts (e.g., The
bank robbery goes wrong).
Advantages
• Ability to predict events.
• A single coherent interpretation may be built up from a collection
of observations.
Disadvantage
• Less general than frames.
• May not be suitable to represent all kinds of knowledge.
CYC
In the absence of a learning machine that can acquire common sense facts
on its own, there would seem to be only one option left. That is, manually
programming in the millions of general knowledge items that we take
entirely for granted. The CYC research project has actually undertaken this
mammoth task
LEARNING CURVE ANALYSIS BY LOGISTIC REGRESSION
A learning curve is a correlation between a learner's performance on a task
and the number of attempts or time required to complete the task; this can
be represented as a direct proportion on a graph. the "normal" shape of a
learning curve (defined as a "plot of error vs training set size is known as a
learning curve"
(1)) is to observe an initially very low training error indicating that the model
almost perfectly learns the small amount of training data while the test error
will be high. When the amount of training data increases, the training error
is expected to increase, too, as it becomes harder for the model to learn
the increasingly complex data. At some point usually the training error
stops increasing because data complexity, i.e., the number of distinct
patterns in the data, does not increase further - even when adding more
data.
In contrast, the test error is expected to be high in the beginning and then
decrease when train and test data become more similar (since you're
adding more training data). That is, in the beginning the model overfits
(which is good news
since it means that it's able to learn the data) and later train and test error
ideally converge. This occurs when training and test become more similar.
The Learning Curve Theory
Ebbinghaus' forgetting curve
While the term "learning curve" came into use in the early 20th century, Dr.
Hermann Ebbinghaus described this theory as early as [Link] mostly
was focusing on memory studies and developed a forgetting curve theory.
This theory helps us to understand how our memory works, and retains
information, relating to specific things people attempt to learn.
The modern Microlearning theory is based on Ebbinghaus memory studies.
Nowadays it helps us understand when and why we forget certain
information and how we can tackle this. Later, Arthur Bills described the
learning curve in his work “General experimental psychology” (Bills, Arthur
Gilbert, in 1934, page 192). In his work, he describes it saying, “the
learning curve is a graphical device for picturing the rate of improvement in
terms of a given criterion of efficiency, as a
result of practice.” He described two sides of the same process and had
presented two learning curve graphs.
The 1st curve of achievement represents an increase in productivity over
each unit of trial.
Acqusitive curve of amount - “General experimental psychology” (Bills,
Arthur Gilbert, in 1934, page 193)
The 2nd illustrates an eliminative, or declining, curve of time needed to
perform the same task.
Eliminative curve of time - “General experimental psychology” (Bills, Arthur
Gilbert, in 1934, page 194)
Wright’s experience curve
This is the basis for the learning curve formula, the “Cumulative Average
Model” (or “Wright’s Model”), which was described by T.P. Wright in 1936
in his work "Factors Affecting the Cost of Airplanes", after realizing that the
cost of aircraft production decreased with the increase in production
performance. There are currently different variations of the original formula
used today in specialized applications, but the idea remains familiar to the
original formula.
The experience curve theory states that the effort to complete a task
should take less time and effort the more the task is done over time. If one
were to plot the repeated attempts of a learner against the time taken to
complete the attempt, a pattern can be identified indicating that the task
takes less time as the learner
gains more experience via repeated attempts. The theory can also be
expressed as a mathematical function that can be used as a prediction tool.
Learning curve formula
The original model uses the formula: Y = aXb
Where:
Y is the average time over the measured
duration a represents the time to complete the task the
first time X represents the total amount of attempts
b
completed represents the slope of the function
The formula can be used as a prediction tool to forecast future performance.
The formula stipulates that the more attempts that are included, the more
the overall time will decrease. The formula can be used to predict a
learner’s rate of learning of a simple task or even help businesses to
predict the production rate of a product.
Learning curve models and examples
Although the theory states that more attempts = a decrease in time, it does
not always work out that way. Many factors can impact the end-results,
resulting in a variety of different learning curve shapes. Here are four
common types of a learning curve and what they mean:
1. Diminishing-Returns Learning Curve
The rate of progression increases rapidly at the beginning and then
decreases over time. This describes a situation where the task may be
easy to learn and progression of learning is initially fast and rapid.
Progression levels off as the learner obtain full proficiency. This could be
described as a plateau, where the individual is no longer progressing. It
could signal that the learner has reached a limit in their ability or that a
transition may be occurring. It could also mean that the individual has lost
motivation or is fatigued.
Increasing-Returns Learning Curve
The rate of progression is slow at the beginning and then rises over time
until full proficiency is obtained. This model describes a situation where
perhaps a complex task is being learned and the rate of learning is initially
slow.
Increasing-Decreasing Return Learning Curve (the S-curve)
This model is the most commonly cited learning curve and is known as the
“S-curve” model. It measures an individual who is new to a task. The
bottom of the curve indicates slow learning as the learner works to master
the skills required and takes more time to do so.
The latter half of the curve indicates that the learner now takes less time to
complete the task as they have become proficient in the skills required.
Often the end of the curve begins to level off, indicating a plateau or new
challenges.
Complex Learning Curve
This model represents a more complex pattern of learning and reflects
more extensive tracking.
1. The beginning of the curve indicates that learning is initially slow.
2. The second stage of the curve shows an increase, which indicates
that the learner is becoming proficient in the skill.
3. The third stage of the curve indicates that the learner is plateauing in
his proficiency once the learner feels he has mastered the skill.
4. The fourth stage of the curve represents that the learner is actually
still improving the skill.
5. The last stage of the curve represents the point at which the skill
becomes automatic, muscle memory for the learner, often termed “over
learning”.