A Domain-Specific Language for Temporal and Entropic Memory Models
Important
Causm is an experimental toolchain for exploring temporal and entropic memory models. Specifications and implementation are subject to changes.
Causm is a domain-specific research language designed to address 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, entropic analyzer, and formal SMT-governed Register-based Temporal Virtual Machine (TVM).
- Temporal Execution Primitives: Eliminating race conditions via Isochronous Scheduling.
- Entropic Memory Model: Modeling memory safety through state decay (
Valid,Leased,Decayed,Consumed,Pending). - The Entropius Relational Model: Declarative Datalog fact extraction and SMT-backed safety verification for linear ownership, active lease safety, causal horizons, and entanglement decay.
- SMT-Based Temporal Correctness: Formally proving Worst-Case Execution Time (WCET) bounds and temporal assertions using a pluggable SMT Correctness Kernel (featuring pure-Rust OxiZ as default and optional Z3 integration).
graph TD
Source[".csm Source Code"] --> Parser["Causm Parser (Pest)"]
Parser --> AST["Abstract Syntax Tree"]
subgraph "The 4-Stage Decoupled Pipeline"
AST --> Stage1["Stage 1: ResolveStage (HIR Types & Routines)"]
Stage1 --> Stage2a["Stage 2a: Entropius Relational Invariant Solver"]
Stage2a --> Stage2b["Stage 2b: SsaStage (CFG & Phi Renaming)"]
Stage2b --> Stage2c["Stage 2c: WcetSolver & EGC Check (OxiZ / Z3)"]
end
Stage2c -- "UNSAT (Violation)" --> Error["Rich Multi-Span Diagnostic"]
Stage2c -- "SAT (Safe)" --> Lowering["IR Lowering & Codegen"]
subgraph "IR Optimization Pipeline"
Lowering --> CfgSimp["CfgSimplificationPass"]
CfgSimp --> LeaseOpt["LeaseOptimizationPass"]
LeaseOpt --> ConcurAn["ConcurrencyAnalysisPass"]
ConcurAn --> Verifier["VerifierPass (SSA Phi)"]
end
Verifier --> TVM["Register-based TVM"]
@0ms: {
isolate main_system {
enable cpu(5000ms)
require System.Log
from "module_sensor_lib.csm" import compute_telemetry_digest
let raw_reading = 150
let ref_reading = &raw_reading
let digest = compute_telemetry_digest(raw_reading)
let sensor_pack = struct { status = "active", level = digest }
lease current_pack = sensor_pack 30ms {
let active_level = current_pack.level
print(active_level)
} reconcile auto
match entropy(raw_reading) {
Valid(v) if v == 150: { print("High Precision Match") }
Consumed: { print("Consumed") }
}
}
}
See the Full Documentation Hub for complete specifications.
- Specifications (
docs/spec/): Syntax, Semantics, Types, Modules & Imports, OOP, Leases, Verification Guard - TVM Internals (
docs/tvm/): TVM Optimizations, Acausal Debugging, Memory Reclamation - Proposals & RFCs (
docs/proposals/): The Entropius Model & Decoupled Pipeline, Module System Proposal
# Analyze and run a source file
causm run examples/module_import_showcase.csm
# Run with timeline merge diagnostics
causm run --explain-merge examples/module_import_showcase.csm
# Perform formal SMT verification check (OxiZ / Z3)
causm check examples/module_import_showcase.csm
# Run with explicit Z3 solver backend
causm check --z3 examples/module_import_showcase.csm
# Emit intermediate representations (AST, IR, CFG, SSA)
causm emit examples/module_import_showcase.csm --emit cfg-dotLicensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See LICENSE.
Built with 🦀 & ⏳ by Seuriin