Expert Systems and Knowledge Representation

Guide to AI and Data Courses · Part II: Branches of AI
Knowledge representationRule baseInference engineOntologiesKnowledge acquisitionNeighboring courses
Sercan KÜLCÜ · Giresun University · Computer Engineering

Introduction

What Question Does It Ask?

How is an expert's knowledge written down and used for inference?

An expert system writes a domain expert's knowledge into a knowledge base of rules and facts and draws conclusions from it with an inference engine. Knowledge representation studies how to encode knowledge so that a computer can reason with it: logic, frames, semantic networks and ontologies.

At a glance

Approach

symbolic logic and rules

Input

facts and expert rules

Output

conclusion with justification

Success measure

expert agreement, explainability

Math load

low: propositional and predicate logic

Data needs

little; a knowledge base

Introduction

A Short History

1965

DENDRAL starts at Stanford: the first expert system, inferring molecular structure from mass spectra.

1972

Colmerauer and Roussel develop Prolog: logic programming is born.

1970s

MYCIN recommends antibiotics for blood infections, adding certainty factors to its rules.

1980

R1 (XCON) starts configuring computer orders at DEC: the first big commercial success.

1984

Lenat launches Cyc, aiming to hand-code common-sense knowledge.

2012

Google announces the Knowledge Graph; knowledge graphs spread in search.

The Course

Core Concepts

Knowledge base

Domain facts and IF-THEN rules.

Inference engine

Applies rules to facts to derive new conclusions.

Forward chaining

Start from facts and derive every reachable conclusion.

Backward chaining

Start from a goal and look for facts that support it.

Explanation facility

Shows which rules led to a conclusion.

Frames and networks

Representing objects with slots and relations.

Ontology

A domain's concepts, classes and relations: OWL.

Knowledge acquisition

Eliciting knowledge from experts; the bottleneck.

The Course

A Typical Workflow

InterviewexpertacquisitionEncoderules,ontologyCollectfactsuseranswersInferforward orbackwardExplainresult andreasons
Example: A fault diagnosis system turns technicians' experience into rules such as "if the engine won't start and battery voltage is low, replace the battery". It asks the user about symptoms, chains the rules to find the fault and shows step by step which rules it used.

The Course

What Does the Course Cover?

  1. The knowledge representation and reasoning problem
  2. Propositional and first-order logic; resolution
  3. Logic programming: Prolog
  4. Rule-based systems; forward and backward chaining
  5. The Rete algorithm and rule engines: CLIPS, Drools
  6. Frames, semantic networks and inheritance
  7. Description logics
  8. Ontologies: RDF, OWL and Protégé
  9. Knowledge graphs and SPARQL queries
  10. Uncertainty: certainty factors, default reasoning
  11. Knowledge acquisition and expert interviews
  12. Explanation, verification and knowledge base upkeep

Skills you will gain

writing rules in CLIPS or Droolslogic programming in Prologbuilding ontologies in Protégéquerying knowledge graphs with SPARQLeliciting expert knowledge as rules

A typical semester; the order and coverage vary between universities.

Try It

Why Won't the Car Start?

A mechanic's knowledge was written as nine IF–THEN rules. Click the symptoms on the left to mark them; the system fires rules one by one by forward chaining, reaches a diagnosis and explains why.

Knowledge lives in a rule base separate from the code; the inference engine chains the rules. When the mechanic adds a rule, the program does not change, and the system can explain which rules produced each decision.

Context

Prerequisites

Courses worth knowing before this one, and why they are needed.

CourseWhy it is needed
Artificial Intelligencesymbolic AI, logic and rules
Discrete Mathematicspropositional and predicate logic, inference rules
Data Structurestrees, graphs and hash tables: storing rules and facts
Object Oriented Programming with Javaclasses and inheritance: a bridge to frames and Drools

Context

Are You Ready for This Course?

Ask yourself; for every "no", the right-hand column shows where to start.

Ask yourselfIf not, start with
Can you write a sentence such as "all humans are mortal" in first-order logic?Propositional and predicate logic from discrete mathematics
Can you run depth-first and breadth-first search on an example?Artificial Intelligence
Can you use a hash map and a graph in a program?Hash tables and graphs from a data structures course
Can you explain classes, objects and inheritance with an example?An intro to object-oriented programming in Java
If you can say "yes" to most of these, you are ready; one or two gaps can be closed during the semester.

Context

Neighbouring Courses

subfieldbuilds onshares methodsapplication

Overlap

Overlapping Courses

RelationCourseShared ground
subfieldThis course is a subfield of Artificial Intelligencesymbolic AI, logic and rules
shares methodsShares methods with Fuzzy Logic and Fuzzy SystemsIF-THEN rule base, inference engine
shares methodsShares methods with Probabilistic Graphical Modelsinference under uncertainty
shares methodsShares methods with Explainable AI and AI Ethicsexplainable decisions through readable rules

Differences

Where It Differs (1/2)

