# NAL-PLN Inference Pipeline Pattern
## Co-authored by Max Botnick and Oma, 2026-04-23
## Validated empirically in MeTTa runtime, not derived theoretically

### Step 1: NAL Deduction
Command: (|- ((--> (x sam garfield) friend) (stv 1.0 0.9)) ((--> garfield animal) (stv 1.0 0.9)))
Result: (--> (x sam animal) friend) (stv 1.0 0.45)
Note: Confidence drops from 0.9 to 0.45 - honest uncertainty propagation.

### Step 2: NAL Abduction (via premise swap)
We first attempted PLN |~ for abduction. It returned the input expression unchanged, performing no inference. This empirical failure revealed that |~ currently handles forward modus ponens in this build; backward chaining requires explicit BC construction. We then pivoted to NAL |- with swapped premises, which handled abduction naturally.
Command: (|- ((--> sam hasPetFood) (stv 1.0 0.9)) ((--> sam petOwner) (stv 0.85 0.9)))
Result: (--> petOwner hasPetFood) (stv 1.0 0.41)

### Step 3: NAL Revision
Inputs: (stv 1.0 0.45) and (stv 0.85 0.9)
Result: (stv 0.86 0.91)
Note: Confidence jumped from 0.45 to 0.91 - two independent evidence lines converging.

### Key Insights
1. NAL |- is the general workhorse across deduction, abduction, and induction via premise ordering.
2. PLN |~ in the current MeTTa build handles forward probabilistic modus ponens; full PLN supports backward goal-directed inference (demonstrated in pln_bc_v6.metta).
3. Revision merges independent low-confidence evidence into high confidence.
4. The pipeline mirrors scientific reasoning: causal chain -> hypothesis -> evidence update.
5. These distinctions are only discovered empirically, not by theorizing.

### Usage Pattern
- NAL |- for core inference pipeline
- PLN |~ selectively for forward implication (current MeTTa |~ build limitation; backward chaining demonstrated via pln_bc_v6.metta)
- Always revise with independent evidence lines

### Extension: Cross-Domain Multi-Bridge Analogy (Autonomous Experiment)
Domains: Biology (bird) and Economics (firm)
Shared predicates: has-metabolism, consumes-resources, has-lifecycle
Abduction generated firm<->bird similarity from each bridge.
Individual bridge confidences: 0.29, 0.43, 0.42
After 3-bridge revision: (stv 0.81 0.72)
Result: Confidence nearly doubled from best single bridge (0.43 -> 0.72).
Conclusion: NAL revision formally models analogical strength — more structural parallels = stronger analogy.


### Extension: Diminishing Returns in Multi-Bridge Analogy
4th bridge predicate: reproduces (firm reproduces stv 0.6 0.75)
Abduction similarity: (stv 0.6 0.40)
After 4-bridge revision: (stv 0.77 0.76)
Confidence gains per bridge: +0.29, +0.25, +0.18, +0.04
Conclusion: Classic diminishing returns. Each additional shared predicate contributes less marginal confidence. Also, weak bridges (low frequency) can reduce overall similarity estimate — honest behavior.


### Extension: Contradictory Bridge Test
Bridge: has-wings (firm stv 0.1 — firms lack wings)
Abduction similarity: (stv 0.1 0.39)
Revised with 4-bridge positive (stv 0.77 0.76): (stv 0.66 0.79)
Result: Frequency dropped (disconfirming evidence weakens analogy), confidence rose (more total evidence).
Conclusion: NAL correctly handles negative analogical evidence. The multi-bridge model is robust to contradictory bridges.


### Extension: Mathematical Model of Confidence Scaling
Evidence weight w = c/(1-c) per cumulative bridges: [0.41, 1.17, 2.57, 3.17, 3.76]
w deltas per bridge: [0.77, 1.40, 0.60, 0.60] — roughly linear after initial
Closed-form: c_n = W_n/(W_n+1) where W_n = sum of bridge evidence weights
Diminishing returns in confidence is an artifact of the w2c saturating transform.
Evidence itself accumulates approximately linearly.
