{"action":"closed","number":48,"pull_request":{"url":"https://api.github.com/repos/logpy/logpy/pulls/48","id":70114603,"html_url":"https://github.com/logpy/logpy/pull/48","diff_url":"https://github.com/logpy/logpy/pull/48.diff","patch_url":"https://github.com/logpy/logpy/pull/48.patch","issue_url":"https://api.github.com/repos/logpy/logpy/issues/48","number":48,"state":"closed","locked":false,"title":"Enhanced conso","user":{"login":"lucaswiman","id":123110,"avatar_url":"https://avatars.githubusercontent.com/u/123110?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswiman","html_url":"https://github.com/lucaswiman","followers_url":"https://api.github.com/users/lucaswiman/followers","following_url":"https://api.github.com/users/lucaswiman/following{/other_user}","gists_url":"https://api.github.com/users/lucaswiman/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswiman/subscriptions","organizations_url":"https://api.github.com/users/lucaswiman/orgs","repos_url":"https://api.github.com/users/lucaswiman/repos","events_url":"https://api.github.com/users/lucaswiman/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswiman/received_events","type":"User","site_admin":false},"body":"Partial implementation of #46. This PR adds an `LCons` class, and updates the `conso` relation to use it. This increases the capabilities of `conso` significantly, and better matches the behavior of other successful minikanren implementations like `core.logic` in clojure.\r\n\r\n This is somewhat similar to the implementation in [core.logic](https://github.com/clojure/core.logic/blob/master/src/main/clojure/clojure/core/logic.clj), though using the unification machinery of the `unification` library instead.\r\n\r\n## Usage examples\r\n\r\n```\r\n>>> unify(LCons(1, (x, )), (x, y))\r\n{~x: 1, ~y: 1}\r\n>>> run(1, y, conso(1, x, y), conso(2, z, x))[0]\r\nLCons(1, LCons(2, ~z))\r\n>>> list(_)\r\n[1, 2]\r\n```\r\nNote that the `LCons` object has an `__iter__` method that stops when it runs into an unbound tail. I think this will make it easier to consume the results in practice. \r\n\r\nAFAICT, any cases where `run` returns a value like `LCons(1, LCons(2, ~1))`, then `(1, 2) == LCons(1, LCons(2, ()))` would actually satisfy all the goals that were provided, though I don't have a formal proof of that. If counterexamples are found, it might make sense to change that behavior.","created_at":"2016-05-15T07:36:22Z","updated_at":"2016-05-15T20:46:01Z","closed_at":"2016-05-15T20:46:01Z","merged_at":"2016-05-15T20:46:01Z","merge_commit_sha":"5ef2fc7f3390f90122bb2a5c6fbe29d0d419843c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/logpy/logpy/pulls/48/commits","review_comments_url":"https://api.github.com/repos/logpy/logpy/pulls/48/comments","review_comment_url":"https://api.github.com/repos/logpy/logpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/logpy/logpy/issues/48/comments","statuses_url":"https://api.github.com/repos/logpy/logpy/statuses/c936db4e42f92e6dda9fcd1d3432a45176c0fc33","head":{"label":"lucaswiman:lcons","ref":"lcons","sha":"c936db4e42f92e6dda9fcd1d3432a45176c0fc33","user":{"login":"lucaswiman","id":123110,"avatar_url":"https://avatars.githubusercontent.com/u/123110?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswiman","html_url":"https://github.com/lucaswiman","followers_url":"https://api.github.com/users/lucaswiman/followers","following_url":"https://api.github.com/users/lucaswiman/following{/other_user}","gists_url":"https://api.github.com/users/lucaswiman/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswiman/subscriptions","organizations_url":"https://api.github.com/users/lucaswiman/orgs","repos_url":"https://api.github.com/users/lucaswiman/repos","events_url":"https://api.github.com/users/lucaswiman/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswiman/received_events","type":"User","site_admin":false},"repo":{"id":57938696,"name":"logpy","full_name":"lucaswiman/logpy","owner":{"login":"lucaswiman","id":123110,"avatar_url":"https://avatars.githubusercontent.com/u/123110?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswiman","html_url":"https://github.com/lucaswiman","followers_url":"https://api.github.com/users/lucaswiman/followers","following_url":"https://api.github.com/users/lucaswiman/following{/other_user}","gists_url":"https://api.github.com/users/lucaswiman/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswiman/subscriptions","organizations_url":"https://api.github.com/users/lucaswiman/orgs","repos_url":"https://api.github.com/users/lucaswiman/repos","events_url":"https://api.github.com/users/lucaswiman/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswiman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lucaswiman/logpy","description":"Logic Programming in Python","fork":true,"url":"https://api.github.com/repos/lucaswiman/logpy","forks_url":"https://api.github.com/repos/lucaswiman/logpy/forks","keys_url":"https://api.github.com/repos/lucaswiman/logpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lucaswiman/logpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lucaswiman/logpy/teams","hooks_url":"https://api.github.com/repos/lucaswiman/logpy/hooks","issue_events_url":"https://api.github.com/repos/lucaswiman/logpy/issues/events{/number}","events_url":"https://api.github.com/repos/lucaswiman/logpy/events","assignees_url":"https://api.github.com/repos/lucaswiman/logpy/assignees{/user}","branches_url":"https://api.github.com/repos/lucaswiman/logpy/branches{/branch}","tags_url":"https://api.github.com/repos/lucaswiman/logpy/tags","blobs_url":"https://api.github.com/repos/lucaswiman/logpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lucaswiman/logpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lucaswiman/logpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/lucaswiman/logpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lucaswiman/logpy/statuses/{sha}","languages_url":"https://api.github.com/repos/lucaswiman/logpy/languages","stargazers_url":"https://api.github.com/repos/lucaswiman/logpy/stargazers","contributors_url":"https://api.github.com/repos/lucaswiman/logpy/contributors","subscribers_url":"https://api.github.com/repos/lucaswiman/logpy/subscribers","subscription_url":"https://api.github.com/repos/lucaswiman/logpy/subscription","commits_url":"https://api.github.com/repos/lucaswiman/logpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/lucaswiman/logpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/lucaswiman/logpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/lucaswiman/logpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/lucaswiman/logpy/contents/{+path}","compare_url":"https://api.github.com/repos/lucaswiman/logpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lucaswiman/logpy/merges","archive_url":"https://api.github.com/repos/lucaswiman/logpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lucaswiman/logpy/downloads","issues_url":"https://api.github.com/repos/lucaswiman/logpy/issues{/number}","pulls_url":"https://api.github.com/repos/lucaswiman/logpy/pulls{/number}","milestones_url":"https://api.github.com/repos/lucaswiman/logpy/milestones{/number}","notifications_url":"https://api.github.com/repos/lucaswiman/logpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lucaswiman/logpy/labels{/name}","releases_url":"https://api.github.com/repos/lucaswiman/logpy/releases{/id}","deployments_url":"https://api.github.com/repos/lucaswiman/logpy/deployments","created_at":"2016-05-03T03:28:09Z","updated_at":"2016-05-03T03:28:12Z","pushed_at":"2016-05-15T20:25:35Z","git_url":"git://github.com/lucaswiman/logpy.git","ssh_url":"git@github.com:lucaswiman/logpy.git","clone_url":"https://github.com/lucaswiman/logpy.git","svn_url":"https://github.com/lucaswiman/logpy","homepage":null,"size":365,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"logpy:master","ref":"master","sha":"13e351d3a37e314f41ba185391a12e823fab2e0c","user":{"login":"logpy","id":3117678,"avatar_url":"https://avatars.githubusercontent.com/u/3117678?v=3","gravatar_id":"","url":"https://api.github.com/users/logpy","html_url":"https://github.com/logpy","followers_url":"https://api.github.com/users/logpy/followers","following_url":"https://api.github.com/users/logpy/following{/other_user}","gists_url":"https://api.github.com/users/logpy/gists{/gist_id}","starred_url":"https://api.github.com/users/logpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logpy/subscriptions","organizations_url":"https://api.github.com/users/logpy/orgs","repos_url":"https://api.github.com/users/logpy/repos","events_url":"https://api.github.com/users/logpy/events{/privacy}","received_events_url":"https://api.github.com/users/logpy/received_events","type":"Organization","site_admin":false},"repo":{"id":7533020,"name":"logpy","full_name":"logpy/logpy","owner":{"login":"logpy","id":3117678,"avatar_url":"https://avatars.githubusercontent.com/u/3117678?v=3","gravatar_id":"","url":"https://api.github.com/users/logpy","html_url":"https://github.com/logpy","followers_url":"https://api.github.com/users/logpy/followers","following_url":"https://api.github.com/users/logpy/following{/other_user}","gists_url":"https://api.github.com/users/logpy/gists{/gist_id}","starred_url":"https://api.github.com/users/logpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logpy/subscriptions","organizations_url":"https://api.github.com/users/logpy/orgs","repos_url":"https://api.github.com/users/logpy/repos","events_url":"https://api.github.com/users/logpy/events{/privacy}","received_events_url":"https://api.github.com/users/logpy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/logpy/logpy","description":"Logic Programming in Python","fork":false,"url":"https://api.github.com/repos/logpy/logpy","forks_url":"https://api.github.com/repos/logpy/logpy/forks","keys_url":"https://api.github.com/repos/logpy/logpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/logpy/logpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/logpy/logpy/teams","hooks_url":"https://api.github.com/repos/logpy/logpy/hooks","issue_events_url":"https://api.github.com/repos/logpy/logpy/issues/events{/number}","events_url":"https://api.github.com/repos/logpy/logpy/events","assignees_url":"https://api.github.com/repos/logpy/logpy/assignees{/user}","branches_url":"https://api.github.com/repos/logpy/logpy/branches{/branch}","tags_url":"https://api.github.com/repos/logpy/logpy/tags","blobs_url":"https://api.github.com/repos/logpy/logpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/logpy/logpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/logpy/logpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/logpy/logpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/logpy/logpy/statuses/{sha}","languages_url":"https://api.github.com/repos/logpy/logpy/languages","stargazers_url":"https://api.github.com/repos/logpy/logpy/stargazers","contributors_url":"https://api.github.com/repos/logpy/logpy/contributors","subscribers_url":"https://api.github.com/repos/logpy/logpy/subscribers","subscription_url":"https://api.github.com/repos/logpy/logpy/subscription","commits_url":"https://api.github.com/repos/logpy/logpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/logpy/logpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/logpy/logpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/logpy/logpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/logpy/logpy/contents/{+path}","compare_url":"https://api.github.com/repos/logpy/logpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/logpy/logpy/merges","archive_url":"https://api.github.com/repos/logpy/logpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/logpy/logpy/downloads","issues_url":"https://api.github.com/repos/logpy/logpy/issues{/number}","pulls_url":"https://api.github.com/repos/logpy/logpy/pulls{/number}","milestones_url":"https://api.github.com/repos/logpy/logpy/milestones{/number}","notifications_url":"https://api.github.com/repos/logpy/logpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/logpy/logpy/labels{/name}","releases_url":"https://api.github.com/repos/logpy/logpy/releases{/id}","deployments_url":"https://api.github.com/repos/logpy/logpy/deployments","created_at":"2013-01-10T02:26:50Z","updated_at":"2016-05-06T14:57:08Z","pushed_at":"2016-05-15T20:46:01Z","git_url":"git://github.com/logpy/logpy.git","ssh_url":"git@github.com:logpy/logpy.git","clone_url":"https://github.com/logpy/logpy.git","svn_url":"https://github.com/logpy/logpy","homepage":null,"size":482,"stargazers_count":201,"watchers_count":201,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":11,"forks":21,"open_issues":11,"watchers":201,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/logpy/logpy/pulls/48"},"html":{"href":"https://github.com/logpy/logpy/pull/48"},"issue":{"href":"https://api.github.com/repos/logpy/logpy/issues/48"},"comments":{"href":"https://api.github.com/repos/logpy/logpy/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/logpy/logpy/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/logpy/logpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/logpy/logpy/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/logpy/logpy/statuses/c936db4e42f92e6dda9fcd1d3432a45176c0fc33"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"lucaswiman","id":123110,"avatar_url":"https://avatars.githubusercontent.com/u/123110?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswiman","html_url":"https://github.com/lucaswiman","followers_url":"https://api.github.com/users/lucaswiman/followers","following_url":"https://api.github.com/users/lucaswiman/following{/other_user}","gists_url":"https://api.github.com/users/lucaswiman/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswiman/subscriptions","organizations_url":"https://api.github.com/users/lucaswiman/orgs","repos_url":"https://api.github.com/users/lucaswiman/repos","events_url":"https://api.github.com/users/lucaswiman/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswiman/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":6,"additions":103,"deletions":38,"changed_files":2}}