Artificial Intelligence & Neural Networks β Expert System and Natural Language Processing, NEC licence examination syllabus (Nepal Engineering Council).
Expert Systems & Architecture
Capturing a specialist's knowledge in rules β the first commercially successful AI.
π Where this lives: expert systems are the part of AI that already went through a full commercial boom and bust, so their architecture is unusually well documented β and unusually well understood in its limits. The pattern survives everywhere: your tax software's rule engine, a bank's loan-eligibility checker, a hospital's drug-interaction warning system, the business-rules engines in insurance. They are not called expert systems any more, but the separation of a rule base from an inference engine is the same design. Search "business rules engine separation of rules from code".
What an expert system is
An EXPERT SYSTEM is a computer program that emulates the
DECISION-MAKING ABILITY of a human expert in a narrow domain,
reasoning from a body of knowledge represented mainly as
IF-THEN RULES.
THE DEFINING CHARACTERISTICS:
Β· expertise in a NARROW, well-bounded domain
Β· knowledge held EXPLICITLY and SEPARATELY from the program
logic
Β· reasoning under UNCERTAINTY, with a confidence attached to
conclusions
Β· the ability to EXPLAIN its reasoning
Β· performance at or near the level of a human specialist
THE CENTRAL ARCHITECTURAL IDEA, and the one that made these
systems possible: SEPARATE THE KNOWLEDGE FROM THE INFERENCE.
A conventional program mixes domain knowledge into its
control flow β the rules ARE the if-statements. Change a
rule and you edit and recompile code.
An expert system holds the rules as DATA, interpreted by a
general INFERENCE ENGINE. A domain expert can then add a
rule without a programmer, and the same engine serves any
domain.
THIS IS THE DECLARATIVE-OVER-PROCEDURAL ARGUMENT from the KR
section, realised as a product architecture β and it is why
"expert system shells" could be sold as generic tools.
HOW AN EXPERT SYSTEM DIFFERS FROM A CONVENTIONAL PROGRAM:
CONVENTIONAL PROGRAM EXPERT SYSTEM
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
knowledge embedded in code knowledge in a separate KB
algorithmic β a fixed heuristic β searches for a
procedure plausible conclusion
processes data processes knowledge
no explanation explains its reasoning
right or wrong degrees of confidence
changing logic means changing logic means editing
recompiling a rule
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
THE HISTORICAL LANDMARKS, from the AI history topic:
DENDRAL (1965β) inferring molecular structure from mass
spectrometry β the first successful knowledge-intensive
program, and the origin of the insight that DOMAIN
KNOWLEDGE BEATS CLEVER SEARCH
MYCIN (1972β) diagnosing bacterial blood infections,
performing at specialist level with about 450 rules, and
introducing CERTAINTY FACTORS for uncertainty
PROSPECTOR mineral exploration; famously identified a
molybdenum deposit
XCON / R1 (1980) configuring VAX computer orders at Digital;
grew to several thousand rules and reportedly saved tens
of millions of dollars a year β the commercial proof
The architecture
THE COMPONENTS of an expert system. This diagram and the
component list are the guaranteed exam question.
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER β
βββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββΌβββββββββββββββββββββββββββ
β USER INTERFACE β
β (questions, answers, explanations) β
βββββββββ¬βββββββββββββββββββββββββββββββ¬ββββββββββββ
β β
βββββββββΌββββββββββ βββββββββββΌββββββββββββ
β INFERENCE βββββββββββΆβ EXPLANATION β
β ENGINE β β FACILITY β
βββββ¬ββββββββββ¬ββββ βββββββββββββββββββββββ
β β
ββββββββΌββββ ββββΌβββββββββββββββ
β KNOWLEDGEβ β WORKING MEMORY β
β BASE β β (the facts of β
β (rules) β β this case) β
ββββββ²ββββββ βββββββββββββββββββ
β
ββββββ΄βββββββββββββββββββ ββββββββββββββββββββββββ
β KNOWLEDGE ACQUISITION βββββββ DOMAIN EXPERT + β
β SUBSYSTEM β β KNOWLEDGE ENGINEER β
βββββββββββββββββββββββββ ββββββββββββββββββββββββ
1. KNOWLEDGE BASE
The domain knowledge, usually as production rules:
IF the organism is gram-positive
AND the morphology is coccus
AND the growth is in chains
THEN the identity is streptococcus (CF 0.7)
Also holds facts and, in frame-based systems, taxonomies.
IT IS THE SYSTEM'S VALUE AND THE HARDEST PART TO BUILD.
2. WORKING MEMORY (also the fact base, or context)
The facts known about THE CURRENT CASE β this patient, this
order. Starts nearly empty, fills as the consultation
proceeds, and is discarded afterwards.
THE DISTINCTION FROM THE KNOWLEDGE BASE MATTERS: the KB is
general and permanent, working memory is specific and
transient.
3. INFERENCE ENGINE
The general reasoning mechanism. It repeatedly:
MATCH find rules whose premises are satisfied by
working memory
SELECT resolve conflicts when several rules match
EXECUTE apply the chosen rule, adding its conclusion
to working memory
β the RECOGNISE-ACT CYCLE. It supports FORWARD and
BACKWARD CHAINING (from the propositional logic topic) and
handles the propagation of certainty.
CONFLICT RESOLUTION STRATEGIES, when several rules match:
specificity β prefer the rule with more premises
recency β prefer the rule matching the newest fact
priority β an explicit ordering supplied by the author
refractoriness β do not fire the same rule on the same
facts twice, which prevents infinite loops
4. EXPLANATION FACILITY
Answers HOW and WHY:
WHY are you asking me this? β shows the rule
currently being pursued
HOW did you conclude that? β shows the chain of
rules that fired
THIS IS NOT A COSMETIC FEATURE. A doctor will not act on a
diagnosis they cannot check, so explanation was what made
MYCIN acceptable to clinicians at all β and it is the
property the AI applications topic identified as a
regulatory requirement for opaque models today.
5. KNOWLEDGE ACQUISITION SUBSYSTEM
Tools for entering and validating rules β an editor, a
consistency checker, sometimes a rule-induction tool. Its
inadequacy is the ACQUISITION BOTTLENECK that ended the
boom, and it gets its own topic next.
6. USER INTERFACE
Conducts the consultation, usually as a dialogue asking
only for the facts the current line of reasoning needs.
AN EXPERT SYSTEM SHELL is components 3, 4, 5 and 6 without a
knowledge base β a generic engine into which any domain's rules
can be loaded. EMYCIN was MYCIN with the medicine removed, and
it is the origin of the whole commercial tools industry.
Certainty factors, and the honest assessment
HANDLING UNCERTAINTY β MYCIN's CERTAINTY FACTOR approach, which
predates the probabilistic methods of the previous section and is
still what the syllabus expects.
A CERTAINTY FACTOR CF ranges from β1 to +1:
+1 known true
0 no evidence either way
β1 known false
It is defined from a MEASURE OF BELIEF MB and a MEASURE OF
DISBELIEF MD:
CF(h, e) = MB(h, e) β MD(h, e)
PROPAGATING CERTAINTY THROUGH ONE RULE:
CF(conclusion) = CF(premise) Γ CF(rule)
WORKED: a premise established with CF 0.8, by a rule of
strength 0.7:
CF(conclusion) = 0.8 Γ 0.7 = 0.56
CONFIDENCE ONLY EVER DECREASES ALONG A CHAIN, which is
intuitively right β conclusions drawn at three removes are
less certain than their evidence.
COMBINING TWO RULES THAT SUPPORT THE SAME CONCLUSION:
both positive: CF = CFβ + CFβ(1 β CFβ)
both negative: CF = CFβ + CFβ(1 + CFβ)
opposite signs: CF = (CFβ + CFβ) / (1 β min(|CFβ|, |CFβ|))
WORKED, two rules both concluding the same diagnosis:
CFβ = 0.6, CFβ = 0.4
CF = 0.6 + 0.4(1 β 0.6) = 0.6 + 0.16 = 0.76
Two moderately confident pieces of evidence combine to 0.76
β MORE than either alone but LESS than their sum, and the
result can never reach 1 from finitely many imperfect
pieces of evidence. That asymptotic behaviour is the point
of the formula.
ANOTHER: CFβ = 0.8, CFβ = 0.5
CF = 0.8 + 0.5(0.2) = 0.90
CONFLICTING EVIDENCE: CFβ = 0.7, CFβ = β0.3
CF = (0.7 β 0.3) / (1 β 0.3) = 0.4/0.7 = 0.5714
THE HONEST CRITICISM OF CERTAINTY FACTORS, which you should be
able to state: THEY ARE NOT PROBABILITIES AND HAVE NO
AXIOMATIC JUSTIFICATION. The combination formula assumes the
pieces of evidence are independent, does not distinguish
"no evidence" from "conflicting evidence that cancels", and
cannot represent explaining away β the intercausal reasoning
from the belief-networks topic. Probability theory does all of
this from three axioms, which is why the field moved to Bayesian
networks. CERTAINTY FACTORS WORKED WELL IN MYCIN BECAUSE THE
RULE SET WAS CAREFULLY HAND-TUNED, not because the arithmetic
was sound.
ADVANTAGES AND LIMITATIONS β the examinable lists:
ADVANTAGES
Β· expertise is PRESERVED β it does not retire or resign
Β· CONSISTENT: the same case gets the same answer every time,
where a tired human may not
Β· AVAILABLE everywhere at once, and cheaply replicable
Β· EXPLAINS its reasoning, so it can be checked and taught
from
Β· handles UNCERTAINTY explicitly
Β· can COMBINE the knowledge of several experts
LIMITATIONS
Β· NARROW: no common sense, and no awareness of the boundary
of its own competence. It will answer confidently outside
its domain.
Β· BRITTLE: performance degrades sharply rather than
gracefully at the edges of the rule set
Β· CANNOT LEARN from experience β every improvement is a
hand-edit
Β· the KNOWLEDGE ACQUISITION BOTTLENECK makes them expensive
to build and, decisively, expensive to KEEP CURRENT
Β· MAINTENANCE degrades: as a rule base passes a few hundred
rules, interactions between rules become impossible to
predict, and adding a rule can break behaviour nobody
thought was related
Β· no creativity, and no ability to reason about novel
situations
THOSE LAST THREE ARE WHAT ENDED THE COMMERCIAL BOOM, exactly as
the AI history topic recorded. The architecture was sound; what
failed was the economics of populating and maintaining the
knowledge base by hand.
The architectural idea worth carrying forward is the separation itself: knowledge as data, interpreted by a general engine. That is what allowed a domain expert to add a rule without a programmer, and what let one engine be sold into any domain β and it is the same reason modern systems keep business rules out of compiled code.
π Go further: the architecture never went away; it was renamed. Modern business rules engines β Drools, and the decision-table features in every insurance and banking platform β are production-rule systems with the same recognise-act cycle, the same conflict resolution, and the same argument that domain experts should edit rules without a deployment. The lesson the expert-system era taught, and which these tools now build in, is that a rule base needs the same discipline as code: version control, tests, and a review process. Rules as data does not mean rules without engineering. Search "Drools production rules RETE business rules management".
π‘ Exam angle: draw the expert system architecture and describe all six components β knowledge base, working memory, inference engine, explanation facility, knowledge acquisition subsystem, user interface; this is the most reliably asked question in the section. Be precise about the knowledge base versus working memory distinction (general and permanent versus case-specific and transient) and the recognise-act cycle with its conflict-resolution strategies. Define an expert system shell. Compare expert systems with conventional programs. Be ready to compute with certainty factors β the chain rule and both combination formulas β and to state why CFs are not probabilities. Give the advantages and limitations, naming the acquisition bottleneck and brittleness.
Syllabus points
Expert system components & architecture
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.
Related topics in Expert System and Natural Language Processing