{"id":14966207,"url":"https://github.com/lapin0t/ogs","last_synced_at":"2026-02-24T08:34:54.196Z","repository":{"id":237268392,"uuid":"794168081","full_name":"Lapin0t/ogs","owner":"Lapin0t","description":"operational game semantics, formalized in Coq","archived":false,"fork":false,"pushed_at":"2025-02-07T15:56:04.000Z","size":1031,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T10:54:20.288Z","etag":null,"topics":["coq","semantics"],"latest_commit_sha":null,"homepage":"https://lapin0t.github.io/ogs/Readme.html","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/Lapin0t.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":"2024-04-30T15:28:38.000Z","updated_at":"2025-01-17T15:45:01.000Z","dependencies_parsed_at":"2024-05-16T06:15:04.860Z","dependency_job_id":"cfd286a5-2f36-4738-b2e1-47c31287c857","html_url":"https://github.com/Lapin0t/ogs","commit_stats":{"total_commits":330,"total_committers":7,"mean_commits":"47.142857142857146","dds":0.5151515151515151,"last_synced_commit":"5f93308da53c7542bd6112600922ea0b444c89a3"},"previous_names":["lapin0t/ogs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lapin0t/ogs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lapin0t%2Fogs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lapin0t%2Fogs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lapin0t%2Fogs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lapin0t%2Fogs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lapin0t","download_url":"https://codeload.github.com/Lapin0t/ogs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lapin0t%2Fogs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279101350,"owners_count":26103775,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"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":["coq","semantics"],"created_at":"2024-09-24T13:36:00.580Z","updated_at":"2025-10-15T18:31:15.733Z","avatar_url":"https://github.com/Lapin0t.png","language":"Coq","readme":"# An abstract, certified account of operational game semantics\n\nThis is the companion artifact to the ESOP paper. The main contributions of\nthis library are:\n\n- an independent implementation of an indexed counterpart to the\n  InteractionTree Coq library with support for guarded and eventually guarded\n  recursion\n- an abstract OGS model of an axiomatised language proven sound w.r.t.\n  substitution equivalence\n- several instantiations of this abstract result to concrete\n  languages: simply-typed lambda-calculus with recursive functions,\n  untyped lambda calculus, Downen and Ariola\\'s polarized system D and\n  system L.\n\n## Meta\n\n- Author(s):\n  - Peio Borthelle\n  - Tom Hirschowitz\n  - Guilhem Jaber\n  - Yannick Zakowski\n- License: GPLv3\n- Compatible Coq versions: 8.17\n- Additional dependencies:\n  - dune\n  - [Equations](https://github.com/mattam82/Coq-Equations)\n  - [Coinduction](https://github.com/damien-pous/coinduction)\n  - [Alectryon](https://github.com/cpitclaudel/alectryon)\n- Coq namespace: `OGS`\n- [Documentation](https://lapin0t.github.io/ogs/Readme.html)\n\n## Getting Started\n\nTo simply typecheck the Coq proofs, we provide a Docker image preloaded with\nall the dependencies. The instructions to run it are given below. If instead\nyou want to manually install the OGS library on your own system, follow the\ninstructions from the section \"Local Installation\" at the end of the file.\n\nFirst, ensure that your docker daemon is running.\n\nWe recommend building the docker image from source, by executing the following\ncommand from the root of the repository. Note that this requires network access\nand will download around 1.5GiB from `hub.docker.com`.\n\n``` shell\nmake docker-build\n```\n\nAlternatively, if you prefer, you can download the precompiled image\n`docker_coq-ogs.tar.gz` from the\n[Zenodo archive](https://doi.org/10.5281/zenodo.14627318) of this artifact, and\nload it into docker with the following command.\n\n``` shell\ndocker image load -i path/to/docker_coq-ogs.tar.gz\n```\n\nAfter the image is built or loaded from the file, verify that it is indeed\nlisted by the following command.\n\n``` shell\ndocker image ls coq-ogs:latest\n```\n\nThis image contains the full code artifact in the directory `/home/coq/ogs`. The\ndefault command for the image typechecks the whole repository. Run it with a\ntty to see the progress with the following command. This should take around\n3-5min and conclude by displaying information about several soudness theorems.\n\n``` shell\ndocker run --tty coq-ogs:latest\n```\n\n## Step-by-Step Reproduction\n\nThe above \"Getting Started\" section already describes how to typecheck the\nwhole repository, validating our claims of certification from the paper. The\nconcluding output arises from a special file which we have included,\n`theories/Checks.v`, which imports core theorems, displays their type and list\nof arguments, as well as the assumptions (axioms) they depend on.\n\nIf you wish to further inspect the repository, the following command will\nstart an interactive shell inside the container.\n\n``` shell\ndocker run --tty --interactive coq-ogs:latest\n```\n\nThe following section details in more precision the content of each file\nand their relationship to the paper. We have furthermore tried to thoroughly\ncomment most parts of the development. If you prefer to navigate the code\nin a web browser, an HTML rendering of the whole code together with the proof\nstate during intermediate steps is provided at the following URL:\n\nhttps://lapin0t.github.io/ogs/Readme.html\n\n## Content\n\n### Structure of the repository\n\nThe Coq source code is contained in the `theory/` directory, which has the\nfollowing structure, in approximate order of dependency.\n\n- [Readme.v](https://lapin0t.github.io/ogs/Readme.html): This file.\n- [Prelude.v](https://lapin0t.github.io/ogs/Prelude.html): Imports and setup.\n- `Utils/` directory: general utilities.\n  - [Rel.v](https://lapin0t.github.io/ogs/Rel.html): Generalities for relations\n    over type families.\n  - [Psh.v](https://lapin0t.github.io/ogs/Psh.html): Generalities for type\n    families.\n- `Ctx/` directory: general metatheory of substitution. This material has been\n  largely left untold in the paper, and as explained in the artifact report, we\n  introduce a novel gadget for abstracting over scope and variable\n  representations.\n  - [Family.v](https://lapin0t.github.io/ogs/Family.html): Definition of scoped\n    and sorted families (Def. 4).\n  - [Abstract.v](https://lapin0t.github.io/ogs/Abstract.html): Definition of\n    scope structures. The comments make this file a good entry-point to the\n    understand the constructions from this directory.\n  - [Assignment.v](https://lapin0t.github.io/ogs/Assignment.html): Generic\n    definition of assignments (Def. 5 and 6).\n  - [Renaming.v](https://lapin0t.github.io/ogs/Renaming.html): Generic\n    definition of renamings as variable assignments, together with their\n    important equational laws.\n  - [Ctx.v](https://lapin0t.github.io/ogs/Ctx.html): Definition of concrete\n    contexts (lists) and dependently-typed DeBruijn indices.\n  - [Covering.v](https://lapin0t.github.io/ogs/Covering.html): Instanciation of\n    the scope structure for concrete contexts from\n    [Ctx.v](https://lapin0t.github.io/ogs/Ctx.html).\n  - [DirectSum.v](https://lapin0t.github.io/ogs/DirectSum.html): Direct sum of\n    scope structures.\n  - [Subset.v](https://lapin0t.github.io/ogs/Subset.html): Sub-scope structure.\n  - [Subst.v](https://lapin0t.github.io/ogs/Subst.html): Axiomatization of\n    substitution monoid and substitution module (Def. 7 and 8), axiomatization of\n    clear-cut variables (Def. 27).\n- `ITree/` directory: implementation of a variant of interaction trees\n  over indexed types.\n  - [Event.v](https://lapin0t.github.io/ogs/Event.html): Indexed events (i.e.,\n    indexed containers) parameterizing the interactions of an itree.\n  - [ITree.v](https://lapin0t.github.io/ogs/ITree.html): Coinductive definition.\n  - [Eq.v](https://lapin0t.github.io/ogs/Eq.html): Strong and weak bisimilarity\n    over interaction trees.\n  - [Structure.v](https://lapin0t.github.io/ogs/Structure.html): Combinators\n    (definitions) for the monadic structure and unguarded iteration (Def. 31).\n  - [Properties.v](https://lapin0t.github.io/ogs/Properties.html): General\n    properties of the combinators (Prop. 3).\n  - [Guarded.v](https://lapin0t.github.io/ogs/Guarded.html): (Eventually)\n    guarded equations and iterations over them, together with their unicity\n    property (Def. 30, 33 and 34 and Prop. 5).\n  - [Delay.v](https://lapin0t.github.io/ogs/Delay.html): Definition of the\n    delay monad (as a special case of interaction trees over the empty event)\n    (Def. 9 and 10).\n- `OGS/` directory: construction of a sound OGS model for an abstract language\n  machine.\n  - [Obs.v](https://lapin0t.github.io/ogs/Obs.html): Axiomatization of\n    observation structure (Def. 12) and normal forms (part of Def. 13).\n  - [Machine.v](https://lapin0t.github.io/ogs/Machine.html): Axiomatization of\n    evaluation structures (Def. 11), language machines (Def. 13) and focused\n    redexes (Def. 28).\n  - [Game.v](https://lapin0t.github.io/ogs/Game.html): Abstract games (Def. 16\n    and 18) and OGS game definition (Def. 21--23).\n  - [Strategy.v](https://lapin0t.github.io/ogs/Strategy.html): Machine strategy\n    (Def. 24--26) and composition.\n  - [CompGuarded.v](https://lapin0t.github.io/ogs/CompGuarded.html): Proof of\n    eventual guardedness of the equation defining the composition of strategies\n    (Prop. 6).\n  - [Adequacy.v](https://lapin0t.github.io/ogs/Adequacy.html): Proof of\n    adequacy of composition (Prop. 7).\n  - [Congruence.v](https://lapin0t.github.io/ogs/Congruence.html): Proof of\n    congruence of composition (Prop. 4).\n  - [Soundness.v](https://lapin0t.github.io/ogs/Soundness.html): Proof of\n    soundness of the OGS (Thm. 8).\n- `Examples/` directory: concrete language machines instanciating the generic\n  construction and soundness theorem.\n  - [STLC_CBV.v](https://lapin0t.github.io/ogs/STLC_CBV.html): Simply typed,\n    call-by-value, lambda calculus, with a unit type and recursive functions.\n    This example is the most commented, with a complete walk-through of the\n    instanciation.\n  - [ULC_CBV.v](https://lapin0t.github.io/ogs/ULC_CBV.html): Pure, untyped,\n    call-by-value, lambda calculus. This example demonstrate that the\n    intrinsically typed and scoped approach still handles untyped calculi, by\n    treating them as \"unityped\".\n  - [SystemD.v](https://lapin0t.github.io/ogs/SystemD.html): Mu-mu-tilde\n    calculus variant System D from Downen and Ariola, polarized. This is\n    our \"flagship\" example, as it is a very expressive calculus. We have\n    dropped existential and universal type quantifier as our framework only\n    captures simple types. We have added a slightly ad-hoc construction to\n    enable general recursion, making the calculus non-normalizing.\n  - [SystemL_CBV.v](https://lapin0t.github.io/ogs/SystemL_CBV.html):\n    mu-mu-tilde calculus variant System L, in call by value\n    (i.e., lambda-bar-mu-mu-tilde-Q calculus from Herbelin and Curien).\n- [Checks.v](https://lapin0t.github.io/ogs/Checks.html): Interactively display\n  information about the most important theorems.\n\n## Axioms\n\nThe whole development relies only on axiom K, a conventional and sound axiom\nfrom Coq\\'s standard library (more precisely,\n[`Eq_rect_eq.rect_eq`](https://coq.inria.fr/doc/V8.19.0/stdlib/Coq.Logic.Eqdep.html#Eq_rect_eq.eq_rect_eq).\nIt is used by `Equations` to perform some dependent pattern matching.\n\nThis fact can be verified from the output of typechecking `Checks.v`. It can\nalso be double checked in an interactive mode.\n\n- For the abstract result of soundness of the OGS by running\n  `Print Assumptions ogs_correction.` at the end of\n  [Soundness.v](https://lapin0t.github.io/ogs/Soundness.html).\n- For any particular example, for instance by running\n  `Print Assumptions stlc_ciu_correct.` at the end of\n  [STLC_CBV.v](https://lapin0t.github.io/ogs/STLC_CBV.html).\n\n## Local Installation\n\nThe most convenient way to experiment and develop with this library is to\ninstall Coq locally and use some IDE such as emacs. To do so, first ensure you\nhave the source code for the project or download it with the following command.\n\n``` shell\ngit clone -b esop25 https://github.com/lapin0t/ogs.git\ncd ogs\n```\n\nTo install the Coq dependencies, first ensure you have a working opam\ninstallation. This should usually be obtained from your systems package\ndistribution, see https://opam.ocaml.org/doc/Install.html for further\ninformation.\n\nCheck if you have added the `coq-released` package repository with the command\n`opam repo`. If it does not appear, add it with the following command.\n\n``` shell\nopam repo add coq-released https://coq.inria.fr/opam/released\n```\n\nThen, from the root of the repository, install the dependencies with\nthe following command\n\n``` shell\nopam install --deps-only .\n```\n\nWe stress that the development has been only checked to compile against these\nspecific dependencies. In particular, it does not compiled at the moment\nagainst latest version of `coq-coinduction` due to major changes in the API.\n\nFinally, typecheck the code with the following command, again from the root of\nthe repository. This should take around 3-5min.\n\n``` shell\ndune build\n```\n\n## Generating the Alectryon documentation\n\nTo build the html documentation, first install Alectryon:\n\n``` shell\nopam install \"coq-serapi==8.17.0+0.17.3\"\npython3 -m pip install --user alectryon\n```\n\nThen build the documentation with the following command.\n\n``` shell\nmake doc\n```\n\nThe html should now be generated in the `docs` folder. You can start a\nlocal web server to view it with:\n\n``` shell\nmake serve\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapin0t%2Fogs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flapin0t%2Fogs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapin0t%2Fogs/lists"}