Jumla generates Lean 4 verification datasets from Python code and tests.
Project description
🧠 Jumla
Jumla is a Python package for programmatically generating structured datasets of Lean 4 verification tasks from Python functions, complete with specifications, test cases, and formal proof scaffolds.
"Don't ship vibes — ship proofs."
📦 Installation
If installing from pypi:
pip install jumla
This installs the CLI command:
jumla
🚀 Usage
Generate a Lean dataset from a single Python task file:
jumla examples/min_of_three.py
Or process all Python files in a folder:
jumla examples/
Output will be written to the dataset/ folder (e.g. dataset/task_id_0/).
Use --log for detailed debug output:
jumla examples/ --log
🛠️ Development Setup
1. Clone the repo
git clone https://github.com/mmsaki/jumla
cd jumla
2. Install uv (if not already)
curl -LsSf https://astral.sh/uv/install.sh | sh
3. Create a virtual environment
uv venv
source .venv/bin/activate
4. Install the project in editable mode
uv sync
uv pip install -e .
5. Run the CLI
jumla examples/
🧪 Example Structure
# examples/min_of_three.py
import inspect, textwrap
def minOfThree(a: int, b: int, c: int) -> int:
return min(a, b, c)
function = textwrap.dedent(inspect.getsource(minOfThree))
description_doc = "This task requires writing a Lean 4 method..."
input_doc = "The input consists of three integers..."
output_doc = "The output is an integer..."
test_cases = [
{"input": {"a": 3, "b": 2, "c": 1}, "expected": 1, "unexpected": [2, 3, -1]},
...
]
📁 Output Directory Example
dataset/
├── task_id_0/
│ ├── description.txt
│ ├── signature.json
│ ├── task.lean
│ ├── test.json
│ └── tests.lean
Let me know if you want to add Lean syntax checks, markdown summaries, or GitHub CI automation!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jumla-0.1.0.tar.gz.
File metadata
- Download URL: jumla-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c65ac3215599d6cd4bdafc24362824714c5b5f48de663aca7bfbdae1bfb4b7ba
|
|
| MD5 |
10d013f07a05b2dcbbd712efe145ba8a
|
|
| BLAKE2b-256 |
1c38660b535993222630e53c7fd5579eaea082ffd09bc71bb6fcc5b98334b11a
|
File details
Details for the file jumla-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jumla-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3515117ef42e360a089ffde26f9566f57a1ccc8f753bf20c5226bbd5fd84f946
|
|
| MD5 |
c6f441b7bea29878bdb675848c69f669
|
|
| BLAKE2b-256 |
7cdb299087ff635965cf879e9a38897eded3433e32918cc8070c663444ea1ec2
|