tlaplus-from-source

Converts C, C++ and Rust source code into formal TLA+ models with Init/Next style actions and invariants for verification.

36|1|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/tlaplus/AgentSkills --skill tlaplus-from-source
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tlaplus-from-source
Source: https://github.com/tlaplus/AgentSkills/tree/main/skills/tlaplus-from-source
Command: npx skills add https://github.com/tlaplus/AgentSkills --skill tlaplus-from-source

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps engineers convert imperative source code (C, C++, Rust, and similar languages) into a concise, formal TLA+ model by extracting core state, transitions, and concurrency patterns, enabling formal reasoning about correctness.

Core Features & Use Cases

  • Phase-based workflow: understand the code, identify abstractions, write the TLA+ specification, and propose properties.
  • Supports modeling of multi-threaded and concurrent patterns by capturing per-thread program counters and shared state semantics.
  • Use cases include validating safety invariants, exploring liveness under concurrent execution, and deriving a compact specification suitable for model checking.

Quick Start

Provide your source code (C, C++, Rust, or similar) and request a high-level TLA+ model; the tool will generate Init, Next, core abstractions, and proposed invariants ready for verification.

Frequently Asked Questions about tlaplus-from-source

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert source code into a TLA+ model for concurrency verification?

You convert source code into a TLA+ model by extracting core state transitions and concurrency patterns from C, C++, or Rust, generating Init/Next actions and key invariants for formal verification.

What is formal modeling of concurrent state transitions in TLA+?

Formal modeling of concurrent state transitions in TLA+ captures per-thread program counters and shared state semantics to mathematically reason about safety properties and analyze potential deadlocks.

Can I use TLA+ to verify safety properties and analyze deadlocks in Rust?

Yes, you can use TLA+ to verify safety properties and analyze deadlocks in Rust by abstracting complex concurrent modules into a compact specification suitable for TLC model checking.

What is the best way to model multi-threaded shared state semantics for TLC verification?

The best way to model multi-threaded shared state semantics for TLC verification is to translate imperative code into an Init/Next style TLA+ specification that proposes properties and captures essential abstractions.

Do I need to manually write invariants when generating a formal model from C++ code?

You do not need to manually write all invariants when generating a formal model from C++ code; the conversion process automatically proposes key invariants and suggested properties ready for verification.