#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
Knowledge

Knowledge Representation in AI - Types, Issues, & Techniques

What is Knowledge Representation?

Knowledge Representation (KR) is the field of AI concerned with how information about the world is encoded so that a computer system can use it to solve complex tasks.

Types of Knowledge

  • Declarative knowledge: Facts about the world.
  • Procedural knowledge: How to perform tasks.
  • Heuristic knowledge: Rules of thumb based on experience.
  • Structural knowledge: Relationships between concepts.

Common Techniques

  • Semantic Networks: Graph-based representation of concepts and relationships.
  • Frames: Structured records representing stereotypical situations.
  • Logic-based representation: Using propositional or predicate logic.
  • Production Rules: If-then rules used in expert systems.
  • Ontologies: Formal representation of knowledge as a set of concepts and relationships.

Issues in Knowledge Representation

  • Handling incomplete or uncertain knowledge.
  • Scalability as knowledge bases grow large.
  • Balancing expressiveness with reasoning efficiency.
Key Takeaway: Mastering this topic is a key step toward becoming a well-rounded AI professional, capable of building real-world, intelligent systems.

One Fact, Four Representations

The easiest way to compare techniques is to encode the same knowledge in each of them. Take this tiny piece of world knowledge: Tweety is a bird. Birds can usually fly. Penguins are birds that cannot fly. Pingu is a penguin.

Predicate logic
  Bird(Tweety)
  Penguin(Pingu)
  ∀x Penguin(x) → Bird(x)
  ∀x Bird(x) ∧ ¬Penguin(x) → CanFly(x)

Semantic network
  Tweety --is-a--> Bird --can--> Fly
  Pingu  --is-a--> Penguin --is-a--> Bird
  Penguin --can--> NOT Fly   (overrides the inherited link)

Frame
  Frame: Penguin
    is-a      : Bird
    can_fly   : false      (default from Bird was true)
    habitat   : cold coasts

Production rule
  IF bird(X) AND NOT penguin(X) THEN can_fly(X)

Notice how each style handles the penguin exception. Pure logic forces you to write the exception into every rule, which gets messy fast. Semantic networks and frames handle it naturally through inheritance with overrides. Production rules sit in between: easy to read, but you must order and test them carefully.

How a Rule-Based System Reasons Step by Step

Storing knowledge is only half of the job. An inference engine has to use it to reach new conclusions. The two classic strategies are:

  • Forward chaining starts from known facts and keeps firing rules until nothing new can be derived. It suits monitoring and alerting, where data arrives first.
  • Backward chaining starts from a goal, such as "can Pingu fly?", and works back to see which facts would prove it. It suits diagnosis and question answering.

A short forward-chaining loop in Python shows the idea:

facts = {"bird(tweety)", "penguin(pingu)"}
rules = [
    ({"penguin(pingu)"}, "bird(pingu)"),
    ({"bird(tweety)"}, "can_fly(tweety)"),
]

changed = True
while changed:
    changed = False
    for conditions, conclusion in rules:
        if conditions <= facts and conclusion not in facts:
            facts.add(conclusion)
            changed = True

print(sorted(facts))

Each pass checks every rule against the current facts and adds any new conclusion. The loop stops once a full pass adds nothing, which is called reaching a fixed point.

Choosing a Technique for Your Problem

TechniqueStrengthWeaknessTypical use
Predicate logicPrecise, provable conclusionsStruggles with exceptions and uncertaintyFormal verification, theorem proving
Semantic networkVisual and intuitiveLink meanings can be vagueConcept maps, early knowledge graphs
FramesDefaults and inheritanceWeak at complex reasoningObject-like domain models
Production rulesEasy for experts to writeRule conflicts grow with sizeExpert systems, business rule engines
OntologiesShared, machine-readable vocabularyEffort to design and maintainHealthcare, search, data integration

A good representation is usually judged on four qualities: representational adequacy (can it express what you need?), inferential adequacy (can it derive new knowledge?), inferential efficiency (can it do so quickly?) and acquisitional efficiency (how easily can new knowledge be added?).

Modern systems often blend approaches. A knowledge graph may store facts as subject-predicate-object triples, while a machine learning model supplies learned patterns, and the graph keeps answers grounded in checked facts.

Design mistakes to avoid

  • Mixing up "is-a" (a class relationship) with "instance-of" (a specific individual).
  • Writing rules without a plan for conflicts when two of them fire together.
  • Treating missing knowledge as false when the domain really needs "unknown".

Ready to master Artificial Intelligence?

Build real-world AI skills with hands-on projects and mentor-guided training.

Explore Course