1 of 39

ARTIFICIAL INTELLIGENCE

Dr. P V Siva Teja

Associate Professor

2 of 39

 UNIT-3: Representation of Knowledge

Knowledge representation issues, predicate logic- logic programming, semantic nets- frames and inheritance, constraint propagation, representing knowledge using rules, rules based deduction systems.

Reasoning under uncertainty, review of probability, Bayes' probabilistic interferences and Dempster Shafer theory.

3 of 39

A machine sounds like an empty box unless it is encoded with some features or information. Therefore, to make it a valuable machine, it is required to put the necessary knowledge in it. So that it could understand it and is able to take the right decisions.

There are three factors which are put into the machine, which makes it valuable:

  • Knowledge: The information related to the environment is stored in the machine.
  • Reasoning: The ability of the machine to understand the stored knowledge.
  • Intelligence: The ability of the machine to make decisions on the basis of the stored information.

KNOWLEDGE REPRESENTATION

4 of 39

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.

5 of 39

Types of Knowledge

  • Declarative Knowledge: Knowledge about facts and concepts it answers what something is . Example: Paris is the capital of France.
  • Procedural Knowledge: Knowledge about how to perform a task or solve a problem. Example: Steps to sort numbers using an algorithm.
  • Meta knowledge: Knowledge about other knowledge or how knowledge is used. Example: Knowing that a certain rule works better for solving math problems.
  • Heuristic Knowledge: Experience based knowledge or rules of thumb used by experts. Example: A doctor using past experience to guess a possible disease.
  • Structural Knowledge: Knowledge that shows relationships between concepts. Example: A car is a type of vehicle.

6 of 39

TECHNIQUES OF KNOWLEDGE REPRESENTATION

  1. Logical Representation: Logical representation uses formal rules and logic to represent knowledge in AI and helps systems draw conclusions based on given conditions.
  2. Semantic Network Representation: A semantic network represents knowledge using a graph structure with nodes (concepts or objects) and arcs (relationships).
  3. Frame Representation: A frame is a data structure used to represent knowledge about an object or situation using slots (attributes) and values. It organizes related information together and is widely used in NLP and computer vision.
  4. Production Rules: Production rules represent knowledge in the form of IF–THEN rules. When a condition is satisfied, the system performs the corresponding action.

7 of 39

Key Issues in Knowledge Representation

  1. Ambiguity: Natural language and context can create multiple interpretations, making it difficult for AI to understand meaning accurately.
  2. Incompleteness: Limited or missing information restricts an AI system’s ability to make optimal decisions.
  3. Scalability: Representing and reasoning over large volumes of knowledge can be computationally intensive, especially in production rule systems or large semantic networks.
  4. Mapping Challenges: Translating real-world facts into formal representations (forward mapping) and interpreting formal representations back into human-understandable knowledge (backward mapping) can be complex.
  5. Granularity and Relationships: Deciding the level of detail and how to represent relationships between concepts is critical for effective reasoning.

8 of 39

In artificial intelligence (AI), main focus is to store knowledge so that programs can process it and achieve human intelligence.

There are different ways of representing knowledge

  • Predicate logic,
  • Semantic networks,
  • Extended semantic net,
  • Frames,
  • Conceptual dependency, etc …

9 of 39

PREDICATE LOGIC- LOGIC PROGRAMMING

Predicate logic, also known as First-Order Logic (FOL) , is a formal system used in artificial intelligence, mathematics and logic to represent relationships between objects and make inferences. It extends Propositional Logic by incorporating quantifiers, predicates and variables , making it more expressive.

10 of 39

Basic Elements

  1. Constants (Objects): Represent specific entities in the domain. Example: Alice, 5, Paris
  2. Variables: Represent unspecified elements in the domain. Example: x, y, z
  3. Predicates (Relations/Properties): Functions that define a property or a relation between objects. Example: Loves(Alice, Bob) (Alice loves Bob)
  4. Functions: Define deterministic mappings from objects to objects. Example: Father(John) = Robert (John’s father is Robert)
  5. Logical Connectives: ¬ (Negation), ∧ (AND), V (OR), (Implication), (Biconditional)
  6. Quantifiers:
    1. Universal Quantifier (): "For all" – expresses generality. Example: ∀x Loves(x, Chocolate) → (Everyone loves chocolate)
    2. Existential Quantifier (): "There exists" – expresses existence. Example: ∃x Loves(x, Pizza) (At least one person loves pizza)

11 of 39

12 of 39

13 of 39

SEMANTIC NETS

Semantic networks are a fundamental component in artificial intelligence (AI) used to represent and organize knowledge in a way that machines can understand. These networks connect different concepts (nodes) through relationships (edges) such as "is a", "part of" or "related to" allowing AI systems to make sense of how ideas are linked.

They are applied in areas like natural language processing (NLP), knowledge representation and AI reasoning, it help machines process and reason about information more effectively. For example, in a simple semantic network the concept "Dog" might be connected to "Animal" with an "is a" relationship showing that a dog is a type of animal.

14 of 39

15 of 39

16 of 39

Frames And Inheritance

