{"id":27439634,"url":"https://github.com/subsetpark/pantagruel","last_synced_at":"2026-01-21T09:01:55.309Z","repository":{"id":62430247,"uuid":"143798540","full_name":"subsetpark/pantagruel","owner":"subsetpark","description":"A program specification language with a formal syntax and ad-hoc semantics.","archived":false,"fork":false,"pushed_at":"2026-01-18T01:07:40.000Z","size":784,"stargazers_count":85,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-18T12:49:31.238Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pantagruel-language.com/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subsetpark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-08-07T00:38:48.000Z","updated_at":"2026-01-18T00:21:31.000Z","dependencies_parsed_at":"2025-04-16T03:49:53.628Z","dependency_job_id":null,"html_url":"https://github.com/subsetpark/pantagruel","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/subsetpark/pantagruel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsetpark%2Fpantagruel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsetpark%2Fpantagruel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsetpark%2Fpantagruel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsetpark%2Fpantagruel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subsetpark","download_url":"https://codeload.github.com/subsetpark/pantagruel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsetpark%2Fpantagruel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28630938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-04-14T21:59:53.102Z","updated_at":"2026-01-21T09:01:55.290Z","avatar_url":"https://github.com/subsetpark.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pantagruel\n\nA specification language checker for formal system descriptions.\n\nPantagruel lets you write precise specifications of systems using domains, procedures, and logical propositions. The checker validates that your specifications are well-typed and internally consistent.\n\n## Installation\n\nRequires OCaml 4.14+ and opam.\n\n```bash\n# Install dependencies\nopam install menhir sedlex ppx_deriving alcotest\n\n# Build\ndune build\n\n# Run tests\ndune test\n\n# Install globally (optional)\ndune install\n```\n\n## Usage\n\n```bash\n# Check a specification file\npantagruel myspec.pant\n\n# Read from stdin\necho 'module TEST. Foo. ---' | pantagruel\n\n# Output JSON (includes resolved types and full AST)\npantagruel --json myspec.pant\n\n# Print the AST (OCaml format, for debugging)\npantagruel --ast myspec.pant\n\n# Specify module search path for imports\npantagruel --module-path ./specs myspec.pant\n```\n\n## Samples\n\nThe `samples/` directory contains reference specifications demonstrating all language features:\n\n- `01-basics.pant` - Fundamental syntax: domains, procedures, quantifiers\n- `02-library.pant` - Library system with void procedures and state transitions\n- `03-types.pant` - All type features: products, sums, lists, aliases\n- `04-operators.pant` - All operators: logical, comparison, arithmetic\n- `05-state.pant` - State transitions with primed expressions and frame conditions\n- `06-advanced.pant` - Function overrides and unicode operators\n\n## Language Overview\n\nA Pantagruel document consists of a module declaration, optional imports, and one or more chapters. Each chapter has a **head** (declarations) and a **body** (propositions), separated by `---`.\n\n### Basic Structure\n\n```\nmodule LIBRARY.\n\nimport USERS.\n\n\u003e Domains\nBook.\nLoan.\n\n\u003e Procedures\navailable b: Book =\u003e Bool.\nborrow u: User, b: Book.\n---\n\u003e Propositions about the library\nall b: Book | available b -\u003e b in Book.\n```\n\n### Declarations\n\n**Domains** define the basic types in your system:\n```\nUser.\nDocument.\n```\n\n**Type aliases** create composite types:\n```\nPoint = Nat * Nat.           // Product type (tuple)\nResult = Value + Error.      // Sum type\nUserList = [User].           // List type\n```\n\n**Procedures** define operations with typed parameters:\n```\n// With return type\nowner d: Document =\u003e User.\ndistance p: Point, q: Point =\u003e Real.\n\n// Nullary (no parameters)\nnobody =\u003e User.\n\n// Void (no return type) - for state transitions\ncheck-out u: User, d: Document.\n```\n\n### Propositions\n\nThe body contains logical propositions that must be boolean:\n\n```\n// Literals\ntrue.\nfalse.\n\n// Quantifiers\nall u: User | u in User.\nsome d: Document | owner d = nobody.\n\n// Comparisons\nall x: Nat, y: Nat | x + y \u003e= x.\n\n// Membership and cardinality\nall u: User | u in User.\n#User \u003e= 0.\n```\n\n### Void Procedures and Primed Expressions\n\nVoid procedures model state transitions. Within a chapter that declares a void procedure, you can use **primed expressions** to refer to the post-state:\n\n```\nUser.\nDocument.\nowner d: Document =\u003e User.\ncheck-out u: User, d: Document.\n---\n// owner' refers to owner after check-out\nowner' d = u.\n```\n\n### Operators\n\n| Category | Operators |\n|----------|-----------|\n| Logical | `and`, `or`, `not`, `-\u003e` (implication) |\n| Comparison | `=`, `!=`, `\u003c`, `\u003e`, `\u003c=`, `\u003e=` |\n| Membership | `in`, `subset` |\n| Arithmetic | `+`, `-`, `*`, `/` |\n| Other | `#` (cardinality), `.N` (projection) |\n\nUnicode alternatives are supported: `∧` `∨` `¬` `→` `⇒` `∀` `∃` `∈` `⊆` `≠` `≤` `≥`\n\n### Comments\n\n```\n// Line comment\n\u003e Doc comment (at start of line)\n```\n\n### Built-in Types\n\n- `Bool` - boolean values\n- `Nat` - positive integers (1, 2, 3, ...)\n- `Nat0` - non-negative integers (0, 1, 2, ...)\n- `Int` - all integers\n- `Real` - real numbers\n- `String` - text strings\n- `Nothing` - empty/null type\n\nNumeric types form a hierarchy: `Nat \u003c Nat0 \u003c Int \u003c Real`\n\n## Module System\n\nSpecifications can import other modules:\n\n```\nmodule INVENTORY.\n\nimport PRODUCTS.\nimport WAREHOUSE.\n\nItem.\nstock i: Item =\u003e Nat0.\n---\nall i: Item | stock i \u003e= 0.\n```\n\nUse `--module-path` to specify where to find imported `.pant` files.\n\n## Examples\n\n### Simple Domain Model\n\n```\nmodule ACCOUNTS.\n\nAccount.\nbalance a: Account =\u003e Int.\ndeposit a: Account, amount: Nat.\n---\n// Balance increases after deposit\nbalance' a = balance a + amount.\n\n// Other accounts unchanged\nall other: Account | other != a -\u003e balance' other = balance other.\n```\n\n### Data Structures\n\n```\nmodule GEOMETRY.\n\nPoint = Real * Real.\norigin =\u003e Point.\ndistance p: Point, q: Point =\u003e Real.\n---\norigin = (0.0, 0.0).\nall p: Point | distance p p = 0.0.\nall p: Point, q: Point | distance p q = distance q p.\n```\n\n## Editor Integration\n\nPantagruel can be used with any editor that supports LSP through [efm-langserver](https://github.com/mattn/efm-langserver).\n\n### efm-langserver Configuration\n\nAdd to your efm-langserver config (typically `~/.config/efm-langserver/config.yaml`):\n\n```yaml\nversion: 2\ntools:\n  pantagruel-lint: \u0026pantagruel-lint\n    lint-command: 'pant ${INPUT}'\n    lint-stdin: false\n    lint-formats:\n      - '%f:%l:%c: error: %m'\n\nlanguages:\n  pantagruel:\n    - \u003c\u003c: *pantagruel-lint\n```\n\n### Neovim (with nvim-lspconfig)\n\n```lua\nrequire('lspconfig').efm.setup({\n  filetypes = { 'pantagruel' },\n  init_options = { documentFormatting = true },\n})\n\n-- Associate .pant files with pantagruel filetype\nvim.filetype.add({\n  extension = { pant = 'pantagruel' }\n})\n```\n\n### VS Code\n\nInstall the [efm-langserver extension](https://marketplace.visualstudio.com/items?itemName=ponsuke.vscode-efm-langserver) and configure similarly.\n\n## License\n\nBSD-3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubsetpark%2Fpantagruel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubsetpark%2Fpantagruel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubsetpark%2Fpantagruel/lists"}