{"id":14966214,"url":"https://github.com/thamugadi/semantic-preservation","last_synced_at":"2025-10-25T16:30:39.904Z","repository":{"id":199358556,"uuid":"702633782","full_name":"thamugadi/semantic-preservation","owner":"thamugadi","description":"Attempt to prove semantic preservation (forward simulation) for a simple compiler.","archived":false,"fork":false,"pushed_at":"2024-05-01T09:06:34.000Z","size":109,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T07:51:28.254Z","etag":null,"topics":["bisimulation","compiler","coq","dependent-types","formal-verification"],"latest_commit_sha":null,"homepage":"","language":"Coq","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thamugadi.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":"2023-10-09T17:30:12.000Z","updated_at":"2024-11-06T01:13:42.000Z","dependencies_parsed_at":"2023-10-13T12:06:18.968Z","dependency_job_id":"e509f456-b368-4046-981f-3d7942f536b8","html_url":"https://github.com/thamugadi/semantic-preservation","commit_stats":{"total_commits":123,"total_committers":1,"mean_commits":123.0,"dds":0.0,"last_synced_commit":"7fa40431d08ab02ee2cf1a120b59039c300eb49e"},"previous_names":["thamugadi/semantic-preservation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thamugadi%2Fsemantic-preservation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thamugadi%2Fsemantic-preservation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thamugadi%2Fsemantic-preservation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thamugadi%2Fsemantic-preservation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thamugadi","download_url":"https://codeload.github.com/thamugadi/semantic-preservation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238174112,"owners_count":19428627,"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":["bisimulation","compiler","coq","dependent-types","formal-verification"],"created_at":"2024-09-24T13:36:01.282Z","updated_at":"2025-10-25T16:30:39.521Z","avatar_url":"https://github.com/thamugadi.png","language":"Coq","funding_links":[],"categories":[],"sub_categories":[],"readme":"# semantic-preservation\n## Introduction\n\nThe purpose of this repo is to give a minimal example of a compiler for which the forward simulation property is verified. The proof is located in [src/Verification.v](src/Verification.v).\n\nI considered an abstract machine using absolute addresses for ``Jump`` as a target, and one using a BF-like ``Jump`` / ``Ret``, both jumping one instruction after the associated instruction, as a source. The small compiler used is defined in [src/Compiler.v](src/Compiler.v).\n\nThe proof of some lemmas is still missing, and those are admitted for the moment. This was my first real contact with Coq and dependent types, and it allowed me to make progress on the basics. Also, it makes extensive use of CoqHammer, which makes some proofs quite incomprehensible.\n\nThe ``first_attempt`` folder contains previous attempts to prove the property, in particular through an approach using vectors, in the belief that this would simplify the proof of certain lemmas. This was quite true, but it made it too complex to state certain theorems, and I preferred to give up on it.\n\nIt is globally a matter of proving that given two source states p and p' and a target state q, if\n\n- p compiles into q\n- p evaluates into p'\n\nthen there exist q' such as:\n\n- p' compiles into q'\n- q evaluates+ into q'\n\nwhere \"+\" is the transitive closure.\n\nMain reference: https://xavierleroy.org/publi/compcert-backend.pdf\n\n## Semantics\n\n- Small-step semantics for the two abstract machines are defined in [src/Language.v](src/Language.v) and [src/Assembly.v](src/Assembly.v)\n  \n## Simulation property\n\n- The aim of [Leroy's paper](https://xavierleroy.org/publi/compcert-backend.pdf) is to describe how a source program S and a target program C retain the same semantics if the compilation process succeeds.\n- Several relations are defined to express semantic preservation. In [src/Simulation.v](src/Simulation.v) are included the definitions to construct the lockstep, \"plus\", \"option\" and \"star\" simulation relations described in p. 16.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthamugadi%2Fsemantic-preservation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthamugadi%2Fsemantic-preservation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthamugadi%2Fsemantic-preservation/lists"}