metta.derivation
Source: extensions/python/metta/derivation.py.
Proof trees as Python objects. Parses the (derivation ...) atoms the shim's meta-interpreter produces into a tree of steps, facts and builtin leaves, records finite-depth truncation without confusing it with no proof, and renders the result as indented text or notebook HTML.
The entries below reproduce the source signatures and docstrings.
Fact
class Fact:A stored atom the proof rests on, and the space holding it.
Fact.render
def render(self, indent: int) -> str:No docstring is defined.
Builtin
class Builtin:An engine-level goal the proof used, kept as the engine wrote it.
Builtin.render
def render(self, indent: int) -> str:No docstring is defined.
Truncated
class Truncated:A finite proof budget ended before this engine goal was explained.
Truncated.render
def render(self, indent: int) -> str:No docstring is defined.
Step
class Step:One equation firing: the call it answered and the equation used.
Step.render
def render(self, indent: int) -> str:No docstring is defined.
Derivation
class Derivation:One complete proof of an answer.
steps are the equations that fired in order; facts and rules list the leaves and equations involved, deduplicated, which is usually the part a reader wants first.
Derivation.from_atom
def from_atom(tree: Atom) -> Derivation:Parse the (derivation (answer Call Out) Steps...) atom.
Derivation.facts
def facts(self) -> list[Fact]:No docstring is defined.
Derivation.rules
def rules(self) -> list[Atom]:No docstring is defined.
Derivation.truncations
def truncations(self) -> list[Truncated]:Every point where a finite depth stopped this proof walk.
Derivation.complete
def complete(self) -> bool:Whether the tree explains the proof without a depth cutoff.