{"action":"created","comment":{"url":"https://api.github.com/repos/enthought/sat-solver/pulls/comments/50903927","id":50903927,"diff_hunk":"@@ -12,6 +13,155 @@\n from .assignment_set import AssignmentSet\n from .clause import Clause\n from .policy import DefaultPolicy\n+from simplesat.utils import timed_context\n+\n+\n+class UNSAT(object):\n+\n+    \"\"\"An unsatisfiable set of boolean clauses.\"\"\"\n+\n+    def __init__(self, conflict, learned_clause, assignments, trails):\n+        \"\"\"\n+        Create a new UNSAT object.\n+\n+        Parameters\n+        ----------\n+        conflict : Clause\n+            The clause which has been found to be unsatisfiable.\n+        learned_clause : Clause\n+            The implied change needed to satisfiy the conflict.\n+\n+            This clause is always a learned clause and should always have","path":"simplesat/sat/minisat.py","position":30,"original_position":30,"commit_id":"d8e6e5c66f8c81d5fbf1f1f16a09d621ddd5029f","original_commit_id":"d8e6e5c66f8c81d5fbf1f1f16a09d621ddd5029f","user":{"login":"cournape","id":25111,"avatar_url":"https://avatars.githubusercontent.com/u/25111?v=3","gravatar_id":"","url":"https://api.github.com/users/cournape","html_url":"https://github.com/cournape","followers_url":"https://api.github.com/users/cournape/followers","following_url":"https://api.github.com/users/cournape/following{/other_user}","gists_url":"https://api.github.com/users/cournape/gists{/gist_id}","starred_url":"https://api.github.com/users/cournape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cournape/subscriptions","organizations_url":"https://api.github.com/users/cournape/orgs","repos_url":"https://api.github.com/users/cournape/repos","events_url":"https://api.github.com/users/cournape/events{/privacy}","received_events_url":"https://api.github.com/users/cournape/received_events","type":"User","site_admin":false},"body":"why don't we store the conflicting literal then ?","created_at":"2016-01-26T21:35:45Z","updated_at":"2016-01-26T21:35:45Z","html_url":"https://github.com/enthought/sat-solver/pull/101#discussion_r50903927","pull_request_url":"https://api.github.com/repos/enthought/sat-solver/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/comments/50903927"},"html":{"href":"https://github.com/enthought/sat-solver/pull/101#discussion_r50903927"},"pull_request":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/enthought/sat-solver/pulls/101","id":54741250,"html_url":"https://github.com/enthought/sat-solver/pull/101","diff_url":"https://github.com/enthought/sat-solver/pull/101.diff","patch_url":"https://github.com/enthought/sat-solver/pull/101.patch","issue_url":"https://api.github.com/repos/enthought/sat-solver/issues/101","number":101,"state":"open","locked":false,"title":"Show an error message on failure.","user":{"login":"johntyree","id":108972,"avatar_url":"https://avatars.githubusercontent.com/u/108972?v=3","gravatar_id":"","url":"https://api.github.com/users/johntyree","html_url":"https://github.com/johntyree","followers_url":"https://api.github.com/users/johntyree/followers","following_url":"https://api.github.com/users/johntyree/following{/other_user}","gists_url":"https://api.github.com/users/johntyree/gists{/gist_id}","starred_url":"https://api.github.com/users/johntyree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johntyree/subscriptions","organizations_url":"https://api.github.com/users/johntyree/orgs","repos_url":"https://api.github.com/users/johntyree/repos","events_url":"https://api.github.com/users/johntyree/events{/privacy}","received_events_url":"https://api.github.com/users/johntyree/received_events","type":"User","site_admin":false},"body":"This is the first iteration of error reporting for failed scenarios. Most of the effort has been spent trying to make sure we can quickly grab references to the important conflicting clauses as well as the rules and requirements associated with them.\r\n\r\nThe error is represented as a new class `UNSAT`, which carries along with it the conflicting clause, the set of most recent literal assignments and the clauses that forced them, some helper functions to try to extract information from those clauses and a \"default\" informative string building function.\r\n\r\nNo work has been done to make any of it read nicely.","created_at":"2015-12-29T16:59:56Z","updated_at":"2016-01-26T21:35:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86cd924870618a7c9cf23aed3a1c80af9db369e3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/enthought/sat-solver/pulls/101/commits","review_comments_url":"https://api.github.com/repos/enthought/sat-solver/pulls/101/comments","review_comment_url":"https://api.github.com/repos/enthought/sat-solver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enthought/sat-solver/issues/101/comments","statuses_url":"https://api.github.com/repos/enthought/sat-solver/statuses/d8e6e5c66f8c81d5fbf1f1f16a09d621ddd5029f","head":{"label":"enthought:enh/error-messages-3","ref":"enh/error-messages-3","sha":"d8e6e5c66f8c81d5fbf1f1f16a09d621ddd5029f","user":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"repo":{"id":27783212,"name":"sat-solver","full_name":"enthought/sat-solver","owner":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enthought/sat-solver","description":"SAT solver for use in Enstaller, based on the MiniSat implementation","fork":false,"url":"https://api.github.com/repos/enthought/sat-solver","forks_url":"https://api.github.com/repos/enthought/sat-solver/forks","keys_url":"https://api.github.com/repos/enthought/sat-solver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enthought/sat-solver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enthought/sat-solver/teams","hooks_url":"https://api.github.com/repos/enthought/sat-solver/hooks","issue_events_url":"https://api.github.com/repos/enthought/sat-solver/issues/events{/number}","events_url":"https://api.github.com/repos/enthought/sat-solver/events","assignees_url":"https://api.github.com/repos/enthought/sat-solver/assignees{/user}","branches_url":"https://api.github.com/repos/enthought/sat-solver/branches{/branch}","tags_url":"https://api.github.com/repos/enthought/sat-solver/tags","blobs_url":"https://api.github.com/repos/enthought/sat-solver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enthought/sat-solver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enthought/sat-solver/git/refs{/sha}","trees_url":"https://api.github.com/repos/enthought/sat-solver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enthought/sat-solver/statuses/{sha}","languages_url":"https://api.github.com/repos/enthought/sat-solver/languages","stargazers_url":"https://api.github.com/repos/enthought/sat-solver/stargazers","contributors_url":"https://api.github.com/repos/enthought/sat-solver/contributors","subscribers_url":"https://api.github.com/repos/enthought/sat-solver/subscribers","subscription_url":"https://api.github.com/repos/enthought/sat-solver/subscription","commits_url":"https://api.github.com/repos/enthought/sat-solver/commits{/sha}","git_commits_url":"https://api.github.com/repos/enthought/sat-solver/git/commits{/sha}","comments_url":"https://api.github.com/repos/enthought/sat-solver/comments{/number}","issue_comment_url":"https://api.github.com/repos/enthought/sat-solver/issues/comments{/number}","contents_url":"https://api.github.com/repos/enthought/sat-solver/contents/{+path}","compare_url":"https://api.github.com/repos/enthought/sat-solver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enthought/sat-solver/merges","archive_url":"https://api.github.com/repos/enthought/sat-solver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enthought/sat-solver/downloads","issues_url":"https://api.github.com/repos/enthought/sat-solver/issues{/number}","pulls_url":"https://api.github.com/repos/enthought/sat-solver/pulls{/number}","milestones_url":"https://api.github.com/repos/enthought/sat-solver/milestones{/number}","notifications_url":"https://api.github.com/repos/enthought/sat-solver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enthought/sat-solver/labels{/name}","releases_url":"https://api.github.com/repos/enthought/sat-solver/releases{/id}","deployments_url":"https://api.github.com/repos/enthought/sat-solver/deployments","created_at":"2014-12-09T19:31:39Z","updated_at":"2016-01-13T07:34:16Z","pushed_at":"2016-01-25T19:19:59Z","git_url":"git://github.com/enthought/sat-solver.git","ssh_url":"git@github.com:enthought/sat-solver.git","clone_url":"https://github.com/enthought/sat-solver.git","svn_url":"https://github.com/enthought/sat-solver","homepage":"","size":808,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":3,"default_branch":"master"}},"base":{"label":"enthought:master","ref":"master","sha":"f2e949cd362b3b07704ef60fced4bbda4ccaf402","user":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"repo":{"id":27783212,"name":"sat-solver","full_name":"enthought/sat-solver","owner":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enthought/sat-solver","description":"SAT solver for use in Enstaller, based on the MiniSat implementation","fork":false,"url":"https://api.github.com/repos/enthought/sat-solver","forks_url":"https://api.github.com/repos/enthought/sat-solver/forks","keys_url":"https://api.github.com/repos/enthought/sat-solver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enthought/sat-solver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enthought/sat-solver/teams","hooks_url":"https://api.github.com/repos/enthought/sat-solver/hooks","issue_events_url":"https://api.github.com/repos/enthought/sat-solver/issues/events{/number}","events_url":"https://api.github.com/repos/enthought/sat-solver/events","assignees_url":"https://api.github.com/repos/enthought/sat-solver/assignees{/user}","branches_url":"https://api.github.com/repos/enthought/sat-solver/branches{/branch}","tags_url":"https://api.github.com/repos/enthought/sat-solver/tags","blobs_url":"https://api.github.com/repos/enthought/sat-solver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enthought/sat-solver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enthought/sat-solver/git/refs{/sha}","trees_url":"https://api.github.com/repos/enthought/sat-solver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enthought/sat-solver/statuses/{sha}","languages_url":"https://api.github.com/repos/enthought/sat-solver/languages","stargazers_url":"https://api.github.com/repos/enthought/sat-solver/stargazers","contributors_url":"https://api.github.com/repos/enthought/sat-solver/contributors","subscribers_url":"https://api.github.com/repos/enthought/sat-solver/subscribers","subscription_url":"https://api.github.com/repos/enthought/sat-solver/subscription","commits_url":"https://api.github.com/repos/enthought/sat-solver/commits{/sha}","git_commits_url":"https://api.github.com/repos/enthought/sat-solver/git/commits{/sha}","comments_url":"https://api.github.com/repos/enthought/sat-solver/comments{/number}","issue_comment_url":"https://api.github.com/repos/enthought/sat-solver/issues/comments{/number}","contents_url":"https://api.github.com/repos/enthought/sat-solver/contents/{+path}","compare_url":"https://api.github.com/repos/enthought/sat-solver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enthought/sat-solver/merges","archive_url":"https://api.github.com/repos/enthought/sat-solver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enthought/sat-solver/downloads","issues_url":"https://api.github.com/repos/enthought/sat-solver/issues{/number}","pulls_url":"https://api.github.com/repos/enthought/sat-solver/pulls{/number}","milestones_url":"https://api.github.com/repos/enthought/sat-solver/milestones{/number}","notifications_url":"https://api.github.com/repos/enthought/sat-solver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enthought/sat-solver/labels{/name}","releases_url":"https://api.github.com/repos/enthought/sat-solver/releases{/id}","deployments_url":"https://api.github.com/repos/enthought/sat-solver/deployments","created_at":"2014-12-09T19:31:39Z","updated_at":"2016-01-13T07:34:16Z","pushed_at":"2016-01-25T19:19:59Z","git_url":"git://github.com/enthought/sat-solver.git","ssh_url":"git@github.com:enthought/sat-solver.git","clone_url":"https://github.com/enthought/sat-solver.git","svn_url":"https://github.com/enthought/sat-solver","homepage":"","size":808,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/101"},"html":{"href":"https://github.com/enthought/sat-solver/pull/101"},"issue":{"href":"https://api.github.com/repos/enthought/sat-solver/issues/101"},"comments":{"href":"https://api.github.com/repos/enthought/sat-solver/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enthought/sat-solver/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/enthought/sat-solver/statuses/d8e6e5c66f8c81d5fbf1f1f16a09d621ddd5029f"}}}}