A Domain-Specific Language for Temporal and Entropic Memory Models
Important
Causm is an experimental toolchain for exploring temporal and entropic memory models. It is not intended for production environments. Specifications and implementation are subject to radical changes.
Causm is a domain-specific research language designed to address the inherent non-determinism in concurrent systems. By treating time as a first-class execution primitive and implementing an entropic memory model, Causm provides a framework where race conditions are eliminated through the mathematical enforcement of temporal invariants.
This repository contains the reference implementation of the Causm toolchain, including the compiler, analyzer, and the Z3-governed Register-based Temporal Virtual Machine (TVM).
- Research Objectives
- Architecture
- Documentation
- Getting Started
- Research Patterns
- Execution Interface
- License
Causm investigates the feasibility of the following hypotheses:
- Temporal Execution Primitives: Can race conditions be mitigated by making time a verifiable execution primitive? Causm explores "Isochronous Scheduling" to prevent unexpected interleaving by enforcing rigid temporal alignment.
- Entropic Memory Model: Is it feasible to model memory safety through state decay rather than borrow checking? Causm tests if data access as a destructive operation can provide a symbolically verifiable alternative to traditional models.
- Causal Synchronization: Can cross-timeline state be synchronized without traditional locking? The project researches how independent execution branches communicate state transitions while maintaining consistent causal order.
- SMT-Based Temporal Correctness: How effectively can kernels verify correctness in non-linear code? The project uses an experimental Z3-governed kernel to unroll loops and branches into symbolic constraints.
Causm employs a multi-pass pipeline to ensure programs are only executed if their temporal and entropic safety is mathematically proven.
graph TD
Source[".csm Source Code"] --> Parser["Causm Parser (Pest)"]
Parser --> AST["Abstract Syntax Tree"]
subgraph "Correctness Kernel"
AST --> Analyzer["Entropic Analyzer"]
Analyzer --> Z3Guard["Formal Verification Guard (Z3)"]
Z3Guard --> Proofs{{"Symbolic Proofs"}}
end
Proofs -- "UNSAT (Violation)" --> Error["Semantic Error"]
Proofs -- "SAT (Safe)" --> Lowering["IR Lowering"]
Lowering --> TVM["Register-based TVM"]
subgraph "TVM Execution"
TVM --> Sched["Isochronous Scheduler"]
TVM --> Arena["Entropic Arena"]
Sched --> Padding["Deterministic Padding"]
Arena --> EGC["Entropic GC"]
end
Technical specifications and research documentation are in the docs/ directory. See the Full Documentation Hub for a structured overview.
- Core: Syntax, Semantic Model, Type System
- Correctness: Formal Verification Guard, Routine Contracts
- Temporal Mechanics: Isochronous Scheduling, Iteration & Pacing
- Concurrency & State: Entropic Channels, Timeline Routing, Asynchronous Promises
- Acausal Debugging: Diagnostics and trace logs.
- Memory Reclamation: Entropic GC (EGC) and arena management.
- Rust: Version 1.75.0 or later
- Z3 Solver: Required for formal verification
# Analyze and run a source file
cargo run -- examples/time_travel_showcase.csm
# Perform formal verification without execution
cargo run -- --check examples/sample.csm
# Execute with full entropic tracing
cargo run -- --run --trace-entropy examples/sample.csmisolate Producer {
require Chan.Outbound(id="sensor_bus", type=int)
let reading = 42
chan_send sensor_bus(reading)
// 'reading' is now Consumed.
}
isolate Consumer {
require Chan.Inbound(id="sensor_bus", type=int, latency=5ms)
await_chan sensor_bus
let data = chan_recv(sensor_bus)
}
routine process_packet(p: PacedIterable<int, 2ms>) taking 10ms {
for item in p {
compute(item)
}
}
type Actor = struct {
name: string
}
type Robot = Actor + struct decay_after 100ms {
model: string
}
routine Actor.introduce(peek self) -> int taking 10ms {
let name = self.name
print("Hello, I am Actor: " + name)
yield 0
}
interface Worker {
routine work(consume self) -> int taking 20ms
}
routine Robot.work(consume self) -> int taking 20ms {
print("Robot " + self.name + " is working...")
yield 0
}
let r: Robot = struct { name = "T-800", model = "Model 101" }
r.introduce() // Dynamic lookup resolves to Actor.introduce
let w: Worker = r // Structural subtyping implementation
w.work() // Polymorphic dispatch (consumes the robot structure)
Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See LICENSE.
Built with 🦀 & ⚡ by Seuriin