pub struct DerivationTree {
pub conclusion: ProofExpr,
pub rule: InferenceRule,
pub premises: Vec<DerivationTree>,
pub depth: usize,
pub substitution: Substitution,
}Expand description
The “Euclidean Structure” - A recursive tree representing the proof.
This is the object returned by the Prover. It allows the UI to render a step-by-step explanation (Natural Language Generation).
§Structure
Each node contains:
conclusion: The proposition proved at this steprule: The logical rule applied (how we know the conclusion)premises: Sub-proofs justifying the rule’s requirementssubstitution: Variable bindings from unification
§See Also
BackwardChainer::prove- Creates derivation treesInferenceRule- The rules that justify each stepProofExpr- The conclusion typecertifier::certify- Converts trees to kernel termshints::suggest_hint- Suggests next steps when stuck
Fields§
§conclusion: ProofExprThe logical statement proved at this node.
rule: InferenceRuleThe rule applied to justify this conclusion.
premises: Vec<DerivationTree>The sub-proofs that validate the requirements of the rule. Example: ModusPonens will have 2 children (The Implication, The Antecedent).
depth: usizeThe depth of the tree (used for complexity limits).
substitution: SubstitutionSubstitution applied at this step (for unification-based rules).
Implementations§
Source§impl DerivationTree
impl DerivationTree
Sourcepub fn new(
conclusion: ProofExpr,
rule: InferenceRule,
premises: Vec<DerivationTree>,
) -> Self
pub fn new( conclusion: ProofExpr, rule: InferenceRule, premises: Vec<DerivationTree>, ) -> Self
Constructs a new Proof Node. Automatically calculates depth based on children.
Sourcepub fn leaf(conclusion: ProofExpr, rule: InferenceRule) -> Self
pub fn leaf(conclusion: ProofExpr, rule: InferenceRule) -> Self
A leaf node (usually a Premise, Axiom, or Oracle result).
Sourcepub fn with_substitution(self, subst: Substitution) -> Self
pub fn with_substitution(self, subst: Substitution) -> Self
Set the substitution for this derivation step.
Sourcepub fn display_tree(&self) -> String
pub fn display_tree(&self) -> String
Renders the proof as a text-based tree (for debugging/CLI).
Trait Implementations§
Source§impl Clone for DerivationTree
impl Clone for DerivationTree
Source§fn clone(&self) -> DerivationTree
fn clone(&self) -> DerivationTree
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more