{"id":17319573,"url":"https://github.com/ziman/itt-idris","last_synced_at":"2026-02-12T05:10:54.990Z","repository":{"id":137832827,"uuid":"174329012","full_name":"ziman/itt-idris","owner":"ziman","description":"ITT: quantified dependent calculus with inference of all modalities, implemented in Idris 2","archived":false,"fork":false,"pushed_at":"2024-12-05T21:04:18.000Z","size":633,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T09:13:31.824Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Idris","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/ziman.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}},"created_at":"2019-03-07T11:10:16.000Z","updated_at":"2024-12-05T21:04:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"777b9964-faf1-4f46-93f1-74c4c37b39fb","html_url":"https://github.com/ziman/itt-idris","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziman%2Fitt-idris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziman%2Fitt-idris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziman%2Fitt-idris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziman%2Fitt-idris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziman","download_url":"https://codeload.github.com/ziman/itt-idris/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245779431,"owners_count":20670684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-15T13:25:51.621Z","updated_at":"2026-02-12T05:10:49.949Z","avatar_url":"https://github.com/ziman.png","language":"Idris","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ITT\n\nITT infers quantity/erasure annotations from pattern matching dependent programs.\n\nITT supports the following modalities:\n* **I** (irrelevance) -- erased at runtime, disregarded in conversion checks\n* **E** (erased) -- erased at runtime, subject to conversion checks\n* **L** (linear) -- present at runtime, linear\n* **R** (unrestricted) -- present at runtime, unrestricted\n\nITT can infer all of them by interleaving type checking and constraint solving\nusing an external solver.\n\nThe inference algorithm does not need any modality annotations to work.\nHowever, any \"primitives\" you postulate have no bodies\nso the minimal consistent annotation is \"everything is irrelevant\".\nYou'll probably want to override this to give more meaning to your primitives.\n\nYou can look at [one of the example programs](https://github.com/ziman/itt-idris/blob/master/examples/simple.itt)\nand [its output](https://github.com/ziman/itt-idris/blob/master/examples/simple.out).\nHere's a [vector length program](https://github.com/ziman/itt-idris/blob/master/examples/vect.itt)\nand [its output](https://github.com/ziman/itt-idris/blob/master/examples/vect.out).\n\n## Making it easier\n\nInference gets easier if you don't need to support all modalities.\n\n* **I** requires interleaving conversion checking and constraint solving,\n  iteratively, until you reach a fixed point where no new conversions arise.\n\n* **L** requires counting constraints, which interferes with evar equalities.\n  Namely, you can no longer express equality `p ~ q` as `(p -\u003e q) /\\ (q -\u003e p)`.\n  I use an external SMT solver to get it done.\n\nIf you leave out either of the two, you get an easier problem to solve\nwhen inferring annotations.\n\n## Usage\n\n```\n$ ./itt examples/simple.itt\n```\n(Will automatically build if out of date.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziman%2Fitt-idris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziman%2Fitt-idris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziman%2Fitt-idris/lists"}