Skip to content

Latest commit

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

AxiomCode

Natural Language to Formally Verified Code
Domain: axiom-code.com
Version: 0.1.0
License: MIT
Dependencies: Zero (pure Python stdlib + cffi)

TestsLicense: MITPython 3.10+


What Is AxiomCode?

AxiomCode converts natural language descriptions of algorithms into mathematically proven-correct code in Python and C. Every generated artifact comes with a cryptographic certificate of verification that can be independently audited.

Natural Language → Lean 4 Spec → Formal Proof → C Binary → Python Package
(you describe) (LLM) (Lean 4) (compiled) (cffi binding)

Why AxiomCode?

FeatureAxiomCodeCopilot/CursorTraditional Verification
Correctness guaranteeMathematical proofProbabilistic guessManual (expert-only)
Learning curvePlain EnglishPlain EnglishYears of expertise
DependenciesZeroHundredsMany
SecurityZero-trust, signedTrust the modelVaries
Audit trailTamper-evident logNoneManual
CertificatesCryptographicNonePaper-based

Quick Start

Install

git clone https://github.com/nrupala/axiomcode.git
cd axiomcode
pip install -e ".[dev]"

Generate Your First Verified Algorithm

# Quick generate
python cli.py "implement binary search on a sorted array"# Interactive guided mode
python cli.py guide
# Browse examples
python cli.py examples

View the Proof

# 2D port graph view
python cli.py visualize binary_search --mode 2d
# Force-directed graph
python cli.py visualize binary_search --mode force
# 3D spatial layout
python cli.py visualize binary_search --mode 3d

Manage Licenses

# Generate root key pair (do this ONCE)
python cli.py license keygen
# Issue a license
python cli.py license issue --user user@example.com --name "User Name" --tier pro
# Verify a license
python cli.py license verify --license-file user_name.license.json
# Show available tiers
python cli.py license tiers

Version Management

# Show current version
python cli.py version show
# Validate data integrity
python cli.py version validate
# View migration history
python cli.py version history

Commands

CommandDescription
python cli.py "description"Generate verified code from NL
python cli.py guideInteractive guided mode
python cli.py examplesBrowse built-in examples
python cli.py helpShow full help and FAQ
python cli.py walkthroughStep-by-step tutorial
python cli.py modelsList available LLM backends
python cli.py visualize <name>View proof visualization
python cli.py publish <name>Publish to PyPI/GitHub
python cli.py verify <name>Independently verify a proof
python cli.py cert <name>Show proof certificate
python cli.py key create <name>Create a signing key
python cli.py key listList signing keys
python cli.py auditShow audit log
python cli.py versionVersion management
python cli.py licenseLicense management

Architecture

┌─────────────────────────────────────────────────────────────┐
│ USER INTERFACE (CLI) │
│ Natural Language Input → Language Selection → Output │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ LLM SPECIFICATION ENGINE │
│ NL → Formal Specification (Lean 4 theorem statements) │
│ Backends: Ollama (local), Mistral, OpenAI, Anthropic │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ PROOF GENERATION ENGINE (Lean 4) │
│ Pantograph (M2M API) + Goedel-Prover + Custom Tactics │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ SECURITY & CERTIFICATION LAYER │
│ Encrypted Key Store | Proof Certificates | Audit Log │
│ Binary Signing | Secure Sandbox | Rate Limiter │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ PROOF VISUALIZATION ENGINE │
│ 2D Port Graph | Force-Directed Graph | 3D Spatial Layout │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ CODE EXTRACTION & COMPILATION │
│ C Binary: lean --c + gcc → .so/.dll │
│ Python: cffi bindings → pip-installable wheel │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ VERSION MANAGEMENT & PERSISTENCE │
│ Upgrade/Downgrade | Backup | Rollback | Data Integrity │
└─────────────────────────────────────────────────────────────┘

Security Model

  • Zero-trust: Every output is independently verifiable
  • Zero-knowledge: LLM prompts never contain sensitive data
  • Encrypted: All artifacts are cryptographically signed
  • Auditable: Tamper-evident audit log for compliance
  • No telemetry: Zero data collection, zero tracking

License Tiers

TierPriceFeatures
CommunityFreeBasic algorithms, 2D visualization, Local LLM only
Pro$49/monthAll algorithms, 3D visualization, Cloud LLMs, Publishing, Certificates
EnterpriseCustomEverything, Multi-user, Compliance, Support, Custom algorithms

Documentation

Development

# Run tests
python -m pytest tests/ -v
# Run with coverage
python -m pytest tests/ --cov=cli --cov=core --cov-report=term-missing
# Lint
python -m ruff check .# Type check
python -m mypy cli.py core/

Requirements

  • Python 3.10+
  • cffi (only external dependency)
  • Ollama (for local LLM) — optional
  • Lean 4 (for proof verification) — optional

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License — see LICENSE file for details.

Contact

About

AxiomCode converts natural language descriptions of algorithms into mathematically proven-correct code in Python and C. Every generated artifact comes with a cryptographic certificate of verification that can be independently audited.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages