Skip to content
/ specl Public

A modern specification language and model checker for concurrent and distributed systems. Faster than TLA+/TLC.

License

Notifications You must be signed in to change notification settings

danwt/specl

Repository files navigation

Specl

Specl

License Rust Status

A specification language and model checker for concurrent and distributed systems. Modern alternative to TLA+/TLC: clean syntax, implicit frame semantics, fast Rust engine.

Full manual | Announcement | VSCode Extension

Quick start

cargo install --path crates/specl-cli
specl check examples/other/Counter.specl -c MAX=5
module Counter

const MAX: 0..10
var count: 0..10

init { count = 0 }

action Inc() { require count < MAX; count = count + 1 }
action Dec() { require count > 0; count = count - 1 }

invariant Bounded { count >= 0 and count <= MAX }

Performance

Faster than TLC (the standard TLA+ model checker) on all benchmarks tested. Written in Rust with a bytecode VM, incremental fingerprinting, guard indexing, and parallel BFS.

With parallelism: 1M+ states/second on typical workloads.

Examples

Raft consensus Leader election + log replication (Vanlightly's async model)
Percolator Google's distributed transactions with snapshot isolation
CometBFT Tendermint BFT with Byzantine faults
Paxos Single-decree Paxos (Synod) consensus
MESI Cache coherence protocol
Redlock Distributed lock bug-finding (Kleppmann attack)

See examples/showcase/ for curated protocol specs, examples/other/ for additional specs.

Toolchain

  • VSCode extension — diagnostics, hover, completion, format-on-save (Marketplace)
  • Formatterspecl format spec.specl --write
  • Watch modespecl watch spec.specl -c N=3
  • TLA+ translatorspecl translate spec.tla -o spec.specl

Claude Code Integration

Specl includes an expert skill for Claude Code that teaches Claude how to write, debug, and verify Specl specifications.

Installation

Option 1: Load as plugin (recommended for easy updates)

claude --plugin-dir /path/to/specl

Skills will be namespaced: /specl:expert-specl

Option 2: Install skill only (lightweight)

./install-skill.sh

Skills will be available without namespace: /expert-specl

Usage

Claude will automatically use the skill when you:

  • Work with .specl files
  • Ask about model checking or formal verification
  • Mention distributed protocols (Raft, Paxos, 2PC, etc.)
  • Debug invariant violations or deadlocks

Or invoke it directly:

/expert-specl help me model a consensus protocol

Development

cargo test --workspace && cargo clippy --workspace

License

PolyForm Noncommercial 1.0.0 — free for non-commercial use. See commercial licensing for commercial use. Contact [email protected].

About

A modern specification language and model checker for concurrent and distributed systems. Faster than TLA+/TLC.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •