pulsatrix
Loading...
Searching...
No Matches
pulsatrix::datalog::DualSemiring< T > Struct Template Reference

The dual-number semiring: ⊕/⊗ are ordinary dual-number addition/multiplication (sum rule / product rule), zero = (0, 0), one = (1, 0) – the multiplicative identity carries no derivative of its own, matching the fact that a constant contributes nothing to any derivative. More...

#include <datalog_dual_semiring.hpp>

Public Types

using Value = DualNumber< T >
 

Static Public Member Functions

static constexpr Value zero ()
 
static constexpr Value one ()
 
static constexpr Value add (Value a, Value b)
 
static constexpr Value mul (Value a, Value b)
 

Detailed Description

template<typename T>
struct pulsatrix::datalog::DualSemiring< T >

The dual-number semiring: ⊕/⊗ are ordinary dual-number addition/multiplication (sum rule / product rule), zero = (0, 0), one = (1, 0) – the multiplicative identity carries no derivative of its own, matching the fact that a constant contributes nothing to any derivative.

Note
Stage 3 design decision 2 (this mission): differentiability flows through the Datalog evaluation via this closed-form/algebraic dual-number construction, not via ComputationGraph/Autograd node-level wiring – see this file's own header comment and the mission file's Stage 3 write-up for the recon that established this is the only structurally sound option (Node/OpType carry no value payload and have no shape for a variable-arity, substitution-joined Datalog rule body; Autograd is scoped to single-parent Module-shaped nodes). The transitive half of the requirement – flowing the resulting derivative into the neural predicate's own Module (LinearModule) parameters – is handled separately, by seeding a real Tensor gradient and calling that Module's own real backward(), exactly mirroring this codebase's own ToyKnowledgeBase::backward() precedent (hand-chained Module::backward() calls, no ComputationGraph/Autograd object involved there either).

Member Typedef Documentation

◆ Value

template<typename T >
using pulsatrix::datalog::DualSemiring< T >::Value = DualNumber<T>

Member Function Documentation

◆ add()

template<typename T >
static constexpr Value pulsatrix::datalog::DualSemiring< T >::add ( Value  a,
Value  b 
)
inlinestaticconstexpr

◆ mul()

template<typename T >
static constexpr Value pulsatrix::datalog::DualSemiring< T >::mul ( Value  a,
Value  b 
)
inlinestaticconstexpr

◆ one()

template<typename T >
static constexpr Value pulsatrix::datalog::DualSemiring< T >::one ( )
inlinestaticconstexpr

◆ zero()

template<typename T >
static constexpr Value pulsatrix::datalog::DualSemiring< T >::zero ( )
inlinestaticconstexpr

The documentation for this struct was generated from the following file: