Skip to main content

Crate deep_causality_context

Crate deep_causality_context 

Source
Expand description

The context layer of DeepCausality.

A causal model reasons about something, and that something is the context: an explicit, typed environment that a causaloid or a causal-monad chain reads while it runs. This crate owns that environment — the Context hypergraph, the Contextoid nodes it holds, the node types for data, space, time, spacetime and symbols, and the traits that describe them.

Context is a separate crate so that it is an opt-in dependency. Reasoning without context is the default case and costs nothing; a model that needs context declares this crate and imports from it, which keeps a dependency search honest about where context is used.

Because this crate sits beside deep_causality rather than above it, a consumer of the causal monad can carry a typed context without depending on the causaloid stack:

use deep_causality_context::BaseContext;
use deep_causality_core::{PropagatingEffect, PropagatingProcess};

let ctx = BaseContext::with_capacity(1, "demo", 10);
let process: PropagatingProcess<f64, (), BaseContext> =
    PropagatingProcess::with_state(PropagatingEffect::pure(1.0), (), Some(ctx));

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

Modules§

context_graph
contextoid_type
utils_test

Structs§

AdjustmentError
CausalSetSpacetime
An element of a causal set, with the elements that precede it.
Context
ContextIndexError
ContextStore
Projection, then storage, in one place.
Contextoid
CoordinateError
A coordinate outside the range of its chart, or not finite: a latitude beyond ±90°.
Data
A generic container for a piece of data, associated with a unique identifier.
DiscreteTime
A time model representing discrete, uniformly spaced ticks instead of continuous physical time.
EcefSpace
A position in the WGS 84 Earth-centred, Earth-fixed (ECEF) Cartesian coordinate system, in metres.
EntropicTime
A time model based on entropy-driven progression, suitable for emergent systems, self-organization, and irreversible state evolution.
EuclideanSpace
A point of three-dimensional Euclidean space, in Cartesian coordinates x, y, z.
GalileanSpacetime
An event of Galilean spacetime, in the coordinates (t, x, y, z) of an inertial frame.
GeoSpace
A position given by WGS 84 geodetic latitude and longitude, in degrees, and an altitude in metres measured against a VerticalDatum.
IndexError
MetricTensorError
A metric tensor refused by MetricTensor4D::update_metric_tensor: MetricTensorErrorEnum names the rule it breaks.
MinkowskiSpacetime
An event of Minkowski spacetime, in the coordinates (t, x, y, z) of an inertial frame.
MinkowskiTime
The coordinate time t of an inertial frame of Minkowski spacetime, counted in time_scale units.
NedSpace
A position in a local north-east-down (NED) Cartesian frame, in metres.
NewtonianSpacetime
An event of Newtonian spacetime, in coordinates (t, x, y, z) at rest in its absolute space.
NewtonianTime
The absolute time of a classical spacetime: an instant, as a real number counted in time_scale units.
NoSpace
The absence of a spatial position, as a type: it fills the spatial slot of a Context whose graph holds no spatial node.
NoSpaceTime
The absence of a spacetime position, as a type: it fills the spacetime slot of a Context whose graph holds no spacetime node.
NoTime
The absence of time, as a type: it fills the temporal slot of a Context whose graph holds no time node.
Root
StoreError
Why a store operation failed: the backend refused, the substrate refused, or the projection between records and nodes did.
SubstrateRef
Where a data node’s value is stored, for a context that outlives the process.
SymbolicTime
A symbolic time representation for use in logic-based, non-numeric, or event-driven causal systems.
TangentSpacetime
An event p of a relativistic spacetime, a tangent vector at p, and the metric tensor g_ab(p) there, in coordinates (t, x, y, z) with t in seconds and x, y, z in metres.
UncertainBoolData
A context node holding an uncertain truth value.
UncertainData
A context node holding a real-valued uncertain quantity.
UpdateError

Enums§

ContextKind
Enum of monoidal context node types (each a composable unit of structure). Each variant name ends in -oid to emphasize its monoid role as a single identity-bearing unit.
ContextoidType
MetricTensorErrorEnum
The rule a refused metric tensor breaks. Indices follow the coordinate order t, x, y, z.
RelationKind
The kind of relation an edge in a Context carries.
SpaceKind
An enumeration over supported spatial context types.
SpaceTimeKind
One of the spacetime types a context can hold, so that a single spacetime slot can carry events of different geometries.
StoreErrorEnum
The classification of a store failure.
SymbolicTimeUnit
Represents a symbolic unit of time with a qualitative relationship to named events.
TimeKind
One of the time types a context can hold, so that a single time slot can carry nodes of different kinds.
TimeScale
VerticalDatum
The reference an altitude is measured against.

Traits§

Adjustable
Contextuable
Represents any entity that participates in a causal context graph.
ContextuableGraph
Trait for graph containing context-aware nodes.
Coordinate
Provides a generalized interface for N-dimensional coordinate access.
CurrentDataIndex
CurrentTimeIndex
DataIndexable
Datable
Represents data-bearing entities in a context graph.
Distance
The distance between two points of the same type, as a length.
ExtendableContextuableGraph
Trait for poly-contextuable causal graphs. By default, the context graph is assumed to be a single-context graph.
Identifiable
Trait for types that have a unique identifier.
MetricSignature
Reports the signature of the metric a spacetime node measures separations with, with generator i the node’s coordinate i.
MetricTensor4D
Read and write access to the metric tensor g_ab at a spacetime event.
PreviousDataIndex
PreviousTimeIndex
Trait for getting and setting the previous time index for various time scales.
ScalarProjector
A trait that defines how to extract a scalar value from a structured input type.
ScalarValue
Marker trait to identify numeric scalar types.
SpaceTemporal
An event of a spacetime: a node with a position and a time.
SpaceTemporalInterval
The interval between two events of Minkowski spacetime,
Spatial
Marks entities that have spatial semantics.
Storable
A data payload that one DataRecord describes completely, in both directions.
Temporal
Represents entities that have intrinsic temporal properties.
TimeIndexable
Trait for types that can be indexed.
UncertainAdjustable
UncertainDatable
Represents uncertain data entities in a context graph.

Type Aliases§

BaseContext
A context in the classical frame: numeric data, positions in Euclidean space, absolute time, and events of Newtonian spacetime.
BaseContextoid
A contextoid of BaseContext: one node holding numeric data (a Datoid), a position in Euclidean space (a Spaceoid), an instant of absolute time (a Tempoid) or an event of Newtonian spacetime (a SpaceTempoid).
ContextId
The identifier of a Context.
ContextoidId
The identifier of a Contextoid within a Context.
FloatType
The floating-point type this crate’s ready-made aliases are built at.
SubstrateContext
The shape a store that holds references accepts: the three Kind enums, for which the projection is total, and a data node that holds where its value lives rather than the value.
SubstrateContextoid
The contextoid of a SubstrateContext.
UniformContext
A type alias for a default, general-purpose Context configuration that uses abstract “kind” enums for its spatial, temporal and spacetime slots.
UniformContextoid
A type alias for a default, general-purpose Contextoid configuration that uses abstract “kind” enums for its spatial, temporal and spacetime slots.