MYCIN Expert System — Deep Dive (W4L1)
🎯 考试重要度
🟡 中频 — 但正式考试很可能出现 | 整个 W4L1 专门讲 MYCIN,CF 计算是极易出计算题的考点
MYCIN did not appear in some sample tests, but an entire lecture was devoted to it. Confidence Factor calculations are extremely testable as short numerical questions. Backward chaining reasoning is a favourite topic for “explain with an example” questions. S1 2025 Sample Q6 (3 marks) directly tests backward chaining for medical diagnosis.
📖 核心概念(Core Concepts)
| English Term | 中文 | One-line Definition |
|---|---|---|
| MYCIN | MYCIN 专家系统 | A rule-based expert system built by Ted Shortliffe at Stanford (1970s) to diagnose bacterial infections and recommend antibiotics |
| Production Rule(产生式规则) | 产生式规则 | An IF-THEN rule with a confidence factor: IF premises THEN conclusion WITH CF |
| Backward Chaining(后向链接) | 后向链接 / 目标驱动推理 | Goal-driven inference: start from a hypothesis and work backward to find supporting evidence |
| Forward Chaining(前向链接) | 前向链接 / 数据驱动推理 | Data-driven inference: start from known facts and fire rules to derive new conclusions (Modus Ponens) |
| Confidence Factor (CF)(置信因子) | 置信因子 | A numerical measure of certainty ranging from -1.0 (definitely false) to +1.0 (definitely true) |
| Knowledge Base (KB)(知识库) | 知识库 | The collection of 450+ IF-THEN production rules encoding medical expertise (persistent, long-term memory) |
| Dynamic Data / Working Memory(动态数据) | 工作记忆 | Current known facts about the patient being diagnosed (per-case, short-term) |
| Inference Engine(推理引擎) | 推理引擎 | The reasoning component that applies backward chaining over the rule base; contains MONITOR + FINDOUT |
| MONITOR(监控操作) | 监控 | Check if a fact is already present in working memory |
| FINDOUT(查询操作) | 查询 | Ask the user (clinician) to supply a missing piece of information |
| Consultation System(咨询系统) | 咨询子程序 | Subprogram 1: conducts the diagnostic dialogue with the clinician |
| Explanation System(解释系统) | 解释子程序 | Subprogram 2: handles WHY and HOW queries |
| Rule-Acquisition System(规则获取系统) | 规则获取子程序 | Subprogram 3: allows experts to add/modify rules in the knowledge base |
| WHY Query(WHY 查询) | WHY 查询 | User asks “Why are you asking me this?” — system reveals its current reasoning goal (backward chaining style) |
| HOW Query(HOW 查询) | HOW 查询 | User asks “How did you reach that conclusion?” — system shows the rule chain (forward chaining style) |
| E-MYCIN (Essential MYCIN) | 通用 MYCIN 外壳 | Domain-independent expert system shell — MYCIN with medical knowledge removed; the first expert system shell |
| Knowledge Acquisition Bottleneck(知识获取瓶颈) | 知识获取瓶颈 | The fundamental difficulty of extracting and encoding expert knowledge into rules |
| Modus Ponens(肯定前件式) | 肯定前件推理 | Logical rule: IF A is true AND A implies B, THEN B is true |
| LISP | LISP 语言 | The programming language MYCIN was implemented in; uses prefix notation |
🧠 费曼草稿(Feynman Draft)

