A Java VM implementation of Reactive Extensions for composing asynchronous and event-based programs with observable sequences.
p-org/P
A state-machine based programming language for formally modeling and systematically checking the correctness of distributed systems.
- Stars
- 3,721
- Forks
- 225
- Open issues
- 34
- Last commit
- 2 months ago
What is it?
P lets developers model a system design as a collection of communicating state machines, then uses automated reasoning backends to check that the design meets its correctness specifications. It targets distributed and event-driven systems, where message interleavings and failures make bugs hard to find with ordinary testing.
The P Checker systematically explores possible message orderings and failure scenarios to surface corner-case bugs. The project also includes PEx and PVerifier as additional backends, a CLI with a compiler that reports multiple type errors per pass, and PObserve, which checks production service logs against P specifications. PeasyAI provides AI-assisted generation of P state machines and test drivers, integrating with Cursor and Claude Code via MCP.
The project is maintained as a collaboration between industry and academia, and the README reports use by AWS teams on services including S3, DynamoDB and EC2. Installation is available through NuGet or a Docker image that bundles the CLI and its dependencies.
Key features
- 01Model systems as communicating state machines with safety and liveness specifications.
- 02Systematically explore message interleavings and failures to find deep bugs.
- 03Compiler reports all type errors in one pass by default, with a strict mode available.
- 04PObserve validates service logs against P specifications at runtime.
- 05PeasyAI generates state machines and test drivers, integrating with Cursor and Claude Code via MCP.
Use cases
- Verifying the design of distributed protocols or microservice interactions before implementation.
- Finding concurrency and failure-handling bugs that integration tests miss.
- Checking production service logs against an existing formal specification.
- Using AI tools to draft P models from design documents.
Quick start
- 1
Run the official Docker image, which bundles the P CLI and its dependencies
docker run --rm -it -v "$PWD":/workspace ghcr.io/p-org/p:latest - 2
For a local install, follow the installation guide on the project site
Things to know
- A local setup needs the .NET SDK, JDK, Maven and graphviz, so the Docker image is the simpler route.
In collections
Topics
FAQ
- What is P?
- A state-machine based programming language for formally modeling and systematically checking the correctness of distributed systems. P lets developers model a system design as a collection of communicating state machines, then uses automated reasoning backends to check that the design meets its correctness specifications. It targets distributed and event-driven systems, where message interleavings and failures make bugs hard to find with ordinary testing.
- Is P free to use? What license does it have?
- P is open source under the MIT license. Check the license terms before using it in commercial products.
- Is P still maintained?
- Updated within 6 months. The last commit to P was on Sep 3, 2026.
- What can I use P for?
- Verifying the design of distributed protocols or microservice interactions before implementation. Finding concurrency and failure-handling bugs that integration tests miss. Checking production service logs against an existing formal specification. Using AI tools to draft P models from design documents.
- How do I install P?
- Run the official Docker image, which bundles the P CLI and its dependencies: docker run --rm -it -v "$PWD":/workspace ghcr.io/p-org/p:latest For a local install, follow the installation guide on the project site
- Where can I get P?
- The source code and installation instructions are on GitHub: https://github.com/p-org/P
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A portable runtime that gives distributed apps and AI agents durable workflows, service-to-service security, state, and pub/sub through a sidecar.
An actor-model framework for Go, inspired by Erlang/OTP, for building supervised, network-transparent distributed systems.
Restate is a runtime for building resilient applications with durable execution, reliable messaging, and durable state that survive infrastructure failures.
A tool for formally verifying Rust code, checking specifications against all possible executions instead of adding run-time checks.
A C++ plugin for Godot 4 that adds behavior trees and hierarchical state machines for building game AI, with an editor and visual debugger.