{"id":16313431,"url":"https://github.com/annenkov/trace-monoids","last_synced_at":"2026-02-21T04:01:36.514Z","repository":{"id":46224519,"uuid":"329633385","full_name":"annenkov/trace-monoids","owner":"annenkov","description":"Trace monoids in Cubical Agda","archived":false,"fork":false,"pushed_at":"2024-02-29T14:50:50.000Z","size":66,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T00:17:36.330Z","etag":null,"topics":["concurrency","homotopy-type-theory","monoids","partially-commutative-monoids","trace-monoids"],"latest_commit_sha":null,"homepage":"","language":"Agda","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/annenkov.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":"2021-01-14T14:06:40.000Z","updated_at":"2025-10-08T13:39:44.000Z","dependencies_parsed_at":"2024-02-29T15:51:28.243Z","dependency_job_id":"74f09d74-ced9-4ada-b13e-c159c764923d","html_url":"https://github.com/annenkov/trace-monoids","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/annenkov/trace-monoids","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annenkov%2Ftrace-monoids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annenkov%2Ftrace-monoids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annenkov%2Ftrace-monoids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annenkov%2Ftrace-monoids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annenkov","download_url":"https://codeload.github.com/annenkov/trace-monoids/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annenkov%2Ftrace-monoids/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29672753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T03:11:15.450Z","status":"ssl_error","status_checked_at":"2026-02-21T03:10:34.920Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["concurrency","homotopy-type-theory","monoids","partially-commutative-monoids","trace-monoids"],"created_at":"2024-10-10T21:51:13.522Z","updated_at":"2026-02-21T04:01:36.491Z","avatar_url":"https://github.com/annenkov.png","language":"Agda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trace monoids in Cubical Agda\n\nThe trace monoid is a free partially commutative monoid (not to be confused with **partial** commutative monoids), meaning that some (but not all) letters in strings are allowed to commute.\nWhich letter can commute depends on an independency relation (irreflexive, symmetric). \nThis relation induces an equivalence relation on strings which partitions them into equivalence classes up to commuting letters.\nE.g. `aabcc` and `abacc` belong to the same equivalence class if the letters `a` and `b` are independent.\n\nOne interesting application of trace monoids is semantics of concurrency, where traces concisely capture all possible interleavings given by the independency relation.\n\n# Why Cubical Agda\n\nIn Cubical Agda, one can define such a free monoid with partial commutation using HITs.\nIn this case, traces with commuting letters are just equal, which simplifies equational reasoning.\n\n# The project\n\nThe project explores how to define a trace monoid and how it can be applied to reasoning about database transaction schedules.\n\nAs an example, we consider a simple language with `read` and `write` instructions, along with some arithmetic operations.\nWe define the notion of a serializable schedule and show how equational reasoning can be used to prove that a given schedule is serializable.\nThe use of HITs allows for synthetic reasoning about execution traces up to permutations of independent actions.\nIt's synthetic in the sense that one doesn't have to reason about permutations (or interleavings) of actions explicitly.\n\nWe demonstrate further that the reasoning on traces is sound wrt. store semantics for a read-write language of schedules.\nThe proof methodology is again driven by commuting actions: we define store semantics on traces using the elimination principle for the trace monoid.\nThe elimination principle requires that the commuting action in the trace are respected by the semantic function.\nThis gives us a nice (and idiomatic) way of structuring the soundness proof.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannenkov%2Ftrace-monoids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannenkov%2Ftrace-monoids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannenkov%2Ftrace-monoids/lists"}