{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/solidity/pulls/comments/170769574","pull_request_review_id":99506875,"id":170769574,"diff_hunk":"@@ -0,0 +1,71 @@\n+/*\n+\tThis file is part of solidity.\n+\n+\tsolidity is free software: you can redistribute it and/or modify\n+\tit under the terms of the GNU General Public License as published by\n+\tthe Free Software Foundation, either version 3 of the License, or\n+\t(at your option) any later version.\n+\n+\tsolidity is distributed in the hope that it will be useful,\n+\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n+\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+\tGNU General Public License for more details.\n+\n+\tYou should have received a copy of the GNU General Public License\n+\talong with solidity.  If not, see <http://www.gnu.org/licenses/>.\n+*/\n+\n+#pragma once\n+\n+#include <libsolidity/formal/SolverInterface.h>\n+\n+#include <libsolidity/ast/AST.h>\n+\n+#include <memory>\n+\n+namespace dev\n+{\n+namespace solidity\n+{\n+\n+class Declaration;\n+\n+/**\n+ * This class represents the symbolic version of a program variable.\n+ */\n+class SymbolicVariable\n+{\n+public:\n+\texplicit SymbolicVariable(Declaration const* _decl,\n+\t\tsmt::SolverInterface& _interface);\n+\tSymbolicVariable(SymbolicVariable const&) = default;\n+\tSymbolicVariable(SymbolicVariable&&) = default;\n+\tSymbolicVariable& operator=(SymbolicVariable const&) = default;\n+\tSymbolicVariable& operator=(SymbolicVariable&&) = default;\n+\n+\tsmt::Expression operator()(int _seq) const\n+\t{\n+\t\treturn valueAtSequence(_seq);\n+\t}\n+\n+\tstd::string uniqueSymbol() const;\n+\n+\t/// Sets the var to the default value of its type.\n+\tvirtual void setZeroValue(int _seq) = 0;\n+\t/// The unknown value depends on the type. For example, an interval is set for Integers.","path":"libsolidity/formal/SymbolicVariable.h","position":55,"original_position":55,"commit_id":"f8f63d2eab381e691b5af83e1072b75cc4fcd812","original_commit_id":"f8f63d2eab381e691b5af83e1072b75cc4fcd812","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars2.githubusercontent.com/u/9073706?v=4","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"body":"Is this actually true? For all types, the unknown value is just the restriction on any valid value, regardless of the type. For integers, this is no less an interval as for bools, it is the discrete set of all possible valid values.","created_at":"2018-02-26T23:21:13Z","updated_at":"2018-02-26T23:21:13Z","html_url":"https://github.com/ethereum/solidity/pull/3406#discussion_r170769574","pull_request_url":"https://api.github.com/repos/ethereum/solidity/pulls/3406","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/comments/170769574"},"html":{"href":"https://github.com/ethereum/solidity/pull/3406#discussion_r170769574"},"pull_request":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/3406"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/solidity/pulls/3406","id":163541662,"html_url":"https://github.com/ethereum/solidity/pull/3406","diff_url":"https://github.com/ethereum/solidity/pull/3406.diff","patch_url":"https://github.com/ethereum/solidity/pull/3406.patch","issue_url":"https://api.github.com/repos/ethereum/solidity/issues/3406","number":3406,"state":"open","locked":false,"title":"[WIP] SMTChecker: A little refactoring on SSA vars (preparation for Bool)","user":{"login":"leonardoalt","id":504195,"avatar_url":"https://avatars1.githubusercontent.com/u/504195?v=4","gravatar_id":"","url":"https://api.github.com/users/leonardoalt","html_url":"https://github.com/leonardoalt","followers_url":"https://api.github.com/users/leonardoalt/followers","following_url":"https://api.github.com/users/leonardoalt/following{/other_user}","gists_url":"https://api.github.com/users/leonardoalt/gists{/gist_id}","starred_url":"https://api.github.com/users/leonardoalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonardoalt/subscriptions","organizations_url":"https://api.github.com/users/leonardoalt/orgs","repos_url":"https://api.github.com/users/leonardoalt/repos","events_url":"https://api.github.com/users/leonardoalt/events{/privacy}","received_events_url":"https://api.github.com/users/leonardoalt/received_events","type":"User","site_admin":false},"body":"The idea is to remove the SSA reasoning from the SMTChecker class and do it somewhere else, in this case, symbolic vars of each type have their own classes.\r\n\r\nThe code isn't ready to merge (still not fully documented, debug, etc), but I wanted to start a discussion. Some points:\r\n\r\n- Is the code separation reasonable? :+1: \r\n- Where should functions `minValue` and `maxValue` stay?\r\n- A pointer to the solver (`m_interface`) is passed to the var. :+1: (reference)\r\n- Variables are now pushed and popped inside branches. :x: (copy instead)\r\n- Zero and default unknown values are now defined in the specific var type class. :+1: \r\n- The addition of support to `Bool` should be easier now.","created_at":"2018-01-17T20:15:38Z","updated_at":"2018-02-26T23:21:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ee0ff2e31c7c802092c756d06f41df9e6ac27f4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":772322900,"url":"https://api.github.com/repos/ethereum/solidity/labels/needs%20review","name":"needs review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/solidity/pulls/3406/commits","review_comments_url":"https://api.github.com/repos/ethereum/solidity/pulls/3406/comments","review_comment_url":"https://api.github.com/repos/ethereum/solidity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/solidity/issues/3406/comments","statuses_url":"https://api.github.com/repos/ethereum/solidity/statuses/f8f63d2eab381e691b5af83e1072b75cc4fcd812","head":{"label":"leonardoalt:smt_checker","ref":"smt_checker","sha":"f8f63d2eab381e691b5af83e1072b75cc4fcd812","user":{"login":"leonardoalt","id":504195,"avatar_url":"https://avatars1.githubusercontent.com/u/504195?v=4","gravatar_id":"","url":"https://api.github.com/users/leonardoalt","html_url":"https://github.com/leonardoalt","followers_url":"https://api.github.com/users/leonardoalt/followers","following_url":"https://api.github.com/users/leonardoalt/following{/other_user}","gists_url":"https://api.github.com/users/leonardoalt/gists{/gist_id}","starred_url":"https://api.github.com/users/leonardoalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonardoalt/subscriptions","organizations_url":"https://api.github.com/users/leonardoalt/orgs","repos_url":"https://api.github.com/users/leonardoalt/repos","events_url":"https://api.github.com/users/leonardoalt/events{/privacy}","received_events_url":"https://api.github.com/users/leonardoalt/received_events","type":"User","site_admin":false},"repo":{"id":111003832,"name":"solidity","full_name":"leonardoalt/solidity","owner":{"login":"leonardoalt","id":504195,"avatar_url":"https://avatars1.githubusercontent.com/u/504195?v=4","gravatar_id":"","url":"https://api.github.com/users/leonardoalt","html_url":"https://github.com/leonardoalt","followers_url":"https://api.github.com/users/leonardoalt/followers","following_url":"https://api.github.com/users/leonardoalt/following{/other_user}","gists_url":"https://api.github.com/users/leonardoalt/gists{/gist_id}","starred_url":"https://api.github.com/users/leonardoalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonardoalt/subscriptions","organizations_url":"https://api.github.com/users/leonardoalt/orgs","repos_url":"https://api.github.com/users/leonardoalt/repos","events_url":"https://api.github.com/users/leonardoalt/events{/privacy}","received_events_url":"https://api.github.com/users/leonardoalt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leonardoalt/solidity","description":"The Solidity Contract-Oriented Programming Language","fork":true,"url":"https://api.github.com/repos/leonardoalt/solidity","forks_url":"https://api.github.com/repos/leonardoalt/solidity/forks","keys_url":"https://api.github.com/repos/leonardoalt/solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leonardoalt/solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leonardoalt/solidity/teams","hooks_url":"https://api.github.com/repos/leonardoalt/solidity/hooks","issue_events_url":"https://api.github.com/repos/leonardoalt/solidity/issues/events{/number}","events_url":"https://api.github.com/repos/leonardoalt/solidity/events","assignees_url":"https://api.github.com/repos/leonardoalt/solidity/assignees{/user}","branches_url":"https://api.github.com/repos/leonardoalt/solidity/branches{/branch}","tags_url":"https://api.github.com/repos/leonardoalt/solidity/tags","blobs_url":"https://api.github.com/repos/leonardoalt/solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leonardoalt/solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leonardoalt/solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/leonardoalt/solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leonardoalt/solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/leonardoalt/solidity/languages","stargazers_url":"https://api.github.com/repos/leonardoalt/solidity/stargazers","contributors_url":"https://api.github.com/repos/leonardoalt/solidity/contributors","subscribers_url":"https://api.github.com/repos/leonardoalt/solidity/subscribers","subscription_url":"https://api.github.com/repos/leonardoalt/solidity/subscription","commits_url":"https://api.github.com/repos/leonardoalt/solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/leonardoalt/solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/leonardoalt/solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/leonardoalt/solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/leonardoalt/solidity/contents/{+path}","compare_url":"https://api.github.com/repos/leonardoalt/solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leonardoalt/solidity/merges","archive_url":"https://api.github.com/repos/leonardoalt/solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leonardoalt/solidity/downloads","issues_url":"https://api.github.com/repos/leonardoalt/solidity/issues{/number}","pulls_url":"https://api.github.com/repos/leonardoalt/solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/leonardoalt/solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/leonardoalt/solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leonardoalt/solidity/labels{/name}","releases_url":"https://api.github.com/repos/leonardoalt/solidity/releases{/id}","deployments_url":"https://api.github.com/repos/leonardoalt/solidity/deployments","created_at":"2017-11-16T17:52:05Z","updated_at":"2017-11-16T17:52:08Z","pushed_at":"2018-02-25T14:51:33Z","git_url":"git://github.com/leonardoalt/solidity.git","ssh_url":"git@github.com:leonardoalt/solidity.git","clone_url":"https://github.com/leonardoalt/solidity.git","svn_url":"https://github.com/leonardoalt/solidity","homepage":"","size":17408,"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":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"3f7e82d00ba6b0a9c1e7644b8613aa2126498893","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":40892817,"name":"solidity","full_name":"ethereum/solidity","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/solidity","description":"The Solidity Contract-Oriented Programming Language","fork":false,"url":"https://api.github.com/repos/ethereum/solidity","forks_url":"https://api.github.com/repos/ethereum/solidity/forks","keys_url":"https://api.github.com/repos/ethereum/solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/solidity/teams","hooks_url":"https://api.github.com/repos/ethereum/solidity/hooks","issue_events_url":"https://api.github.com/repos/ethereum/solidity/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/solidity/events","assignees_url":"https://api.github.com/repos/ethereum/solidity/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/solidity/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/solidity/tags","blobs_url":"https://api.github.com/repos/ethereum/solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/solidity/languages","stargazers_url":"https://api.github.com/repos/ethereum/solidity/stargazers","contributors_url":"https://api.github.com/repos/ethereum/solidity/contributors","subscribers_url":"https://api.github.com/repos/ethereum/solidity/subscribers","subscription_url":"https://api.github.com/repos/ethereum/solidity/subscription","commits_url":"https://api.github.com/repos/ethereum/solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/solidity/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/solidity/merges","archive_url":"https://api.github.com/repos/ethereum/solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/solidity/downloads","issues_url":"https://api.github.com/repos/ethereum/solidity/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/solidity/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/solidity/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/solidity/deployments","created_at":"2015-08-17T12:27:26Z","updated_at":"2018-02-26T19:07:51Z","pushed_at":"2018-02-26T23:20:34Z","git_url":"git://github.com/ethereum/solidity.git","ssh_url":"git@github.com:ethereum/solidity.git","clone_url":"https://github.com/ethereum/solidity.git","svn_url":"https://github.com/ethereum/solidity","homepage":"","size":17581,"stargazers_count":3718,"watchers_count":3718,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1003,"mirror_url":null,"archived":false,"open_issues_count":531,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1003,"open_issues":531,"watchers":3718,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/3406"},"html":{"href":"https://github.com/ethereum/solidity/pull/3406"},"issue":{"href":"https://api.github.com/repos/ethereum/solidity/issues/3406"},"comments":{"href":"https://api.github.com/repos/ethereum/solidity/issues/3406/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/3406/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/3406/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/solidity/statuses/f8f63d2eab381e691b5af83e1072b75cc4fcd812"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chriseth"}}