17 of 39

18 of 39

19 of 39

20 of 39

21 of 39

22 of 39

23 of 39

24 of 39

Rule 1: IF patient has fever AND cough THEN patient may have flu

Rule 2: IF patient has chest pain AND breathing difficulty THEN patient may have pneumonia

Rule 3: IF patient may have flu THEN recommend rest and fluids

🔹 Example: Medical Expert System Rule

25 of 39

26 of 39

27 of 39

28 of 39

Unit -3 (Part –B)

KNOWLEDGE REPRESENTATION

29 of 39

Reasoning under uncertainty in Artificial Intelligence involves using mathematical frameworks, particularly probability theory, to make decisions and predictions when information is incomplete, noisy, or ambiguous. This approach is essential for creating intelligent systems capable of operating effectively in real-world environments where perfect knowledge is rarely available.

30 of 39

Uncertainty reasoning allows AI systems to process and analyze data that may be noisy, missing, or contradictory, and to make informed decisions based on probabilistic assessments. This is essential for various applications, such as natural language processing, autonomous driving, and medical diagnosis, where decisions must often be made with less-than-complete information.

Methods for Managing Uncertainity Information

1)Probability

2)Bayesian Belief Network

3)Temporal Models

4)Hidden Markov Model

TYPES OF UNCERTAINTY

1)Uncertainty in prior knowledge

E.g., some causes of a disease are unknown and are not represented in the background knowledge of a medical-assistant agent.

2)Uncertainty in actions

E.g., to deliver this lecture:

I must be able to come to college my computer must be working

the LCD projector must be working.

31 of 39

3)Uncertainty in perception

E.g., sensors do not return exact or complete information about the world; a robot never knows exactly its position.

SOURCES OF UNCERTAINTY

  • Laziness (efficiency)
  • Ignorance

Solution : Probabilistic reasoning is a way of knowledge representation we apply the concept of probability to indicate the uncertainty in knowledge

32 of 39

Review of Probability

AI is all about creating machines or systems that can mimic human intelligence. But unlike traditional computer programs that follow exact rules, AI often needs to make decisions in situations where information is incomplete, uncertain, or changing. This is where probability comes in.

Why Probability in AI?

Real-world environments are uncertain (data may be incomplete, noisy, or ambiguous).

Probability theory provides a mathematical framework for representing and reasoning about uncertainty.

AI systems use probability to make informed predictions and decisions.

33 of 39

Probability measures the likelihood of an event happening.

Range: 0≤P(E)≤1

P(E)=0 → Event impossible.

P(E)=1 → Event certain.

Formula:

P(E)= Number of favorable outcomes

____________________________

Total possible outcomes

Building Blocks of Review of Probability:

Probability: To measure and quantify uncertainty.

Random Variables: To represent uncertain outcomes as variables.

Probability Distributions: To describe how probabilities spread over possible outcomes.

Joint Probability: To model the likelihood of multiple events occurring together.

Conditional Probability: To update probabilities based on new evidence.

Independence: To simplify models by identifying unrelated variables.

Bayes’ Theorem: To revise beliefs and make decisions with new data.

These tools are used for AI to handle uncertainty, make predictions, and learn effectively in real-world situations.

34 of 39

Bayes Probabilistic interference

35 of 39

Bayesian inference is a method of statistical inference in which Bayes' theorem is used to update the probability for a hypothesis more evidence or information becomes available.

Bayesian inference is an important technique in statistic: especially in mathematical statistics.

It is the foundation of Bayesian reasoning and is widely used in machine learning, expert systems, medical diagnosis, spam filtering

Bayes Probablistic Interference Formula :

P(A∣B)= P(B∣A)⋅P(A)

______________

P(B)

Where:

H= Hypothesis

E = Evidence (new data, e.g., "email contains the word 'win'")

P(A)= Prior probability

P(B∣A) = Likelihood

P(B)= Total probability of evidence

P(A∣B) = Posterior probability

These are four major elements in Bayes' Theorem

36 of 39

Derivation:

1. Start with the Definition of Conditional Probability

The probability of event A given event B is:

P(A∣B)=P(A∩B)/P(B) 🡪(1)

Similarly, the probability of event B given event A is:

P(B∣A)=P(A∩B)/P(A) 🡪(2)

From equations (1) and (2), we can equate the joint probability:

P(A∩B)=P(A∣B)⋅P(B)=P(B∣A)⋅P(A) 🡪(3)

2. Rearranging to Derive Bayes' Theorem

From equation (3):

P(A∣B)=P(B∣A)⋅P(A)/P(B) 🡪(4)

This is the standard form of Bayes' Theorem.��

P(AB)=P(BA)⋅P(A)/P(B)​

37 of 39

Example:

Email Spam Detection

Suppose: 20% of emails are spam → P(Spam)=0.2

80% are not spam→P(NotSpam)=0.8

Now, we observe that an email contains the word “Win”.

From past data:

70% of spam emails contain “Win” → P(Win∣Spam)=0.7

10% of non-spam emails contain “Win” → P(Win∣NotSpam)=0.1

38 of 39

 

39 of 39