The Junior Doctor with a Giant Manual
Imagine a brand-new doctor on their first day in the hospital. They have zero experience but someone hands them a thick manual – 450 pages of rules written by the best infectious disease specialist in the country. Each page says something like:
“IF the patient’s culture shows gram-negative organisms AND the organism has rod morphology AND the organism is anaerobic, THEN the organism is Bacteroides (I’m about 60% sure).”
The junior doctor doesn’t think creatively. They just follow the manual backwards: they start with a question (“What is causing this infection?”), look up which rules could answer it, then check whether they already know the required facts. If they don’t know something, they either look it up in the patient’s chart or ask the patient directly.
That’s MYCIN. It’s not intelligent in the human sense – it’s a systematic rule-follower with a clever strategy for deciding what to ask.
The Manual is Written in a Weird Language
MYCIN was built in LISP – a programming language where everything is written in prefix notation(前缀表示法)with lots of parentheses:
;; Instead of 2 + 3, you write:
(+ 2 3) ; → 5
;; Key LISP operations MYCIN uses:
(cons 'a '(b c)) ; → (a b c) -- prepend an element to a list
(list 'a 'b 'c) ; → (a b c) -- create a list
(setq x 5) ; → x is now 5 -- assign a value to a variable
(eval '(+ 2 3)) ; → 5 -- evaluate an expression
You don’t need to write LISP for the exam, but you should know MYCIN was implemented in LISP and understand prefix notation if given an example.
How Does the Junior Doctor Actually Work?
Let’s walk through a tiny example. Suppose MYCIN’s knowledge base has just three rules:
Rule 1: IF infection is primary-bacteremia
AND culture-site is sterile-site
THEN organism is E.coli (CF = 0.8)
Rule 2: IF organism is E.coli
THEN recommend drug Ampicillin (CF = 0.9)
Rule 3: IF infection is primary-bacteremia
AND patient-age > 60
THEN organism is Klebsiella (CF = 0.6)
Goal: “What drug should I recommend?”
Step 1 – MYCIN looks for rules whose THEN part mentions a drug recommendation. It finds Rule 2 (recommend Ampicillin if E.coli). But Rule 2 needs to know the organism. Is it E.coli? Unknown. So “organism is E.coli” becomes a sub-goal.
Step 2 – Now MYCIN searches for rules whose THEN part concludes about the organism. It finds Rule 1. Rule 1 needs two things: (a) infection type and (b) culture site. MYCIN checks working memory (MONITOR). If unknown, it asks the clinician (FINDOUT): “What is the infection type?” The doctor answers: “primary-bacteremia (CF = 1.0).” “What is the culture site?” Answer: “sterile-site (CF = 0.9).”
Step 3 – Now Rule 1 can fire:
- CF(premise) = min(1.0, 0.9) = 0.9 (because AND takes the minimum)
- CF(E.coli) = 0.9 x 0.8 = 0.72
Step 4 – Rule 2 can now fire:
- CF(Ampicillin) = 0.72 x 0.9 = 0.648
MYCIN would report: “I recommend Ampicillin with confidence 0.648.”
This is backward chaining – we started from the goal and worked backwards through the rule chain, only asking questions that were actually needed.
When Does MYCIN Give Up?
MYCIN is smart about not wasting time. It abandons a hypothesis when CF drops below 0.2. Here’s a concrete example of CF propagation down a chain:
Starting hypothesis CF = 0.5
→ Apply Rule (CF_rule = 0.6):
CF(condition1) = 0.5 x 0.6 = 0.30 (still above 0.2, keep going)
→ Apply next Rule (CF_rule = 0.6):
CF(condition2) = 0.30 x 0.6 = 0.18 (below 0.2 → ABANDON this path!)
This is efficient: rather than chasing every possible chain of reasoning, MYCIN prunes away paths where confidence has become too low to be useful.
What if Two Rules Support the Same Conclusion?
Suppose Rule 1 gives CF(E.coli) = 0.72 and another Rule 4 also concludes E.coli with CF = 0.5. We combine them:
$$CF_{combined} = 0.72 + 0.5 \times (1 - 0.72) = 0.72 + 0.14 = 0.86$$
Two independent pieces of evidence reinforce each other. Notice the combined CF is higher than either alone, but never reaches 1.0 from two uncertain pieces – that makes intuitive sense!
⚠️ Common Misconception 1: Students often multiply CFs when combining multiple rules for the same conclusion. That’s WRONG. Multiplication is for chaining rules in sequence (premise CF x rule CF). The special combination formula $CF_1 + CF_2(1 - CF_1)$ is for when two different rules both support the same conclusion.
⚠️ Common Misconception 2: Students confuse AND (take the minimum) with OR (take the maximum). Think of it this way – a chain is only as strong as its weakest link (AND = min), but you only need one good reason (OR = max).
⚠️ Common Misconception 3: “IF A THEN B” does NOT mean A is the only cause of B. Multiple rules can conclude B from different premises. Backward chaining identifies possible necessary conditions, not unique ones.
💡 Core Intuition: MYCIN is a backward-chaining rule system that asks only necessary questions, propagates uncertainty through confidence factors, and abandons low-confidence paths early.
📐 正式定义(Formal Definition)
MYCIN Architecture – Three Subprograms
┌─────────────────────────────────────────────────────────────────┐
│ MYCIN System │
│ │
│ ┌──────────────────────┐ ┌───────────────────────────────┐ │
│ │ Knowledge Base │ │ Dynamic Data │ │
│ │ (Persistent, │ │ (Working Memory, │ │
│ │ Long-term Memory) │ │ Per-case, Short-term) │ │
│ │ 450+ IF-THEN rules │ │ Patient facts gathered │ │
│ │ with CF values │ │ during this consultation │ │
│ └──────────┬────────────┘ └──────────────┬────────────────┘ │
│ │ │ │
│ ┌──────────┴────────────────────────────────┴────────────────┐ │
│ │ Inference Engine (MONITOR + FINDOUT) │ │
│ │ Backward Chaining Controller │ │
│ │ Abandons paths when CF < 0.2 │ │
│ └──────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────┴─────────────────────────────────────┐ │
│ │ │ │
│ │ Subprogram 1: Subprogram 2: │ │
│ │ CONSULTATION SYSTEM EXPLANATION SYSTEM │ │
│ │ (Conducts the (Handles WHY and HOW │ │
│ │ diagnostic dialogue) queries from clinician) │ │
│ │ │ │
│ │ Subprogram 3: │ │
│ │ RULE-ACQUISITION SYSTEM │ │
│ │ (Allows experts to add/modify rules in KB) │ │
│ │ │ │
│ └────────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ User Interface (CLI) │ │
│ │ Clinician answers questions, asks WHY/HOW, │ │
│ │ receives diagnosis and treatment recommendation │ │
│ └────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Key architectural insight: The separation of Knowledge Base from Inference Engine is what enabled E-MYCIN – remove the medical rules and you get a reusable shell.
Production Rule Format
IF [condition₁] AND [condition₂] AND ...
THEN [conclusion] WITH CF [confidence_factor]
Concrete example from lecture:
IF the gram stain of the organism is gram-negative (condition 1)
AND the morphology of the organism is rod (condition 2)
AND the aerobicity of the organism is anaerobic (condition 3)
THEN the identity of the organism is Bacteroides (CF = 0.6)
CF calculation for this rule:
$$CF(\text{conclusion}) = CF(\text{premise}) \times CF(\text{rule})$$
$$CF(\text{premise}) = \min(CF(\text{gram-negative}),; CF(\text{rod}),; CF(\text{anaerobic}))$$
Confidence Factor (CF) Formulas
Range: $CF \in [-1.0, +1.0]$
| Value | Meaning |
|---|---|
| $+1.0$ | Definitely true |
| $+0.7$ | Fairly confident |
| $0.0$ | No information (unknown) |
| $-0.7$ | Fairly confident it’s false |
| $-1.0$ | Definitely false |
Formula 1 – Conjunction (AND) of premises:
$$CF(A \text{ AND } B) = \min(CF_A, ; CF_B)$$
Intuition: a chain is only as strong as its weakest link.
Formula 2 – Disjunction (OR) of premises:
$$CF(A \text{ OR } B) = \max(CF_A, ; CF_B)$$
Intuition: you only need one good reason to believe.
Formula 3 – Rule application (premise → conclusion):
$$CF(\text{conclusion}) = CF(\text{premise}) \times CF(\text{rule})$$
Intuition: uncertainty compounds when you reason through a rule.
Formula 4 – Combining multiple rules for the same conclusion (both positive):
$$CF_{combined} = CF_1 + CF_2 \times (1 - CF_1)$$
Intuition: independent evidence reinforces belief, but with diminishing returns.
Formula 4b – Both negative:
$$CF_{combined} = CF_1 + CF_2 \times (1 + CF_1)$$
Formula 4c – One positive, one negative:
$$CF_{combined} = \frac{CF_1 + CF_2}{1 - \min(|CF_1|, |CF_2|)}$$
For the exam, the “both positive” case (Formula 4) is by far the most commonly tested.
🔄 机制与推导(How It Works)
Forward Chaining vs Backward Chaining – Formal Definitions
Forward Chaining (Data-Driven, A → B)
- Starts from known facts in working memory
- Applies all matching rules to derive new conclusions
- Uses Modus Ponens: IF A is true AND (A → B), THEN B is true
- Direction: facts → conclusions
- Example: “Patient has fever and cough → apply matching rules → conclude possible flu”
Backward Chaining (Goal-Driven, B → A)
- Starts from a hypothesis or goal
- Finds rules whose conclusion matches the goal
- Checks if premises are supported; if not, makes them sub-goals or asks the user
- Direction: hypothesis → required evidence
Critical Logical Distinction (Exam-Critical!)
IF A THEN B means:
- A is SUFFICIENT for B (A being true is enough to conclude B)
- B is NECESSARY for A (if B is false, A cannot lead to B)
IMPORTANT: IF A THEN B does NOT mean:
- A is the ONLY cause of B (other rules may also conclude B!)
- B implies A (that would be the converse fallacy)
Backward chaining implication:
- When working backward from B, we find A as a POSSIBLE condition
- A is a possible necessary condition, but NOT necessarily the unique one
- Multiple rules can have B as their conclusion
Example: Rule 1 says “IF flu THEN fever.” Rule 2 says “IF meningitis THEN fever.” Starting from “fever” and working backward, we find BOTH flu and meningitis as possible causes – backward chaining identifies possible necessary conditions, not unique ones.
Backward Chaining in MYCIN – Step by Step
GOAL: Determine the identity of the organism
Step 1: Find rules whose THEN mentions "organism identity"
→ Rule 1, Rule 3 are candidates
→ Start with the HIGHEST-CONFIDENCE goal
Step 2: Try Rule 1:
IF infection = primary-bacteremia [Unknown → FINDOUT]
AND site = sterile-site [Unknown → FINDOUT]
THEN organism = E.coli (CF=0.8)
Step 3: FINDOUT "infection type" → Clinician answers:
"primary-bacteremia" (CF = 1.0) → store in Working Memory
Step 4: FINDOUT "culture site" → Clinician answers:
"sterile-site" (CF = 0.9) → store in Working Memory
Step 5: Rule 1 fires:
CF(premise) = min(1.0, 0.9) = 0.9
CF(E.coli) = 0.9 × 0.8 = 0.72
Step 6: Try Rule 3:
IF infection = primary-bacteremia [MONITOR: already known, CF=1.0]
AND patient-age > 60 [Unknown → FINDOUT]
THEN organism = Klebsiella (CF=0.6)
Step 7: FINDOUT "patient age" → Clinician answers:
"age = 72" (CF = 1.0)
Step 8: Rule 3 fires:
CF(premise) = min(1.0, 1.0) = 1.0
CF(Klebsiella) = 1.0 × 0.6 = 0.6
Result: E.coli (CF=0.72) vs Klebsiella (CF=0.6)
→ Most likely: E.coli
Notice how MYCIN only asked three questions (infection type, culture site, patient age) – it didn’t ask about every possible fact. That’s the efficiency of backward chaining: ask only what you need.
CF Abandonment Threshold (CF < 0.2)
MYCIN does not chase every hypothesis indefinitely. When a chain of reasoning produces a CF below 0.2, the system abandons that path:
Example: Investigating whether organism X causes the infection
Step 1: Start with hypothesis CF = 0.5
Step 2: Apply Rule (CF_rule = 0.6):
CF(condition1) = 0.5 × 0.6 = 0.30 ← still ≥ 0.2, continue
Step 3: Apply next Rule (CF_rule = 0.6):
CF(condition2) = 0.30 × 0.6 = 0.18 ← below 0.2, ABANDON!
The system stops pursuing this line of reasoning because
the accumulated confidence is too low to be useful.
This prevents wasting time on weak hypotheses and focuses the system on the most promising diagnoses.
MONITOR vs FINDOUT – Three-Step Priority
Evaluate premise P:
1. MONITOR: Is P already in Working Memory?
→ YES: use it (with its associated CF)
→ NO: go to step 2
2. Are there rules whose conclusion matches P?
→ YES: set P as a sub-goal, recurse (backward chain again)
→ NO: go to step 3
3. FINDOUT: Ask the user directly
→ Store answer in Working Memory for future MONITOR calls
This three-step priority is crucial: MYCIN avoids redundant questions by always checking memory first.
CF Calculation – Full Worked Example
Scenario: Diagnosing measles with two supporting rules.
Rule A: IF fever(CF=0.8) AND rash(CF=0.6)
THEN measles (CF_rule = 0.7)
Rule B: IF recent-contact-with-measles-patient(CF=0.9)
THEN measles (CF_rule = 0.5)
Step 1 – Rule A fires:
$$CF_A(\text{premise}) = \min(0.8, 0.6) = 0.6$$
$$CF_A(\text{measles}) = 0.6 \times 0.7 = 0.42$$
Step 2 – Rule B fires:
$$CF_B(\text{premise}) = 0.9$$
$$CF_B(\text{measles}) = 0.9 \times 0.5 = 0.45$$
Step 3 – Combine Rule A and Rule B (both positive):
$$CF_{combined} = CF_A + CF_B \times (1 - CF_A)$$ $$CF_{combined} = 0.42 + 0.45 \times (1 - 0.42)$$ $$CF_{combined} = 0.42 + 0.45 \times 0.58$$ $$CF_{combined} = 0.42 + 0.261 = 0.681$$
Result: measles with CF = 0.681
Key insight: neither rule alone gives high confidence (0.42 and 0.45), but together they push it to 0.681. Independent evidence accumulates, but never blindly – the formula ensures we can’t exceed 1.0.
Three More Rules – Extended Example
What if a third rule also supports measles with CF = 0.3?
$$CF_{new} = 0.681 + 0.3 \times (1 - 0.681) = 0.681 + 0.3 \times 0.319 = 0.681 + 0.0957 = 0.777$$
Each additional piece of evidence adds less and less – diminishing returns, just like in real life.
Explanation Facility
WHY Query (backward chaining style – “why are you asking this?”):
Clinician: WHY?
MYCIN: I am trying to determine whether the patient has measles.
Rule A states:
IF the patient has fever
AND the patient has a rash
THEN there is evidence (CF=0.7) that the diagnosis is measles.
I already know the patient has fever (CF=0.8).
I need to know about rash to evaluate this rule.
The WHY query reveals the current backward chaining goal – it shows which rule MYCIN is trying to evaluate and why it needs the requested information.
HOW Query (forward chaining style – “how did you conclude that?”):
Clinician: HOW measles?
MYCIN: I used Rule A and Rule B.
Rule A concluded measles (CF=0.42) based on:
- fever (CF=0.8) [told by clinician]
- rash (CF=0.6) [told by clinician]
Rule B concluded measles (CF=0.45) based on:
- recent contact with measles patient (CF=0.9) [told by clinician]
Combined CF = 0.681
The HOW query traces the forward chain of reasoning that led to the conclusion – it shows which rules fired and what evidence was used.
This transparency is a major advantage of rule-based systems over modern neural networks.
⚖️ 权衡分析(Trade-offs & Comparisons)
Forward Chaining vs Backward Chaining
| Aspect | Forward Chaining(前向链接) | Backward Chaining(后向链接) |
|---|---|---|
| Direction | Facts → Conclusions (A → B) | Goal → Required Evidence (B → A) |
| Logical basis | Modus Ponens | Hypothesis testing |
| Analogy | A scientist observing data and forming theories | A detective testing a hypothesis |
| Starting point | Known facts in working memory | A specific goal or hypothesis |
| Question strategy | Doesn’t ask questions – uses what’s available | Asks targeted questions to fill gaps |
| Efficiency | May explore many irrelevant rules | Focused – only explores rules relevant to the goal |
| Best for | Monitoring, alerting, configuration | Diagnosis, planning, troubleshooting |
| MYCIN uses | No (not primary) | Yes (primary inference method) |
| Sufficiency | A is SUFFICIENT for B | B is NECESSARY for A |
| Risk | Combinatorial explosion of derived facts | Deep recursion if rule chains are long |
A is SUFFICIENT for B vs B is NECESSARY for A
Rule: IF A THEN B
Forward (A → B):
"If I have A, that is SUFFICIENT to conclude B."
"A is enough. Having A guarantees B."
Backward (B → A):
"If I want B, then A is a NECESSARY condition."
"I need A (among possibly other things) to get B."
BUT: A is NOT the ONLY way to get B!
Other rules may also conclude B from different premises.
Backward chaining finds POSSIBLE necessary conditions.
Expert Systems vs Modern Machine Learning
| Feature | Expert System (MYCIN) | Machine Learning (e.g., Neural Network) |
|---|---|---|
| Knowledge source | Human experts (manual encoding) | Data (automated learning) |
| Knowledge form | Explicit IF-THEN rules | Implicit weights in a model |
| Explainability | High – can trace every rule (WHY/HOW) | Low – often a “black box” |
| Learning | None – rules are fixed | Yes – improves with more data |
| Handling uncertainty | Confidence Factors (handcrafted) | Probabilistic outputs (learned) |
| Coverage | Only what rules cover (brittle) | Can generalise to unseen cases |
| Domain transfer | E-MYCIN shell (but needs new rules) | Transfer learning, fine-tuning |
| Maintenance | Hard – manually update rules | Retrain on new data |
| Data requirement | Needs experts, not data | Needs large datasets, not experts |
MYCIN vs Bayesian Networks
| Feature | MYCIN (CF) | Bayesian Network |
|---|---|---|
| Theoretical basis | Ad hoc (not formally probabilistic) | Probability theory (rigorous) |
| Independence assumption | Rules are somewhat independent | Models dependencies explicitly |
| Combination formula | $CF_1 + CF_2(1 - CF_1)$ | Bayes’ theorem with priors |
| Ease of use | Simple for experts to assign CFs | Requires conditional probabilities |
| Accuracy | Good enough in practice | Theoretically more sound |
🏗️ 设计题答题框架
If asked: “Explain backward chaining for medical diagnosis” (S1 2025 Sample Q6 style)
WHAT: “Backward chaining is a goal-driven reasoning strategy used in expert systems like MYCIN. It starts with a hypothesis (e.g., a possible diagnosis) and works backward through the rule base to find supporting evidence in the patient’s symptoms.”
WHY: “Backward chaining is more efficient than forward chaining for diagnosis because it only asks the clinician for information that is actually needed to evaluate relevant rules, rather than gathering all possible data first.”
HOW: “The inference engine sets a top-level goal (e.g., ‘what is the diagnosis?’). It finds rules whose THEN part matches the goal. For each rule, it checks whether the IF conditions are known (MONITOR). If not, conditions become sub-goals, recursively applying the same process. If no rule can derive a fact, the system uses FINDOUT to ask the clinician. The system starts with the highest-confidence goal and abandons paths when CF drops below 0.2.”
TRADE-OFF: “The advantage is efficiency and transparency (the WHY/HOW facility lets clinicians understand the reasoning). The limitation is the knowledge acquisition bottleneck – all 450+ rules had to be manually encoded by interviewing domain experts.”
EXAMPLE: “To determine the organism: MYCIN finds Rule 1 (IF infection=bacteremia AND site=sterile THEN E.coli CF=0.8). It asks for infection type and culture site, then computes CF(E.coli) = min(1.0, 0.9) x 0.8 = 0.72.”
If asked: “Calculate the combined CF” (computation question)
Step 1: For each rule, compute CF(premise) using AND = min, OR = max.
Step 2: Compute CF(conclusion) = CF(premise) x CF(rule) for each rule.
Step 3: If multiple rules support the same conclusion, combine: $CF_{combined} = CF_1 + CF_2(1 - CF_1)$.
Step 4: State the final CF value and interpret it (e.g., “moderately confident”).
If asked: “What is E-MYCIN and why is it significant?”
WHAT: “E-MYCIN (Essential MYCIN) is the first domain-independent expert system shell, created by removing MYCIN’s medical knowledge base while retaining the inference engine, explanation facility, and user interface.”
WHY: “It demonstrated that the reasoning architecture could be separated from domain knowledge, making it reusable across fields.”
HOW: “To build a new expert system, developers load a new knowledge base into the E-MYCIN shell. The backward chaining engine, CF propagation, and WHY/HOW facilities work unchanged.”
EXAMPLE: “E-MYCIN was used to build SACON (structural engineering analysis) and PUFF (pulmonary function diagnosis) – different domains, same inference engine.”
LIMITATION: “While the shell is reusable, encoding new domain knowledge still requires extensive expert interviews – the knowledge acquisition bottleneck remains.”
📝 历年真题与考试练习(Exam Questions & Practice)
S1 2025 Sample Q6 (3 marks) – Backward Chaining for Medical Diagnosis
Question: Explain how backward chaining works for medical diagnosis. Use the following scenario: A patient has a runny nose. Possible diagnoses include common cold, allergies, and measles.
Click to reveal model answer
Backward chaining is goal-driven reasoning. We start with hypotheses (possible diagnoses) and work backward to find supporting evidence in the patient’s symptoms.
Step 1 – List hypotheses to test:
- Hypothesis 1: Common Cold
- Hypothesis 2: Allergies
- Hypothesis 3: Measles
Step 2 – Test each hypothesis by checking required symptoms:
Support “Common Cold”:
- Rule: IF runny nose AND sore throat AND mild fever THEN common cold (CF=0.7)
- Runny nose? YES (given) ✓
- Sore throat? Need to check → FINDOUT
- Mild fever? Need to check → FINDOUT
Support “Allergies”:
- Rule: IF runny nose AND history of allergies AND itchy eyes THEN allergies (CF=0.6)
- Runny nose? YES (given) ✓
- History of allergies? Need to check → FINDOUT
- Itchy eyes? Need to check → FINDOUT
Support “Measles”:
- Rule: IF runny nose AND distinctive rash AND high fever THEN measles (CF=0.8)
- Runny nose? YES (given) ✓
- Distinctive rash? Need to check → FINDOUT
- High fever? Need to check → FINDOUT
Step 3 – System asks targeted questions based on which hypotheses it is testing. It does NOT ask about every possible symptom – only those needed to evaluate the current rules.
Step 4 – Calculate CFs for each hypothesis based on evidence gathered, and report the diagnosis with the highest combined CF.
Key points for marks:
- Start from hypothesis, not from data (1 mark)
- Only ask questions needed to evaluate relevant rules (1 mark)
- Show specific example of checking symptoms against rules (1 mark)
Practice Question 1 – CF Calculation (8 marks)
Consider the following MYCIN rules:
Rule 1: IF patient-has-fever (CF=0.9)
AND patient-has-stiff-neck (CF=0.7)
THEN diagnosis is meningitis (CF_rule = 0.8)
Rule 2: IF patient-has-fever (CF=0.9)
AND cerebrospinal-fluid-is-cloudy (CF=0.85)
THEN diagnosis is meningitis (CF_rule = 0.75)
(a) Calculate the CF for meningitis from Rule 1 alone. (3 marks)
(b) Calculate the CF for meningitis from Rule 2 alone. (3 marks)
(c) Calculate the combined CF for meningitis using both rules. (2 marks)
Click to reveal answer
(a) Rule 1:
$$CF_1(\text{premise}) = \min(0.9, 0.7) = 0.7$$ $$CF_1(\text{meningitis}) = 0.7 \times 0.8 = 0.56$$
(b) Rule 2:
$$CF_2(\text{premise}) = \min(0.9, 0.85) = 0.85$$ $$CF_2(\text{meningitis}) = 0.85 \times 0.75 = 0.6375$$
(c) Combined:
$$CF_{combined} = 0.56 + 0.6375 \times (1 - 0.56)$$ $$= 0.56 + 0.6375 \times 0.44$$ $$= 0.56 + 0.2805$$ $$= 0.8405$$
Interpretation: MYCIN would be fairly confident (CF approximately 0.84) that the diagnosis is meningitis.
Practice Question 2 – Forward vs Backward Chaining (6 marks)
Explain the difference between forward chaining and backward chaining in expert systems. Which does MYCIN use and why? Illustrate with a medical diagnosis example.
Click to reveal answer framework
Forward Chaining (2 marks):
- Data-driven: starts with known facts in working memory
- Applies all matching rules to derive new facts via Modus Ponens (IF A is true AND A→B, THEN B)
- Continues until a goal is reached or no more rules fire
- A is sufficient for B
- Example: “Patient has fever and cough → apply rules → conclude possible flu”
Backward Chaining (2 marks):
- Goal-driven: starts with a hypothesis or goal
- Finds rules whose conclusion matches the goal
- Checks if premises are known; if not, creates sub-goals or asks the user
- B is necessary for A (but NOT the only cause!)
- Example: “Is the patient’s infection caused by E.coli? → What evidence do I need? → Ask for infection type and culture site”
Why MYCIN uses backward chaining (2 marks):
- Medical diagnosis is naturally hypothesis-driven
- More efficient: only asks the clinician for information relevant to the current hypothesis
- Avoids gathering unnecessary data (forward chaining might explore hundreds of irrelevant rules)
- Supports the WHY explanation: “I am asking about X because I am trying to determine Y”
- Can abandon low-confidence paths early (CF < 0.2 threshold)
Practice Question 3 – MYCIN Architecture (5 marks)
Draw and label the main components of the MYCIN expert system. Explain the role of each component.
Click to reveal answer framework
Components to include:
- Knowledge Base (KB) – 450+ production rules encoding medical expertise (IF-THEN with CF values). This is persistent, long-term memory.
- Dynamic Data / Working Memory – Stores currently known facts about the patient being diagnosed. Per-case, short-term.
- Inference Engine – Applies backward chaining; uses MONITOR (check memory) and FINDOUT (ask user). Starts with highest-confidence goal, abandons when CF < 0.2.
- Three Subprograms:
- Subprogram 1: Consultation System – conducts the diagnostic dialogue
- Subprogram 2: Explanation System – handles WHY queries (backward style) and HOW queries (forward style)
- Subprogram 3: Rule-Acquisition System – allows experts to add/modify rules
- User Interface – Clinician interacts via Q&A; provides data and can query the system
Key point: The separation of Knowledge Base from Inference Engine enabled E-MYCIN – the first expert system shell. Remove the medical rules and the inference engine can be reused for other domains.
Practice Question 4 – Tracing a Backward Chain (7 marks)
Given the following rules:
Rule 1: IF A AND B THEN C (CF=0.9)
Rule 2: IF C AND D THEN E (CF=0.8)
Rule 3: IF A AND F THEN C (CF=0.7)
Facts in working memory: A (CF=1.0), B (CF=0.8), D (CF=0.7), F (CF=0.6)
Goal: Determine E.
(a) Trace the backward chaining process. (3 marks)
(b) Calculate the final CF of E, accounting for Rules 1 and 3 both concluding C. (4 marks)
Click to reveal answer
(a) Backward chaining trace:
- Goal = E. Find rules with E in conclusion → Rule 2: IF C AND D THEN E
- Check C: Unknown → sub-goal. Check D: Known (CF=0.7) via MONITOR.
- Sub-goal = C. Find rules with C in conclusion → Rule 1 and Rule 3.
- Rule 1: Need A (known, CF=1.0) and B (known, CF=0.8). Both available via MONITOR.
- Rule 3: Need A (known, CF=1.0) and F (known, CF=0.6). Both available via MONITOR.
- No FINDOUT needed – all facts are in working memory.
(b) CF Calculation:
Rule 1 → C: $$CF_1(\text{premise}) = \min(1.0, 0.8) = 0.8$$ $$CF_1(C) = 0.8 \times 0.9 = 0.72$$
Rule 3 → C: $$CF_3(\text{premise}) = \min(1.0, 0.6) = 0.6$$ $$CF_3(C) = 0.6 \times 0.7 = 0.42$$
Combine Rule 1 and Rule 3 for C: $$CF(C) = 0.72 + 0.42 \times (1 - 0.72) = 0.72 + 0.42 \times 0.28 = 0.72 + 0.1176 = 0.8376$$
Now Rule 2 → E: $$CF_2(\text{premise}) = \min(CF(C), CF(D)) = \min(0.8376, 0.7) = 0.7$$ $$CF(E) = 0.7 \times 0.8 = 0.56$$
Final answer: CF(E) = 0.56
Practice Question 5 – Quick CF Drill (3 marks)
Rule X: IF P(CF=0.7) AND Q(CF=0.5) THEN R (CF=0.6). What is CF(R)?
Click to reveal answer
$$CF(\text{premise}) = \min(0.7, 0.5) = 0.5$$ $$CF(R) = 0.5 \times 0.6 = 0.30$$
Practice Question 6 – CF Abandonment (2 marks)
A backward chaining path starts with hypothesis CF=0.5. Each subsequent rule in the chain has CF_rule=0.6. After how many rule applications does MYCIN abandon this path (threshold: CF < 0.2)?
Click to reveal answer
$$\text{After Rule 1: } CF = 0.5 \times 0.6 = 0.30 \quad (\geq 0.2, \text{ continue})$$ $$\text{After Rule 2: } CF = 0.30 \times 0.6 = 0.18 \quad (< 0.2, \text{ ABANDON})$$
Answer: After 2 rule applications, the CF drops to 0.18 which is below the 0.2 threshold, so MYCIN abandons this path.
Practice Question 7 – WHY and HOW Queries (3 marks)
Explain what information the WHY and HOW queries reveal in MYCIN. Which type of chaining does each correspond to?
Click to reveal answer
WHY query (1.5 marks):
- Corresponds to backward chaining style
- Reveals the system’s current reasoning goal
- When MYCIN asks “What is the patient’s temperature?” and the clinician responds “WHY?”, MYCIN explains: “I am trying to determine if the patient has meningitis. Rule 5 states IF fever AND stiff neck THEN meningitis. I need to know about fever to evaluate this rule.”
- Shows the chain of reasoning from goal to current question
HOW query (1.5 marks):
- Corresponds to forward chaining style
- Shows the rule chain that led to a specific conclusion
- When the clinician asks “HOW did you conclude meningitis?”, MYCIN traces forward through the rules it used and the evidence it gathered
- Shows: “I used Rule 5 (fever=yes, CF=0.9 AND stiff neck=yes, CF=0.7) to conclude meningitis with CF=0.56”
🌐 英语表达要点(English Expression)
Describing MYCIN’s Architecture
"MYCIN is a rule-based expert system developed by Ted Shortliffe at Stanford
in the 1970s. It consists of a knowledge base containing over 450 production
rules, dynamic working memory for patient data, and an inference engine that
performs backward chaining. It has three main subprograms: a consultation
system, an explanation system, and a rule-acquisition system."
Explaining Backward Chaining
"Backward chaining is a goal-driven reasoning strategy. The system begins
with a diagnostic goal, identifies rules whose conclusions match that goal,
and then evaluates the premises. If a premise is unknown, it becomes a
sub-goal, and the process recurses until all required facts are determined.
The system starts with the highest-confidence goal and abandons paths when
confidence drops below 0.2."
Explaining the Sufficient/Necessary Distinction
"In the rule IF A THEN B, A is sufficient for B — having A is enough to
conclude B. Conversely, B is necessary for A — if B is false, A cannot
lead to B through this rule. However, A is not the only cause of B;
other rules may also conclude B from different premises."
Explaining CF Calculation
"The confidence factor for a conjunctive premise is the minimum of the
individual CFs. The conclusion CF is then computed by multiplying the
premise CF by the rule's CF. When multiple rules support the same
conclusion, they are combined using the formula CF₁ + CF₂(1 - CF₁)."
Explaining E-MYCIN
"E-MYCIN is the first domain-independent expert system shell, derived from
MYCIN. By separating the inference engine from the medical knowledge base,
the architecture became reusable for building expert systems in other
domains such as structural engineering (SACON) and pulmonary function
diagnosis (PUFF)."
易错表达 / Common Mistakes in English
| Incorrect | Correct |
|---|---|
| “MYCIN uses forward chaining” | “MYCIN uses backward chaining (goal-driven)” |
| “CFs are probabilities” | “CFs are not probabilities; they range from -1 to +1 and use different combination rules” |
| “Multiply CFs to combine two rules” | “Multiply for rule application (premise x rule CF); use the combination formula for two rules supporting the same conclusion” |
| “MYCIN learns from experience” | “MYCIN does not learn; its rules are manually encoded and remain fixed” |
| “E-MYCIN is a different expert system” | “E-MYCIN is a domain-independent shell – the same inference engine without domain-specific rules” |
| “IF A THEN B means A is the only cause of B” | “IF A THEN B means A is sufficient for B, but other rules can also conclude B” |
| “Backward chaining finds THE necessary condition” | “Backward chaining finds possible necessary conditions (not unique ones)” |
关键词汇
- backward chaining (not “backward chained” when used as a noun/modifier)
- confidence factor (not “confidence level” or “certainty factor” – stick with “confidence factor” for MYCIN)
- production rule (not “production” alone)
- knowledge acquisition bottleneck (the standard term for the core limitation)
- domain-independent shell (the correct description of E-MYCIN)
- Modus Ponens (the logical basis for forward chaining: IF A AND A→B THEN B)
- prefix notation (LISP’s way of writing expressions, e.g., (+ 2 3) instead of 2+3)
🔧 Practical Applications (Modern Relevance)
While MYCIN itself was never deployed clinically, its ideas live on in modern business rules engines:
| System | Description |
|---|---|
| Drools (Java) | Open-source business rules engine; uses forward and backward chaining on production rules |
| Nools (JavaScript) | Rules engine for Node.js, inspired by Drools |
| CLIPS | C-based expert system tool descended from NASA’s work |
These systems are used today for fraud detection, insurance claim processing, medical decision support, and compliance checking – essentially any domain where decisions can be encoded as IF-THEN rules with certainty measures.
🔬 Evaluation of MYCIN
- Expert panel comparison: MYCIN’s diagnoses were compared against those of Stanford infectious disease specialists
- Result: MYCIN achieved approximately 65% correct diagnoses, comparable to the specialists on the panel
- Key finding: High agreement between MYCIN’s recommendations and expert consensus
- However: MYCIN was never deployed clinically due to legal, ethical, and practical concerns (Who is liable if the system is wrong? Clinicians didn’t trust a computer system in the 1970s)
- Legacy: Demonstrated that expert systems could perform at expert level in narrow domains; led to the expert systems boom of the 1980s
✅ 自测检查清单
- 能画出 MYCIN 的架构图并标注 KB, Working Memory, Inference Engine, 三个子程序 (Consultation, Explanation, Rule-Acquisition)?
- 能用英文解释 backward chaining 的完整流程(Goal → Find rules → Check premises → Sub-goal/FINDOUT → Recurse)?
- 能区分 MONITOR 和 FINDOUT 的作用?
- 能正确计算 CF(AND) = min, CF(OR) = max?
- 能正确计算 CF(conclusion) = CF(premise) x CF(rule)?
- 能正确使用组合公式 CF_combined = CF_1 + CF_2(1 - CF_1)?
- 能在一道多规则题目中完成完整的 CF 计算链?
- 能解释 WHY(backward style)和 HOW(forward style)查询分别揭示什么?
- 能解释 E-MYCIN 的意义(第一个领域无关的推理外壳)?
- 能列出 MYCIN 的局限性(knowledge acquisition bottleneck, brittleness, no learning)?
- 能对比 Forward Chaining vs Backward Chaining 并解释 sufficient vs necessary?
- 能解释 “IF A THEN B” 不代表 A 是 B 的唯一原因?
- 知道 MYCIN 在 CF < 0.2 时放弃假设?
- 知道 MYCIN 的评估结果(65% correct, comparable to specialists, never deployed clinically)?
- 知道 LISP 的前缀表示法 (prefix notation)?
- 能用 backward chaining 分析一个医学诊断场景(如 S1 2025 Q6 的 runny nose 例子)?