Skip to main content

Crate deep_causality

Crate deep_causality 

Source
Expand description

DeepCausality is a Rust framework for dynamic causality. It enables fast, deterministic, context-aware causal reasoning over complex multi-stage causal models, and stays correct when both the data and the rules evolve at runtime.

Why DeepCausality?

  • Written in Rust with production-grade safety, reliability, and performance in mind.
  • Provides recursive causal data structures that concisely express arbitrary complex causal structures.
  • Threads context awareness across data-like, time-like, space-like, and spacetime-like entities stored within one or more context hypergraphs.
  • Models complex tempo-spatial patterns through the Causal Monad and the Effect Propagation Process.
  • Ships with a Causal State Machine (CSM) for pairing inference with action.

See https://docs.deepcausality.com/ for the documentation.

Modules§

aggregate_logic
causal_type
causaloid
This module defines the Causaloid struct, the fundamental building block for representing causal units within the DeepCausality framework.
causaloid_graph
graph
graph_reasoning
math_utils
monadic_collection_utils
time_utils
utils_test

Structs§

ActionError
Assumption
BuildError
CSM
Causal State Machine (CSM)
CausalAction
A CausalAction represents an executable action that can be triggered in response to causal conditions.
CausalEffect
The effect of the effect-propagation process — a value or a command. See the module docs.
CausalEffectPropagationProcess
The fundamental unit of causal computation in DeepCausality.
CausalFlow
A fluent flow over the causal monad. State and Context default to (), so CausalFlow<T> is the stateless form (lowering to crate::PropagatingEffect); a non-unit State/Context lowers to PropagatingProcess. Error and Log are fixed to CausalityError / EffectLog, so the witness types never appear in a signature a caller reads.
CausalGraphIndexError
CausalState
A CausalState represents a state in a causal state machine (CSM) that can be evaluated based on causal conditions.
CausalSystemState
Mutable state container for the causal system.
CausalityError
The standard error type for DeepCausality operations.
CausalityGraphError
Causaloid
Causaloid is the fundamental building block for causal models in DeepCausality.
CausaloidGraph
A specialized graph structure for representing and reasoning about causal relationships.
EffectLog
Represents an encapsulated, timestamped log of causal evaluation events.
GraphGeneratableEffect
The core effect type for the HKT generative system.
GraphGeneratableEffectSystem
The effect system witness that fixes error and log types.
GraphGeneratableEffectWitness
HKT witness type for the graph generatable effect system.
Inference
Interpreter
LambdaEdges
Identity-keyed store of per-edge Λ decoration slots for one causal graph.
Model
ModificationLog
Container for modification log entries, providing a complete audit trail.
ModificationLogEntry
A single entry in the modification audit trail.
Observation
ProposedAction
Represents an action that the system intends to perform, submitted for evaluation by the Effect Ethos.
Uncertain
A real-valued quantity with inherent uncertainty, modelled as a lazy computation graph.
UncertainParameter

Enums§

ActionParameterValue
Represents a value for a parameter within a ProposedAction. This allows the parameters map to hold values of different types.
AggregateLogic
Defines how the results from a collection of Causable items should be aggregated.
AssumptionError
CausalityErrorEnum
Detailed variants of potential errors in the system.
CausaloidType
Represents the structural type of a Causaloid.
CsmError
ModelBuildError
ModelGenerativeError
ModelValidationError
OpStatus
Status of an operation execution.
Operation
Represents all possible operations that can be applied to a causal model.

Traits§

