{"action":"created","comment":{"url":"https://api.github.com/repos/diffblue/cbmc/pulls/comments/169439530","pull_request_review_id":97965474,"id":169439530,"diff_hunk":"@@ -0,0 +1,136 @@\n+/*******************************************************************\\\n+\n+ Module: Unit tests for bv refinement\n+\n+ Author: DiffBlue Limited. All rights reserved.\n+\n+\\*******************************************************************/\n+\n+#include <testing-utils/catch.hpp>\n+\n+#include <util/arith_tools.h>\n+#include <util/std_types.h>\n+#include <util/std_expr.h>\n+#include <solvers/refinement/bv_refinement.h>\n+#include <solvers/sat/satcheck.h>\n+#include <util/symbol_table.h>\n+#include <java_bytecode/java_types.h>\n+#include <util/config.h>\n+#include <iostream>\n+\n+SCENARIO(\"add lemma\", \"[core][solvers][refinement][bv_refinement]\")\n+{\n+  // Without this line, the program aborts with:\n+  // `Reason: pointer must have non-zero width`\n+  config.set_arch(\"none\");\n+\n+  GIVEN(\"A solver\")\n+  {\n+    satcheck_no_simplifiert sat_check;\n+    symbol_tablet symbol_table;\n+    namespacet ns(symbol_table);\n+    bv_refinementt::infot info;\n+    info.ns = &ns;\n+    info.prop = &sat_check;\n+    info.refine_arithmetic = true;\n+    info.refine_arrays = true;\n+    info.max_node_refinement = 5;\n+    info.ui = ui_message_handlert::uit::PLAIN;\n+    bv_refinementt solver(info);\n+\n+    WHEN(\"We give two contradictory inputs\")\n+    {\n+      const symbol_exprt s1(\"symbol_var1\", java_int_type());","path":"unit/solvers/refinement/bv_refinement/add_lemma.cpp","position":43,"original_position":43,"commit_id":"0791497443535d4381ceaf5039d1b3f107204903","original_commit_id":"0791497443535d4381ceaf5039d1b3f107204903","user":{"login":"martin-cs","id":5333188,"avatar_url":"https://avatars0.githubusercontent.com/u/5333188?v=4","gravatar_id":"","url":"https://api.github.com/users/martin-cs","html_url":"https://github.com/martin-cs","followers_url":"https://api.github.com/users/martin-cs/followers","following_url":"https://api.github.com/users/martin-cs/following{/other_user}","gists_url":"https://api.github.com/users/martin-cs/gists{/gist_id}","starred_url":"https://api.github.com/users/martin-cs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martin-cs/subscriptions","organizations_url":"https://api.github.com/users/martin-cs/orgs","repos_url":"https://api.github.com/users/martin-cs/repos","events_url":"https://api.github.com/users/martin-cs/events{/privacy}","received_events_url":"https://api.github.com/users/martin-cs/received_events","type":"User","site_admin":false},"body":"Does this need to be tied to the java types?","created_at":"2018-02-20T19:53:01Z","updated_at":"2018-02-20T19:56:40Z","html_url":"https://github.com/diffblue/cbmc/pull/1863#discussion_r169439530","pull_request_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1863","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/comments/169439530"},"html":{"href":"https://github.com/diffblue/cbmc/pull/1863#discussion_r169439530"},"pull_request":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1863"}}},"pull_request":{"url":"https://api.github.com/repos/diffblue/cbmc/pulls/1863","id":169935760,"html_url":"https://github.com/diffblue/cbmc/pull/1863","diff_url":"https://github.com/diffblue/cbmc/pull/1863.diff","patch_url":"https://github.com/diffblue/cbmc/pull/1863.patch","issue_url":"https://api.github.com/repos/diffblue/cbmc/issues/1863","number":1863,"state":"open","locked":false,"title":"Add unit test for bv_refinement","user":{"login":"romainbrenguier","id":11854194,"avatar_url":"https://avatars2.githubusercontent.com/u/11854194?v=4","gravatar_id":"","url":"https://api.github.com/users/romainbrenguier","html_url":"https://github.com/romainbrenguier","followers_url":"https://api.github.com/users/romainbrenguier/followers","following_url":"https://api.github.com/users/romainbrenguier/following{/other_user}","gists_url":"https://api.github.com/users/romainbrenguier/gists{/gist_id}","starred_url":"https://api.github.com/users/romainbrenguier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainbrenguier/subscriptions","organizations_url":"https://api.github.com/users/romainbrenguier/orgs","repos_url":"https://api.github.com/users/romainbrenguier/repos","events_url":"https://api.github.com/users/romainbrenguier/events{/privacy}","received_events_url":"https://api.github.com/users/romainbrenguier/received_events","type":"User","site_admin":false},"body":"This adds a unit test adding some formulas to the bv_refinement solver.\r\nThe last formula added currently leads to an invariant violation line 124.\r\n\r\n```\r\n--- begin invariant violation report ---\r\nInvariant check failed\r\nFile /home/romain/git/test-gen/lib/cbmc/src/solvers/sat/satcheck_minisat2.cpp function lcnf line 127\r\nReason: variable not added yet\r\n```\r\n\r\n@martin-cs @peterschrammel any idea why this invariant fails?\r\n","created_at":"2018-02-19T11:24:08Z","updated_at":"2018-02-20T19:56:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a077656c7c69594665d3aeb804744c06bbce67ac","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1863/commits","review_comments_url":"https://api.github.com/repos/diffblue/cbmc/pulls/1863/comments","review_comment_url":"https://api.github.com/repos/diffblue/cbmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diffblue/cbmc/issues/1863/comments","statuses_url":"https://api.github.com/repos/diffblue/cbmc/statuses/0791497443535d4381ceaf5039d1b3f107204903","head":{"label":"romainbrenguier:unit-test/bv_refinement","ref":"unit-test/bv_refinement","sha":"0791497443535d4381ceaf5039d1b3f107204903","user":{"login":"romainbrenguier","id":11854194,"avatar_url":"https://avatars2.githubusercontent.com/u/11854194?v=4","gravatar_id":"","url":"https://api.github.com/users/romainbrenguier","html_url":"https://github.com/romainbrenguier","followers_url":"https://api.github.com/users/romainbrenguier/followers","following_url":"https://api.github.com/users/romainbrenguier/following{/other_user}","gists_url":"https://api.github.com/users/romainbrenguier/gists{/gist_id}","starred_url":"https://api.github.com/users/romainbrenguier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainbrenguier/subscriptions","organizations_url":"https://api.github.com/users/romainbrenguier/orgs","repos_url":"https://api.github.com/users/romainbrenguier/repos","events_url":"https://api.github.com/users/romainbrenguier/events{/privacy}","received_events_url":"https://api.github.com/users/romainbrenguier/received_events","type":"User","site_admin":false},"repo":{"id":64766217,"name":"cbmc","full_name":"romainbrenguier/cbmc","owner":{"login":"romainbrenguier","id":11854194,"avatar_url":"https://avatars2.githubusercontent.com/u/11854194?v=4","gravatar_id":"","url":"https://api.github.com/users/romainbrenguier","html_url":"https://github.com/romainbrenguier","followers_url":"https://api.github.com/users/romainbrenguier/followers","following_url":"https://api.github.com/users/romainbrenguier/following{/other_user}","gists_url":"https://api.github.com/users/romainbrenguier/gists{/gist_id}","starred_url":"https://api.github.com/users/romainbrenguier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainbrenguier/subscriptions","organizations_url":"https://api.github.com/users/romainbrenguier/orgs","repos_url":"https://api.github.com/users/romainbrenguier/repos","events_url":"https://api.github.com/users/romainbrenguier/events{/privacy}","received_events_url":"https://api.github.com/users/romainbrenguier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/romainbrenguier/cbmc","description":"C Bounded Model Checker","fork":true,"url":"https://api.github.com/repos/romainbrenguier/cbmc","forks_url":"https://api.github.com/repos/romainbrenguier/cbmc/forks","keys_url":"https://api.github.com/repos/romainbrenguier/cbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romainbrenguier/cbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romainbrenguier/cbmc/teams","hooks_url":"https://api.github.com/repos/romainbrenguier/cbmc/hooks","issue_events_url":"https://api.github.com/repos/romainbrenguier/cbmc/issues/events{/number}","events_url":"https://api.github.com/repos/romainbrenguier/cbmc/events","assignees_url":"https://api.github.com/repos/romainbrenguier/cbmc/assignees{/user}","branches_url":"https://api.github.com/repos/romainbrenguier/cbmc/branches{/branch}","tags_url":"https://api.github.com/repos/romainbrenguier/cbmc/tags","blobs_url":"https://api.github.com/repos/romainbrenguier/cbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romainbrenguier/cbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romainbrenguier/cbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/romainbrenguier/cbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romainbrenguier/cbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/romainbrenguier/cbmc/languages","stargazers_url":"https://api.github.com/repos/romainbrenguier/cbmc/stargazers","contributors_url":"https://api.github.com/repos/romainbrenguier/cbmc/contributors","subscribers_url":"https://api.github.com/repos/romainbrenguier/cbmc/subscribers","subscription_url":"https://api.github.com/repos/romainbrenguier/cbmc/subscription","commits_url":"https://api.github.com/repos/romainbrenguier/cbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/romainbrenguier/cbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/romainbrenguier/cbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/romainbrenguier/cbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/romainbrenguier/cbmc/contents/{+path}","compare_url":"https://api.github.com/repos/romainbrenguier/cbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romainbrenguier/cbmc/merges","archive_url":"https://api.github.com/repos/romainbrenguier/cbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romainbrenguier/cbmc/downloads","issues_url":"https://api.github.com/repos/romainbrenguier/cbmc/issues{/number}","pulls_url":"https://api.github.com/repos/romainbrenguier/cbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/romainbrenguier/cbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/romainbrenguier/cbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romainbrenguier/cbmc/labels{/name}","releases_url":"https://api.github.com/repos/romainbrenguier/cbmc/releases{/id}","deployments_url":"https://api.github.com/repos/romainbrenguier/cbmc/deployments","created_at":"2016-08-02T14:57:13Z","updated_at":"2017-06-22T09:24:59Z","pushed_at":"2018-02-20T17:59:47Z","git_url":"git://github.com/romainbrenguier/cbmc.git","ssh_url":"git@github.com:romainbrenguier/cbmc.git","clone_url":"https://github.com/romainbrenguier/cbmc.git","svn_url":"https://github.com/romainbrenguier/cbmc","homepage":"http://www.cprover.org/cbmc","size":34260,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"string-solver-experiments"}},"base":{"label":"diffblue:develop","ref":"develop","sha":"4d3ab7aa9471d0ca551906f6b0c8a9d472c47d8e","user":{"login":"diffblue","id":17216098,"avatar_url":"https://avatars0.githubusercontent.com/u/17216098?v=4","gravatar_id":"","url":"https://api.github.com/users/diffblue","html_url":"https://github.com/diffblue","followers_url":"https://api.github.com/users/diffblue/followers","following_url":"https://api.github.com/users/diffblue/following{/other_user}","gists_url":"https://api.github.com/users/diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diffblue/subscriptions","organizations_url":"https://api.github.com/users/diffblue/orgs","repos_url":"https://api.github.com/users/diffblue/repos","events_url":"https://api.github.com/users/diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/diffblue/received_events","type":"Organization","site_admin":false},"repo":{"id":51877056,"name":"cbmc","full_name":"diffblue/cbmc","owner":{"login":"diffblue","id":17216098,"avatar_url":"https://avatars0.githubusercontent.com/u/17216098?v=4","gravatar_id":"","url":"https://api.github.com/users/diffblue","html_url":"https://github.com/diffblue","followers_url":"https://api.github.com/users/diffblue/followers","following_url":"https://api.github.com/users/diffblue/following{/other_user}","gists_url":"https://api.github.com/users/diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diffblue/subscriptions","organizations_url":"https://api.github.com/users/diffblue/orgs","repos_url":"https://api.github.com/users/diffblue/repos","events_url":"https://api.github.com/users/diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/diffblue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diffblue/cbmc","description":"C Bounded Model Checker","fork":false,"url":"https://api.github.com/repos/diffblue/cbmc","forks_url":"https://api.github.com/repos/diffblue/cbmc/forks","keys_url":"https://api.github.com/repos/diffblue/cbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diffblue/cbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diffblue/cbmc/teams","hooks_url":"https://api.github.com/repos/diffblue/cbmc/hooks","issue_events_url":"https://api.github.com/repos/diffblue/cbmc/issues/events{/number}","events_url":"https://api.github.com/repos/diffblue/cbmc/events","assignees_url":"https://api.github.com/repos/diffblue/cbmc/assignees{/user}","branches_url":"https://api.github.com/repos/diffblue/cbmc/branches{/branch}","tags_url":"https://api.github.com/repos/diffblue/cbmc/tags","blobs_url":"https://api.github.com/repos/diffblue/cbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diffblue/cbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diffblue/cbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/diffblue/cbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diffblue/cbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/diffblue/cbmc/languages","stargazers_url":"https://api.github.com/repos/diffblue/cbmc/stargazers","contributors_url":"https://api.github.com/repos/diffblue/cbmc/contributors","subscribers_url":"https://api.github.com/repos/diffblue/cbmc/subscribers","subscription_url":"https://api.github.com/repos/diffblue/cbmc/subscription","commits_url":"https://api.github.com/repos/diffblue/cbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/diffblue/cbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/diffblue/cbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/diffblue/cbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/diffblue/cbmc/contents/{+path}","compare_url":"https://api.github.com/repos/diffblue/cbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diffblue/cbmc/merges","archive_url":"https://api.github.com/repos/diffblue/cbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diffblue/cbmc/downloads","issues_url":"https://api.github.com/repos/diffblue/cbmc/issues{/number}","pulls_url":"https://api.github.com/repos/diffblue/cbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/diffblue/cbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/diffblue/cbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diffblue/cbmc/labels{/name}","releases_url":"https://api.github.com/repos/diffblue/cbmc/releases{/id}","deployments_url":"https://api.github.com/repos/diffblue/cbmc/deployments","created_at":"2016-02-16T23:03:52Z","updated_at":"2018-02-06T19:52:55Z","pushed_at":"2018-02-20T17:59:49Z","git_url":"git://github.com/diffblue/cbmc.git","ssh_url":"git@github.com:diffblue/cbmc.git","clone_url":"https://github.com/diffblue/cbmc.git","svn_url":"https://github.com/diffblue/cbmc","homepage":"http://www.cprover.org/cbmc","size":28209,"stargazers_count":96,"watchers_count":96,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":87,"mirror_url":null,"archived":false,"open_issues_count":324,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":87,"open_issues":324,"watchers":96,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1863"},"html":{"href":"https://github.com/diffblue/cbmc/pull/1863"},"issue":{"href":"https://api.github.com/repos/diffblue/cbmc/issues/1863"},"comments":{"href":"https://api.github.com/repos/diffblue/cbmc/issues/1863/comments"},"review_comments":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1863/comments"},"review_comment":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/1863/commits"},"statuses":{"href":"https://api.github.com/repos/diffblue/cbmc/statuses/0791497443535d4381ceaf5039d1b3f107204903"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"martin-cs"}}