Q5 — Rete Net: Conflict Set, Specificity, Recency

Place every WME in its alpha node, join through the beta network, build the conflict set — then let specificity and recency fight over who fires.

The Question

A Rete net for classifying resistors from their colour bands (Band-1 … Band-4). Working memory (timestamp order):

201. (Band-1 ^itemNo 2B ^colour brown)
202. (Band-2 ^itemNo 2B ^colour yellow)
203. (Band-1 ^itemNo 3C ^colour black)
204. (Band-2 ^itemNo 3C ^colour yellow)
205. (Band-3 ^itemNo 3C ^colour orange)
206. (Band-3 ^itemNo 2B ^colour blue)
207. (Band-4 ^itemNo 2B ^colour gold)
208. (Band-3 ^itemNo 1A ^colour blue)
209. (Band-2 ^itemNo 1A ^colour red)
210. (Band-1 ^itemNo 1A ^colour black)
#QuestionOfficial answer
5.1Which rule-data tuples are in the conflict set? (A: R1,203,205,209 · B: R2,208,209,210 · C: R3,201,204,208,207 · D: R3,201,202,206,207)B and D
5.2Specificity — which tuple fires?D
5.3Recency — which tuple fires?B

The Topic in 60 Seconds

  • Alpha nodes filter single WMEs (CLASS, then attribute tests). Every WME lives in exactly one alpha leaf.
  • Beta nodes join two streams on a shared variable (= <n> joins on the same ^itemNo).
  • Conflict set = all fully matched (rule, data…) tuples. A conflict resolution strategy picks one:
    • Specificity: the tuple whose rule has the most conditions (most WMEs) wins.
    • Recency: the tuple containing the newest (highest-timestamp) WME wins.

Deep-dive: The Rete Algorithm.

The Rete Net (from the figure)

So the rules are: R1 = Band-1 black + Band-2 red + Band-3 orange (same itemNo) · R2 = black + red + blue · R3 = brown + yellow + blue + gold.

Step 1 — Locate every WME

WMEFactsAlpha node
201Band-1, 2B, brownA10
202Band-2, 2B, yellowA12
203Band-1, 3C, blackA9
204Band-2, 3C, yellowA12
205Band-3, 3C, orangeA13
206Band-3, 2B, blueA14
207Band-4, 2B, goldA15
208Band-3, 1A, blueA14
209Band-2, 1A, redA11
210Band-1, 1A, blackA9

Step 2 — Fire the beta joins (match itemNo)

  • B1 (black ⋈ red): blacks 203: 3C, 210: 1A × reds 209: 1A → only (210, 209) on 1A.
  • B2 (brown ⋈ yellow): browns 201: 2B × yellows 202: 2B, 204: 3C → only (201, 202) on 2B.
  • B3 (B1 ⋈ orange): (210,209) is 1A; oranges 205: 3C → no match → R1 empty.
  • B4 (B1 ⋈ blue): (210,209) is 1A; blues 206: 2B, 208: 1A → match 208 → R2: (208, 209, 210) ✓
  • B5 (B2 ⋈ blue ⋈ gold): (201,202) is 2B; blues 206: 2B ✓; golds 207: 2B ✓ → R3: (201, 202, 206, 207) ✓

Conflict set = (R2, 208, 209, 210) and (R3, 201, 202, 206, 207).

Check the options: A has itemNos 3C, 3C, 1A — no join ✗. C mixes 2B, 3C, 1A, 2B ✗. B and D correct ✓.

5.2 — Specificity → D

Count conditions (= WMEs in the tuple): R2's tuple has 3, R3's tuple has 4. More conditions = more specific → R3, 201, 202, 206, 207 fires → option D.

5.3 — Recency → B

Newest WME in each tuple: R2's = 210; R3's = 207. Higher timestamp wins → R2, 208, 209, 210 fires → option B.

Tricks & Tips for This Question Family

Answers: 5.1 B, D · 5.2 D · 5.3 B