Defined in src/skills.metta. Backed by two reasoning engines in lib_nal.metta and lib_pln.metta.
(metta sexpression)Evaluate an arbitrary MeTTa s-expression in the agent's AtomSpace. Primary use is to invoke NAL (|-) or PLN (|~) inference from within the agent loop.
sexpression— a MeTTa s-expression. Read bysread, evaluated byeval.
Whatever the inner expression returns. For NAL/PLN calls, this is a conclusion atom paired with an (stv frequency confidence) truth value.
NAL — deduction:
(metta (|- ((--> (× sam garfield) friend) (stv 1.0 0.9))
((--> garfield animal) (stv 1.0 0.9))))NAL — implication with a variable (note $1):
(metta (|- ((==> (--> (× $1 elephant) eat) (--> $1 ([] dangerous))) (stv 1.0 0.9))
((--> (× tiger elephant) eat) (stv 1.0 0.9))))NAL — revision (same term, two sources): |- merges the evidence.
PLN — forward chaining:
(metta (|~ ((Implication (Inheritance $1 (IntSet Feathered))
(Inheritance $1 Bird)) (stv 1.0 0.9))
((Inheritance Pingu (IntSet Feathered)) (stv 1.0 0.9))))These are policy decisions, not part of the metta skill's API. See reference-orchestration.md for the full tables and rationale (pattern → engine mapping, halt conditions, ACT / HYPOTHESIZE / IGNORE tiers).
- Independent variables are written
$1,$2, … - Negated knowledge uses
(stv 0.0 c). mettaevaluates any MeTTa expression, not just reasoning calls. Malformed input reports errors through&erroron the next turn.- Confidence decays ~10% per deduction hop. Chains past 3 hops usually fall below the ACT threshold — see tutorial-08-reliable-reasoning.md.
- Premise formulation is the primary failure surface. Verify term order, copula, and granularity before trusting a conclusion. See reference-failure-modes.md.
- reference-lib-nal.md — NAL rule catalogue.
- reference-lib-pln.md — PLN rule catalogue.
- reference-lib-ona.md — ONA temporal reasoning (experimental, not installed).
- reference-orchestration.md — full orchestration policy.
- tutorial-05-reasoning-with-nal-pln.md — worked examples.