{"id":20428996,"url":"https://github.com/kuba--/ut","last_synced_at":"2025-04-12T19:43:16.105Z","repository":{"id":45086703,"uuid":"138632472","full_name":"kuba--/ut","owner":"kuba--","description":"Yet Another Efficient Unification Algorithm","archived":false,"fork":false,"pushed_at":"2024-08-14T11:39:37.000Z","size":39,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-26T14:01:40.265Z","etag":null,"topics":["logic-programming","prolog","unification","unification-algorithm"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/kuba--.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-06-25T18:09:24.000Z","updated_at":"2025-03-19T06:16:13.000Z","dependencies_parsed_at":"2024-04-11T20:41:16.437Z","dependency_job_id":"2ad0a078-fc35-4925-874f-1775c9c4f245","html_url":"https://github.com/kuba--/ut","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba--%2Fut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba--%2Fut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba--%2Fut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba--%2Fut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuba--","download_url":"https://codeload.github.com/kuba--/ut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625478,"owners_count":21135512,"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":["logic-programming","prolog","unification","unification-algorithm"],"created_at":"2024-11-15T07:32:24.724Z","updated_at":"2025-04-12T19:43:16.083Z","avatar_url":"https://github.com/kuba--.png","language":"Go","readme":"[![GoDoc](https://godoc.org/github.com/kuba--/ut?status.svg)](http://godoc.org/github.com/kuba--/ut)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kuba--/ut)](https://goreportcard.com/report/github.com/kuba--/ut)\n[![Build Status](https://github.com/kuba--/ut/workflows/build/badge.svg)](https://github.com/kuba--/ut/actions?query=workflow%3Abuild)\n[![Version](https://badge.fury.io/gh/kuba--%2Fut.svg)](https://github.com/kuba--/ut/releases)\n\n# ut\nPackage ut implements \"Yet Another Efficient Unification Algorithm\" by Alin Suciu (https://arxiv.org/abs/cs/0603080v1).\n\nThe unification algorithm is at the core of the logic programming paradigm, the first unification algorithm being developed by Robinson. More efficient algorithms were developed later by Martelli and, Montanari.\n\nUnification unifies terms. A term is one of variable, constant, functor, or literal value. A variable starts with an upper case letter and their names are the keys in the map returned by Unify. Constants start with a lowercase letter. Values are integers, floating point values, or strings. As a simple example:\n```go\nx,y := `f(X,Y)`, `f(1,\"hello\")`\n```\nThis would unify the functor f such that the variable `X` is `1` and the variable `Y` is `\"hello\"` in the returned map.\n\n\nHere yet another efficient unification algorithm centered on a specific data structure, called the Unification Table.\n\n```Go\nx, y := \"p(Z,h(Z,W),f(W))\", \"p(f(X),h(Y,f(a)),Y)\"\nmgu := ut.Unify(x, y)\nfmt.Println(\"W = \" + mgu[\"W\"])\nfmt.Println(\"X = \" + mgu[\"X\"])\nfmt.Println(\"Y = \" + mgu[\"Y\"])\nfmt.Println(\"Z = \" + mgu[\"Z\"])\n\n// Output:\n// W = f(a)\n// X = f(a)\n// Y = f(f(a))\n// Z = f(f(a))\n\nx, y = \"f(X1,g(X2,X3),X2,b)\", \"f(g(h(a,X5),X2),X1,h(a,X4),X4)\"\nmgu = ut.Unify(x, y)\nfmt.Println(\"X1 = \" + mgu[\"X1\"])\nfmt.Println(\"X2 = \" + mgu[\"X2\"])\nfmt.Println(\"X3 = \" + mgu[\"X3\"])\nfmt.Println(\"X4 = \" + mgu[\"X4\"])\nfmt.Println(\"X5 = \" + mgu[\"X5\"])\n\n// Output:\n// X1 = g(h(a,b),h(a,b))\n// X2 = h(a,b)\n// X3 = h(a,b)\n// X4 = b\n// X5 = b\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuba--%2Fut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuba--%2Fut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuba--%2Fut/lists"}