{"id":20245613,"url":"https://github.com/xsnow/distributingtypes","last_synced_at":"2026-05-12T14:09:31.257Z","repository":{"id":128773256,"uuid":"536838423","full_name":"XSnow/DistributingTypes","owner":"XSnow","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-24T08:25:39.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T02:08:33.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Coq","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XSnow.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}},"created_at":"2022-09-15T02:42:06.000Z","updated_at":"2022-09-15T02:47:37.000Z","dependencies_parsed_at":"2023-08-25T07:50:05.403Z","dependency_job_id":null,"html_url":"https://github.com/XSnow/DistributingTypes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XSnow%2FDistributingTypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XSnow%2FDistributingTypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XSnow%2FDistributingTypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XSnow%2FDistributingTypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XSnow","download_url":"https://codeload.github.com/XSnow/DistributingTypes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241691701,"owners_count":20004087,"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-11-14T09:22:32.609Z","updated_at":"2026-05-12T14:09:26.237Z","avatar_url":"https://github.com/XSnow.png","language":"Coq","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributing Intersection and Union Types with Splits and Duality (Artifact)\n\nDistributingTypes | Xuejing Huang 2021 | Distributed under the terms of [the GPL-v3 license](./LICENSE)\n\n- The companion paper can be found at \u003chttps://doi.org/10.1145/3473594\u003e.\n- [impl/](./impl) for the Haskell implementation\n- [coq/](./coq) for the Coq formalization\n- [spec/](./spec) for the Ott specification (that is used to generate the syntax\ndefinition in Coq)\n\n## Haskell Implementation\n\n- Fig. 3 is in [Algo_bcd.hs](./impl/Algo_bcd.hs)\n- Fig. 9 and 10 are in [Algo_duo.hs](./impl/Algo_duo.hs)\n- [Algo_sub.hs](./impl/Algo_sub.hs) implements the algorithmic subtyping defined\nin Fig. 6.\n- [Algo_alt.hs](./impl/Algo_alt.hs) implements the algorithmic duotyping in an alternative way (discussed in Section 5.4).\n\n### Building Instructions\n\n1. Install GHCi.\n2. Enter [impl/](./impl) directory.\n3. Run ghci with the code loaded. There are some example defined in each .hs\nthat can be used to test.\n\n   ```sh\n   ghci Algo2.hs\n   *Main\u003e test1\n   \"(Int -\u003e (Int /\\\\ Int)) \u003c: (Int -\u003e (Int /\\\\ Int))  Result: True\"\n   ```\n\n\n## Coq Formalization\n\n### Third Party Materials\n\nWe use [LibTactics.v](./coq/LibTactics.v) from [the TLC Coq library](https://www.chargueraud.org/softs/tlc/)\nby Arthur Chargueraud.\n\n### Building Instructions\n\nOur Coq proofs are verified in the latest version of Coq: **8.13.2**.\n\n#### Prerequisites\n\n1. Install Coq 8.13.2.\n   The recommended way to install Coq is via `OPAM`. Refer to\n   [here](https://coq.inria.fr/opam/www/using.html) for detailed steps. Or one could\n   download the pre-built packages for Windows and MacOS via\n   [here](https://github.com/coq/coq/releases/tag/V8.13.2). Choose a suitable installer\n   according to your platform.\n\n2. Make sure `Coq` is installed (type `coqc` in the terminal, if you see \"command\n   not found\" this means you have not properly installed Coq).\n\n#### Build and Compile the Proofs\n\n1. Enter [coq/](./coq) directory.\n\n2. Type `make` in the terminal to build and compile the proofs.\n\n3. You should see something like the following (suppose `\u003e` is the prompt):\n   ```sh\n   coq_makefile -arg '-w -variable-collision,-meta-collision,-require-in-module' -f _CoqProject -o CoqSrc.mk\n   COQDEP VFILES\n   COQC LibTactics.v\n   COQC Definitions.v\n   ```\n4. `Definitions.v` is generated by Ott. To reproduce it (some comments will be\nlost), please remove it and run `make` (with Ott installed).\n\n### Proof Structure\n\n- [Definitions.v](./coq/Definitions.v) contains all definitions. It is generated\nby [spec/rules.ott](spec/rules.ott).\n\n- [TypeSize.v](./coq/TypeSize.v) defines the size of type and proves some\nstraightforward lemmas in it. It helps us to do induction on the size of type.\n\n- [LibTactics.v](./coq/LibTactics.v) is a Coq library by Arthur Chargueraud.\nWe downloaded it from [here](http://gallium.inria.fr/~fpottier/ssphs/LibTactics.html).\n\n- [Duotyping.v](./coq/Duotyping.v) is the main file. It contains most theorems\nand lemmas in Sec. 4: Lemma 4.1, Theorem 4.5, Theorem 4.6, Lemma 4.7, Lemma 4.8,\nLemma 4.9, Theorem 4.10, and Theorem 4.11.\n\n- [Equivalence.v](./coq/Equivalence.v) relates the two declarative systems and\nthe two algorithmic systems, respectively.\nIt contains Theorem 4.2, Lemma 4.3, and Theorem 4.4.\n\n- [Subtyping.v](./coq/Subtyping.v) contains some lemmas about the two subtyping\nsystems. It is not discussed in the paper. Three of them are used in the\nproof of Theorem 4.4 in [Equivalence.v](./coq/Equivalence.v).\n\n- [DistAnd.v](./coq/DistAnd.v) justifies one statement in the paper. It shows\nthat the rule DS-distAnd (Fig. 4) is omittable.\n\n- [DistSubtyping.v](./coq/DistSubtyping.v) is a stand-alone file which contains\nsubtyping definitions and related lemmas and theorems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsnow%2Fdistributingtypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxsnow%2Fdistributingtypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsnow%2Fdistributingtypes/lists"}