{"id":19864157,"url":"https://github.com/sr-lab/coq-tries","last_synced_at":"2025-07-14T11:08:41.328Z","repository":{"id":75386282,"uuid":"147218560","full_name":"sr-lab/coq-tries","owner":"sr-lab","description":"Generic tries in Coq.","archived":false,"fork":false,"pushed_at":"2018-09-06T23:58:55.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T00:29:42.322Z","etag":null,"topics":["coq","generic","library","lookup","search-tree","trie"],"latest_commit_sha":null,"homepage":null,"language":"Coq","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sr-lab.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":"2018-09-03T14:48:40.000Z","updated_at":"2018-09-06T23:58:56.000Z","dependencies_parsed_at":"2023-06-06T08:45:18.152Z","dependency_job_id":null,"html_url":"https://github.com/sr-lab/coq-tries","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sr-lab/coq-tries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fcoq-tries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fcoq-tries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fcoq-tries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fcoq-tries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sr-lab","download_url":"https://codeload.github.com/sr-lab/coq-tries/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fcoq-tries/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265281211,"owners_count":23739870,"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":["coq","generic","library","lookup","search-tree","trie"],"created_at":"2024-11-12T15:17:39.399Z","updated_at":"2025-07-14T11:08:41.300Z","avatar_url":"https://github.com/sr-lab.png","language":"Coq","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generic Tries in Coq\nThis library implements generic tries in Coq, capable of mapping a list of any type to values in another (or the same) type with fast lookup times (linear on the length of the key list) at the expense of greater memory consumption and slower insertion times.\n\n## Usage\nLet's start by defining an empty tree that will map a list of ASCII characters (i.e. a string) to a natural number:\n\n```coq\nDefinition empty := empty_trie ascii nat.\n```\n\nWe can now insert pairs of strings and natural numbers into the trie:\n\n```coq\nDefinition hello := trie_insert ascii_dec empty [\"h\"; \"e\"; \"l\"; \"l\"; \"o\"] 1.\nDefinition happy := trie_insert ascii_dec hello [\"h\"; \"a\"; \"p\"; \"p\"; \"y\"] 2.\nDefinition world := trie_insert ascii_dec happy [\"w\"; \"o\"; \"r\"; \"l\"; \"d\"] 3.\n```\n\nUpon calling `Compute world.` we get the following:\n\n```coq\n= Root None\n  [Node None \"w\" [Node None \"o\" [Node None \"r\" [Node None \"l\" [Node (Some 3) \"d\" []]]]];\n   Node None \"h\"\n     [Node None \"a\" [Node None \"p\" [Node None \"p\" [Node (Some 2) \"y\" []]]];\n      Node None \"e\" [Node None \"l\" [Node None \"l\" [Node (Some 1) \"o\" []]]]]]\n : Trie ascii nat\n```\n\nTo retrieve a value, we can do so thusly:\n\n```coq\nCompute trie_get ascii_dec world [\"h\"; \"a\"; \"p\"; \"p\"; \"y\"].\n```\n\nThis gives the result:\n\n```coq\n= Some 2\n  : option nat\n```\n\n## Limitations\nThis data structure does not have any accompanying proofs. This may be addresed in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsr-lab%2Fcoq-tries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsr-lab%2Fcoq-tries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsr-lab%2Fcoq-tries/lists"}