AI - Unit 2
AI - Unit 2
Prof Aarthy G
REVA University- SoCIT
Email : aarthy.g@reva.edu.in
Unit 2 –Knowledge Representation
• Knowledge Representation: Knowledge representation and mappings; Approaches to
knowledge representation; Issues in knowledge representation; Using Predicate logic:
Representing simple facts in logic; Representing Instance and ISA relationships; Computable
functions and predicates; Representing Knowledge using Rules; Procedural versus declarative
knowledge; Resolution Forward versus backward reasoning; Matching.
• TEXT BOOKS:
o Russell & Norvig, “Artificial Intelligence: A Modern Approach”, Third Edition, Prentice-Hall, 2010.
AI_Russell_Norvig.pdf
o Elaine Rich, Kevin Knight, “Artificial Intelligence”, “, 3rdedition, TataMcgraw Hill, 2009
Kevin Knight, Elaine Rich, B. Nair - Artificial Intelligence (2010, Tata McGraw-Hill Education Pvt. Ltd.) - libgen.lc.pdf
• REFERENCE BOOKS:
o Nils J. Nilsson, Elsevier, “Principles of Artificial Intelligence”, 1980. “Artificial Neural Networks”,
o Krishan Mehrotra, Chilkuri K. Mohan, Sanjay Ranka, “Artificial Neural Networks”, Penram International Publishing,
1997.
o B. Yegananarayana, “Artificial Neural Networks”, PHI, 2001.
Knowledge Representation
• Humans are best at understanding, reasoning, and interpreting knowledge.
• Human knows things, which is knowledge and as per their knowledge they perform various
actions in the real world.
• But how machines do all these things comes under knowledge representation and reasoning?
• It is also a way which describes how we can represent knowledge in artificial intelligence.
• Knowledge representation is not just storing data into some database, but it also enables an
intelligent machine to learn from that knowledge and experiences so that it can behave
intelligently like a human.
• Following are the kind of knowledge which needs to be represented in AI systems:
• Facts: Facts are the truths about the real world and what we represent.
• AI system has Perception component by which it retrieves information from its environment.
• The learning component is responsible for learning from data captured by Perception comportment.
• In the complete cycle, the main components are knowledge representation and Reasoning.
• These two components are involved in showing the intelligence in machine-like humans.
• These two components are independent with each other but also coupled together.
• The planning and execution depend on analysis of Knowledge representation and reasoning.
Mappings in AI
• Mappings in AI refer to the translation or conversion of knowledge between different
representation formats or layers of abstraction, allowing an AI system to use the encoded
information for learning, reasoning, or acting.
• Symbolic to Sub-symbolic Mapping
• Many AI systems map symbolic knowledge (explicitly structured knowledge, such as rules or logic)
to sub-symbolic forms like neural networks, where the knowledge is implicitly encoded in weights
and patterns.
• Example: Translating human knowledge about driving rules (symbolic) into a neural network
trained to drive a car (sub-symbolic).
• Mapping to Ontologies
Knowledge in raw forms, like text or data, can be mapped to an ontology, where it becomes
structured and usable by AI systems.
• Example: Mapping a dataset of diseases and treatments into an ontology to enable a medical AI
system to reason about treatment options.
• Mapping Data to Logic Systems:
Data (e.g., from sensors or databases) is often mapped to logical representations to enable reasoning
systems to make inferences.
• Example: Sensor data from a self-driving car can be mapped into a logic system that represents road
rules and traffic conditions.
• Example: Mapping text input like “John is older than Mary” into a formal knowledge structure that
represents this relationship.
Issues in knowledge representation
AI
• Representation of Common Sense Knowledge
• Ambiguity and Vagueness
• Scalability
• Incomplete and Uncertain Knowledge
• Non-monotonic Reasoning
• Knowledge Acquisition Bottleneck
• Formal vs Practical Knowledge
• Contextualization
• Expressiveness vs. Efficiency
• Ontology Alignment
• Temporal Knowledge Representation
• Ethics and Bias
Using Predicate logic: Representing
simple facts in logic in AI
• Predicate logic in artificial intelligence, also known as first-order logic or first order predicate logic
in AI, is a formal system used in logic and mathematics to represent and reason about complex
relationships and structures.
• Symbols:
Basic Components of Predicate
Logic
• Predicates: Functions that represent properties of objects or relationships between objects.
Universal Statement
• Statement: "All birds can fly."
• ∀x(Bird(x)→CanFly(x))
Existential Statement
• Statement: "There exists a cat that is black.“
• ∃x(Cat(x)∧Black(x))
Conditional Statement
• Statement: "If it rains, then the ground is wet.“
• Rains → Wet(Ground)
Negation
• Statement: "Not all students are passing.“
• ¬∀x(Student(x)→Passing(x))(equivalently, ∃x(Student(x)∧¬Passing(x)))
• ∀x(Person(x)→∃y(Dog(y)∧BelongsTo(y,x)))
Representing Instance and ISA relationships in AI
• In artificial intelligence, representing instance and ISA (is-a) relationships is crucial for organizing
knowledge in a structured manner, particularly in knowledge representation systems like
ontologies and semantic networks.
• In an ontology, the ISA relationship can be represented as a directed graph where nodes
represent classes (concepts) and edges represent the ISA relationship
• ISA Relationships
• The ISA relationship is a hierarchical connection that signifies that one concept is a subtype
or specialization of another.
• For example, "A cat is a mammal.
• ∀x(Cat(x)→Mammal(x))
• Instance Relationships
• Cat(Whiskers)
• Inheritance
• Querying
• Classification
Computable functions and
predicates in AI
• computable functions and predicates are central to understanding how AI systems can reason,
decide, and act based on certain conditions or inputs
• Computable Functions:
• A function is computable if there exists a systematic procedure (an algorithm) that can take
any input from the function's domain and produce the correct output after a finite number
of steps.
• In AI, computable functions often refer to algorithms or models that process data and
provide specific outputs, such as classifications, predictions, or decisions.
• Let f(x)=+2x+1 This is a computable function because, given any value for x, we can compute
the corresponding output using a set of basic operations (multiplication, addition, etc.)
• Predicates:
• A predicate is a logical statement that can either be true or false for a given set of inputs. It is a
function that returns a Boolean value.
• In AI, predicates are often used in decision-making systems, such as rule-based systems, where
conditions need to be checked to determine the next action.
• This approach uses logic-based statements to encode knowledge in a way that allows an AI
system to reason, infer new information, or make decisions.
• The rule-based system relies on if-then structures, also known as production rules
• Components of Rule-Based Knowledge Representation:
• Facts:
• These are the basic units of knowledge, representing information about the world in a declarative
form.
• Rules:
• Consequent (THEN part): The action or conclusion that follows if the antecedent is true.
Homework
• Types of Rule based knowledge representation.
Procedural versus declarative
knowledge
• Definition: Knowledge about how to perform tasks or processes. It refers to the steps or
procedures involved in achieving a specific goal
• Definition: Knowledge about facts or concepts. It refers to what something is or what is true
about the world
• Flexibility : Procedural knowledge is usually task-specific and less flexible, while declarative
knowledge is more flexible and can be applied to a broader range of situations.
• In AI : Procedural knowledge in AI might involve the steps for a robot to perform a task, while
declarative knowledge might state that "a robot is a machine."
Flipped Class Activity
• Resolution Forward versus backward reasoning
• Matching