Aggregatable
Defines how to aggregate a collection of effects of type T.
Assumable
The Assumable trait defines the interface for objects that represent assumptions that can be tested and verified. Assumable types must also implement Identifiable.
AssumableReasoning
The AssumableReasoning trait provides default implementations for common operations over collections of Assumable types.
Causable
The Causable trait defines the core behavior for all causal elements.
CausableCollectionAccessor
A trait for accessing items in a collection of causable elements. The trait is generic over I (input type), O (output type), and T (element type). T must implement MonadicCausable<I, O>.
CausableGraph
CausalMonad
The state-threading effect monad for the propagating-effect family.
CsmEvaluable
Trait for types that can be evaluated to a boolean decision in a CSM.
Identifiable
Trait for types that have a unique identifier.
Inferable
Trait for inferable types with causal reasoning properties.
InferableReasoning
Trait providing reasoning methods for collections of Inferable items.
LogAddEntry
LogAppend
Trait for types that can append log entries from another instance of themselves.
LogEffect
LogSize
MonadicCausable
Sealed: implementable only inside deep_causality (the crate-private sealed module; tracker #11a).
MonadicCausableCollection
MonadicCausableGraphReasoning
Provides default implementations for monadic reasoning over CausableGraph items.
Observable
Observable trait for objects that can be observed.
ObservableReasoning
ObservableReasoning trait provides reasoning methods for collections of Observable items.
StatefulMonadicCausable
Stateful counterpart to crate::MonadicCausable.
StatefulMonadicCausableCollection
Stateful counterpart to crate::MonadicCausableCollection.
StatefulMonadicCausableGraphReasoning
Stateful counterpart to crate::MonadicCausableGraphReasoning.
Transferable
Trait for types that can verify their assumptions against propagating effects.
Verdict
A verdict: a bounded lattice with complement (a Boolean algebra for bool; an MV-algebra for the probability carrier, where complement(p) = 1 − p).

Type Aliases§

AuditableGraphGenerator
Type alias for auditable graph generator computations.
BaseCausalGraph
A type alias for a CausaloidGraph composed of BaseCausaloid instances.
BaseCausalMap
A type alias for a HashMap that stores BaseCausaloid instances, typically indexed by their unique identifiers.
BaseCausaloid
A type alias for a default, general-purpose Causaloid configuration.
BaseCausaloidVec
A type alias for a Vec (vector) containing BaseCausaloid instances.
BaseModel
A type alias for the default Model configuration.
BenchmarkCausalMap
CSMMap
CSMStateActions
CausalFn
The unified function signature for all singleton causaloids that do not require an external context.
CausaloidId
ContextualCausalFn
The unified function signature for all singleton causaloids that require access to a shared, external context.
DescriptionValue
A string value that provides a human-readable description of a Cause or Context
EdgeLambdaFn
A per-edge Λ transform on the value channel: the arrow applied to the value flowing along one identified edge before the join merge. A plain fn pointer, consistent with the crate’s CausalFn family (no dyn, no stored closures).
EvalFn
Function type for evaluating numerical values and returning a boolean result. This remains unchanged as it serves a different purpose outside the core causal reasoning.
FloatType
The floating-point type this crate works in.
IdentificationValue
The unique identifier for a Cause or Context in the Causality Graph
NumberType
A type alias for unsigned integers, used for numerical counting and indexing
NumericalValue
A floating point value that represents a numerical measure
OpTree
Type alias for operation trees.
PropagatingEffect
A stateless causal effect.
PropagatingProcess
A stateful causal process with context.
StateAction
A tuple consisting of a causal state and an associated causal action.
StatefulContextualCausalFn
The unified function signature for singleton causaloids authored on the stateful evaluation path.
UncertainActivationPredicate
UncertainBool
The framework’s uncertain carriers, at the scalar the framework works in.
UncertainF64
The real carrier at FloatType. Named for the scalar it is fixed at, which is f64.
UniformCausalGraph
A type alias for a CausaloidGraph composed of UniformCausaloid instances.
UniformCausalMap
A type alias for a HashMap that stores UniformCausaloid instances, typically indexed by their unique identifiers.
UniformCausaloid
A type alias for a default, general-purpose Causaloid configuration that uses abstract “kind” enums for its spatial, temporal, and symbolic contexts.
UniformCausaloidVec
A type alias for a Vec (vector) containing UniformCausaloid instances.
UniformModel
A type alias for a default, general-purpose Model configuration that uses abstract “kind” enums for its spatial, temporal, and symbolic contexts.