CriterionExpert SystemsMachine LearningFuzzy Logic
Core questionHow is an expert's knowledge written down and used for inference?How does a program generalize from examples?How do we reason with concepts like "hot" or "fast" that have no sharp boundary?
Approachsymbolic logic and rulesstatistical learningpartial membership and linguistic rules
Inputfacts and expert ruleslabeled or unlabeled examplesmeasurements, expert rules
Outputconclusion with justificationa model that makes predictionscontrol signal or decision
Success measureexpert agreement, explainabilityerror on unseen datacontrol quality, expert agreement
Math loadlow: propositional and predicate logichigh: linear algebra, probability, optimizationlow-medium: set theory
Data needslittle; a knowledge basemoderate to largelittle; expert knowledge
  • Machine Learning: ML learns knowledge from examples and often gives no reasons; an expert system takes knowledge from experts and explains its result with rules.
  • Fuzzy Logic: Fuzzy logic lets rules be partly true; this course teaches representing knowledge and chaining rules in general.

Differences

Where It Differs (2/2)

CriterionExpert SystemsGraphical ModelsExplainable AI & Ethics
Core questionHow is an expert's knowledge written down and used for inference?How do we model and query many interdependent, uncertain variables?When can we trust an AI system's decision, and who is responsible for the outcome?
Approachsymbolic logic and rulesprobability and graphs combinedhuman-centered evaluation
Inputfacts and expert rulesvariables, dependencies, datamodel, its data and context of use
Outputconclusion with justificationconditional probability, best explanationexplanation, audit report, principles
Success measureexpert agreement, explainabilitylikelihood, inference accuracyinterpretability, fairness, accountability
Math loadlow: propositional and predicate logichigh: probabilitylow-medium
Data needslittle; a knowledge basemoderatethe model's own data
  • Graphical Models: PGMs model uncertainty consistently with probability distributions; expert systems mostly write knowledge as crisp rules.
  • Explainable AI & Ethics: XAI seeks explanations for learned models after the fact; an expert system explains itself because it is built from readable rules.

Practice

Applications

Clinical decision support

Diagnosis and treatment advice from symptoms and tests.

Fault diagnosis

Finding machine, vehicle and network problems.

Product configuration

Building orders from compatible parts.

Business rules

Loan approval, insurance and compliance checks.

Knowledge graphs

Entity and relation data in search engines.

Semantic web

Linking data through ontologies.

Practice

Risks and Ethics

Bias written into rules

An expert's habits and an institution's old practices become rules; credit or insurance rules can quietly exclude some groups.

Rule conflicts and upkeep

Thousands of rules can shadow and contradict each other; in large systems such as XCON, maintaining the rules became a burden of its own.

Unclear responsibility

After a wrong diagnosis or a rejected application, it is unclear whether the fault lies with the expert, the knowledge engineer or the user.

Errors in knowledge bases

Wrong or outdated facts in open knowledge bases spread to the search and chat systems built on them.

In depth: Explainable AI and AI Ethics.

Practice

Tools and Datasets

Tools and libraries

CLIPSDroolsSWI-PrologProtégéApache JenaNeo4j

Well-known knowledge bases

WikidataDBpediaWordNetGene OntologySNOMED CTProtégé Pizza ontology

Practice

Common Misconceptions

Common beliefIn fact
Expert systems were a 1980s fad.Under new names, business rule engines and knowledge graphs are used today in banking, healthcare and search.
An expert system knows as much as the expert.It knows only what was encoded; it fails quickly outside its domain or when common sense is needed.
Writing the rules is easy.Much expert knowledge is tacit; turning it into rules (knowledge acquisition) is the hardest and costliest step.
Large language models made knowledge representation obsolete.Language models can produce false facts; they are paired with knowledge graphs for verifiable results.

Next Steps

After This Course

Courses that build on or extend this one

This course is mostly an end point: it builds on the others.

Related careers

Knowledge engineerOntology specialistDecision support systems developerBusiness rules analyst
This course is the gateway to symbolic AI. Next you can take Probabilistic Graphical Models to handle uncertainty consistently, Fuzzy Logic for partial truth, or Explainable AI and AI Ethics for explaining decisions and accountability.

Next Steps

Further Reading

  • Jackson, Introduction to Expert Systems, 3rd ed., Addison-Wesley, 1999.
  • Brachman and Levesque, Knowledge Representation and Reasoning, Morgan Kaufmann, 2004.
  • Giarratano and Riley, Expert Systems: Principles and Programming, 4th ed., Thomson Course Technology, 2005.
  • Buchanan and Shortliffe (eds.), Rule-Based Expert Systems: The MYCIN Experiments of the Stanford Heuristic Programming Project, Addison-Wesley, 1984.

The End

Chapter 11: Expert Systems and Knowledge Representation
← Previous chapter · Map of the field · Next chapter →
1 / 1 Sercan KÜLCÜ. All rights reserved.