{"id":33926180,"url":"https://github.com/ibrahimcesar/lolli","last_synced_at":"2026-06-01T04:31:33.221Z","repository":{"id":327456911,"uuid":"1109395737","full_name":"ibrahimcesar/lolli","owner":"ibrahimcesar","description":"Lolli ⊸ is a linear logic workbench: parse, prove, extract, and compile linear logic to Rust","archived":false,"fork":false,"pushed_at":"2025-12-05T04:50:45.000Z","size":113,"stargazers_count":3,"open_issues_count":20,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T23:06:09.655Z","etag":null,"topics":["curry-howard","formal-methods","linear-logic","proof-assistant","rust","theorem-prover","type-theory"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibrahimcesar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-03T18:40:39.000Z","updated_at":"2025-12-29T16:16:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ibrahimcesar/lolli","commit_stats":null,"previous_names":["ibrahimcesar/linear-logic-workbench-for-rust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibrahimcesar/lolli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimcesar%2Flolli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimcesar%2Flolli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimcesar%2Flolli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimcesar%2Flolli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibrahimcesar","download_url":"https://codeload.github.com/ibrahimcesar/lolli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimcesar%2Flolli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33760645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curry-howard","formal-methods","linear-logic","proof-assistant","rust","theorem-prover","type-theory"],"created_at":"2025-12-12T10:06:33.432Z","updated_at":"2026-06-01T04:31:33.200Z","avatar_url":"https://github.com/ibrahimcesar.png","language":"Rust","funding_links":[],"categories":["Projects"],"sub_categories":["Provers and Solvers"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Lolli ⊸\n\n**Prove it linear, ship it safe.**\n\n[![Rust](https://img.shields.io/badge/rust-1.70%2B-orange.svg)](https://www.rust-lang.org)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n\u003c/div\u003e\n\nLolli is a linear logic toolkit that turns resource specifications into verified Rust code. Describe how resources flow — what gets consumed, what gets produced, which operations are exclusive — and Lolli proves your specification is valid, extracts a program from the proof, and generates Rust where ownership enforces the invariants at compile time. No runtime checks, no manual discipline: if it compiles, the resources are handled correctly.\n\n\u003e [!NOTE]\n\u003e **Why \"Lolli\"?**\n\u003e\n\u003e In linear logic, A ⊸ B is called the \"lollipop\" — consume A, produce B, exactly once. It's the connective that makes resource reasoning precise: no accidental copies, no forgotten cleanups, no use-after-free. Girard introduced it in 1987; Rust's ownership system operationalizes it today. Lolli is named for this symbol because the tool embodies what it represents: proving that resources flow correctly, then generating code that enforces it.\n\n## Features\n\n- **Parse** linear logic formulas with standard notation (Unicode and ASCII)\n- **Prove** sequents automatically using focused proof search\n- **Extract** λ-terms from proofs via Curry-Howard correspondence\n- **Generate** Rust code that enforces linearity through ownership\n- **Visualize** proofs as ASCII trees, LaTeX, or Graphviz DOT\n\n## Installation\n\n```bash\ngit clone https://github.com/ibrahimcesar/lolli.git\ncd lolli\ncargo build --release\n```\n\n## Quick Start\n\n```bash\n# Parse a formula\ncargo run -- parse \"A * B -o B * A\"\n\n# Prove a sequent\ncargo run -- prove \"A, B |- A * B\"\n\n# Extract a term from a proof\ncargo run -- extract \"A -o B, B -o C |- A -o C\"\n\n# Generate Rust code\ncargo run -- codegen \"A, B |- A * B\"\n\n# Visualize a proof\ncargo run -- viz \"A |- A\" --format latex\n\n# Interactive REPL\ncargo run -- repl\n```\n\n## CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `parse \u003cformula\u003e` | Parse and analyze a formula |\n| `prove \u003csequent\u003e` | Check if a sequent is provable |\n| `extract \u003csequent\u003e` | Extract a λ-term from a proof |\n| `codegen \u003csequent\u003e` | Generate Rust code from a proof |\n| `viz \u003csequent\u003e` | Visualize a proof (tree, latex, dot) |\n| `repl` | Interactive REPL mode |\n\n### Command Options\n\n```bash\n# Prove with custom depth limit\ncargo run -- prove \"A |- A\" --depth 50\n\n# Visualize in different formats\ncargo run -- viz \"A, B |- A * B\" --format tree    # ASCII tree (default)\ncargo run -- viz \"A, B |- A * B\" --format latex   # LaTeX (bussproofs)\ncargo run -- viz \"A, B |- A * B\" --format dot     # Graphviz DOT\n\n# Parse with different output modes\ncargo run -- parse \"A * B\" --latex   # LaTeX output\ncargo run -- parse \"A * B\" --ascii   # ASCII-only output\n```\n\n## Syntax\n\n### Connectives\n\n| Symbol | ASCII | Name | Meaning |\n|--------|-------|------|---------|\n| `⊗` | `*` | Tensor | Both A and B (simultaneously) |\n| `⅋` | `\\|` | Par | A or B (opponent chooses) |\n| `⊸` | `-o` | Lollipop | Consume A, produce B |\n| `\u0026` | `\u0026` | With | Both available, choose one |\n| `⊕` | `+` | Plus | One of them (I choose) |\n| `!` | `!` | Bang | Unlimited supply (can copy) |\n| `?` | `?` | Why-not | Demand for resource |\n| `1` | `1` | One | Unit for tensor |\n| `⊥` | `bot` | Bottom | Unit for par |\n| `⊤` | `top` | Top | Always satisfiable |\n| `0` | `zero` | Zero | Never satisfiable |\n| `⊥` (suffix) | `^` | Negation | Linear negation |\n\n### Sequent Notation\n\n```\nA, B |- C          # A and B prove C\nA |- B * C         # A proves B tensor C\n!A |- A * A        # Bang A proves A used twice\n```\n\n## Examples\n\n### Identity\n```bash\n$ cargo run -q -- prove \"A |- A\"\n✓ PROVABLE\n\nProof:\n⊢ A⊥, A  (Axiom)\n```\n\n### Tensor Introduction\n```bash\n$ cargo run -q -- prove \"A, B |- A * B\"\n✓ PROVABLE\n\nProof:\n    ⊢ A⊥, A  (Axiom)\n    ⊢ B⊥, B  (Axiom)\n──────────────────────  TensorIntro\n⊢ A⊥, B⊥, (A ⊗ B)\n```\n\n### Contraction with Bang\n```bash\n$ cargo run -q -- prove \"!A |- A * A\"\n✓ PROVABLE\n\n# Uses A twice via the ! modality\n```\n\n### Code Generation\n```bash\n$ cargo run -q -- codegen \"A, B |- A * B\"\n\nfn f(arg0: A, arg1: B) -\u003e (A, B) {\n    (arg0, arg1)\n}\n```\n\n## Linear Logic to Rust Mapping\n\n| Linear Logic | Rust Type |\n|--------------|-----------|\n| `A ⊸ B` | `impl FnOnce(A) -\u003e B` |\n| `A ⊗ B` | `(A, B)` |\n| `A \u0026 B` | `With\u003cA, B\u003e` (lazy pair) |\n| `A ⊕ B` | `Either\u003cA, B\u003e` |\n| `!A` | `Rc\u003cA\u003e` (shareable) |\n| `1` | `()` |\n| `⊤` | `Top` |\n| `0` | `Void` (empty type) |\n\n## Architecture\n\n```\nlolli/\n├── lolli-core      # Formula, Sequent, Proof, Term types\n├── lolli-parse     # Pest grammar and parser\n├── lolli-prove     # Focused proof search (MALL + MELL)\n├── lolli-extract   # Curry-Howard term extraction\n├── lolli-codegen   # Rust code generation\n├── lolli-viz       # ASCII, LaTeX, Graphviz rendering\n└── lolli-cli       # Command-line interface\n```\n\n## Supported Logic Fragments\n\n| Fragment | Connectives | Status |\n|----------|-------------|--------|\n| MLL | ⊗, ⅋, 1, ⊥, ⊸ | ✓ Complete |\n| MALL | MLL + \u0026, ⊕, ⊤, 0 | ✓ Complete |\n| MELL | MLL + !, ? | ✓ Complete |\n\n## Status \u0026 Roadmap\n\n### Current Status (v0.2.0)\n\nLolli is functional and suitable for:\n- **Educational use** — Learning linear logic and the Curry-Howard correspondence\n- **Prototyping** — Modeling resource protocols before implementation\n- **Small specifications** — Verifying sequents with ~10-20 connectives\n- **Code scaffolding** — Generating type-safe Rust API skeletons\n\n### Known Limitations\n\n| Area | Limitation | Impact |\n|------|------------|--------|\n| **Performance** | Proof search is exponential | Large formulas may timeout |\n| **Scalability** | Single-threaded, in-memory | Not suitable for batch processing |\n| **Error handling** | Parser fails on first error | No error recovery or suggestions |\n| **Code generation** | Produces skeletons only | Manual implementation still needed |\n| **Verification** | Prover not formally verified | Suitable for prototyping, not certification |\n\n### Path to 1.0.0\n\n| Version | Focus | Key Deliverables |\n|---------|-------|------------------|\n| **v0.3.0** | Robustness | Better errors, input validation, edge cases |\n| **v0.4.0** | Performance | Proof caching, pruning, benchmarks |\n| **v0.5.0** | Usability | LSP support, better REPL, documentation |\n| **v1.0.0** | Production | Stability guarantees, full test coverage |\n\nSee [GitHub Milestones](https://github.com/ibrahimcesar/lolli/milestones) for detailed tracking.\n\n## Development\n\n```bash\n# Run all tests\ncargo test --workspace\n\n# Run specific crate tests\ncargo test --package lolli-prove\n\n# Build documentation\ncargo doc --workspace --open\n```\n\n**118 tests** across all crates.\n\n## References\n\n- Girard, \"Linear Logic\" (1987)\n- Andreoli, \"Logic Programming with Focusing Proofs\" (1992)\n- Wadler, \"A Taste of Linear Logic\" (1993)\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\u003cstrong\u003e⊸\u003c/strong\u003e \u003ci\u003eConsume once, produce safely.\u003c/i\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimcesar%2Flolli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibrahimcesar%2Flolli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimcesar%2Flolli/lists"}