{"action":"created","comment":{"url":"https://api.github.com/repos/stoklund/cretonne/pulls/comments/124041766","pull_request_review_id":46295003,"id":124041766,"diff_hunk":"@@ -331,6 +340,67 @@ def double_vector(self):\n \n         return new\n \n+    def map(self, func):\n+        # type: (str) -> TypeSet\n+        \"\"\"\n+        Return the image of self across the derived function func\n+        \"\"\"\n+        if (func == TypeVar.SAMEAS):\n+            return self\n+        elif (func == TypeVar.LANEOF):\n+            return self.lane_of()\n+        elif (func == TypeVar.ASBOOL):\n+            return self.as_bool()\n+        elif (func == TypeVar.HALFWIDTH):\n+            return self.half_width()\n+        elif (func == TypeVar.DOUBLEWIDTH):\n+            return self.double_width()\n+        elif (func == TypeVar.HALFVECTOR):\n+            return self.half_vector()\n+        elif (func == TypeVar.DOUBLEVECTOR):\n+            return self.double_vector()\n+        else:\n+            assert False, \"Unknown derived function: \" + func\n+\n+    def map_inverse(self, func):\n+        # type: (str) -> TypeSet\n+        \"\"\"\n+        Return the inverse image of self across the derived function func","path":"lib/cretonne/meta/cdsl/typevar.py","position":89,"original_position":89,"commit_id":"26c7f04b273d540c2f10f39c54039311810a7d8a","original_commit_id":"26c7f04b273d540c2f10f39c54039311810a7d8a","user":{"login":"stoklund","id":12660495,"avatar_url":"https://avatars3.githubusercontent.com/u/12660495?v=3","gravatar_id":"","url":"https://api.github.com/users/stoklund","html_url":"https://github.com/stoklund","followers_url":"https://api.github.com/users/stoklund/followers","following_url":"https://api.github.com/users/stoklund/following{/other_user}","gists_url":"https://api.github.com/users/stoklund/gists{/gist_id}","starred_url":"https://api.github.com/users/stoklund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoklund/subscriptions","organizations_url":"https://api.github.com/users/stoklund/orgs","repos_url":"https://api.github.com/users/stoklund/repos","events_url":"https://api.github.com/users/stoklund/events{/privacy}","received_events_url":"https://api.github.com/users/stoklund/received_events","type":"User","site_admin":false},"body":"I think I would prefer to cal these two methods `image` and `preimage`. See http://mathworld.wolfram.com/Preimage.html","created_at":"2017-06-26T15:31:06Z","updated_at":"2017-06-26T15:34:05Z","html_url":"https://github.com/stoklund/cretonne/pull/105#discussion_r124041766","pull_request_url":"https://api.github.com/repos/stoklund/cretonne/pulls/105","_links":{"self":{"href":"https://api.github.com/repos/stoklund/cretonne/pulls/comments/124041766"},"html":{"href":"https://github.com/stoklund/cretonne/pull/105#discussion_r124041766"},"pull_request":{"href":"https://api.github.com/repos/stoklund/cretonne/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/stoklund/cretonne/pulls/105","id":127311061,"html_url":"https://github.com/stoklund/cretonne/pull/105","diff_url":"https://github.com/stoklund/cretonne/pull/105.diff","patch_url":"https://github.com/stoklund/cretonne/pull/105.patch","issue_url":"https://api.github.com/repos/stoklund/cretonne/issues/105","number":105,"state":"open","locked":false,"title":"Add inverse image computation for TypeSets and generalize TypeVar.constrain_types","user":{"login":"d1m0","id":1137033,"avatar_url":"https://avatars0.githubusercontent.com/u/1137033?v=3","gravatar_id":"","url":"https://api.github.com/users/d1m0","html_url":"https://github.com/d1m0","followers_url":"https://api.github.com/users/d1m0/followers","following_url":"https://api.github.com/users/d1m0/following{/other_user}","gists_url":"https://api.github.com/users/d1m0/gists{/gist_id}","starred_url":"https://api.github.com/users/d1m0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d1m0/subscriptions","organizations_url":"https://api.github.com/users/d1m0/orgs","repos_url":"https://api.github.com/users/d1m0/repos","events_url":"https://api.github.com/users/d1m0/events{/privacy}","received_events_url":"https://api.github.com/users/d1m0/received_events","type":"User","site_admin":false},"body":"Add computation of inverse image of typeset across a derived function - TypeSet.map_inverse; \r\nChange TypeVar.constrain_type to perform a more-general computation using inverse images of TypeSets;\r\nTests for map_inverse;\r\nCleanup ValueType.get_names to with_bits form previous PR;","created_at":"2017-06-24T01:15:19Z","updated_at":"2017-06-26T15:34:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a0eacca09bde47ea0b26463872c07f9bf333662","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/stoklund/cretonne/pulls/105/commits","review_comments_url":"https://api.github.com/repos/stoklund/cretonne/pulls/105/comments","review_comment_url":"https://api.github.com/repos/stoklund/cretonne/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stoklund/cretonne/issues/105/comments","statuses_url":"https://api.github.com/repos/stoklund/cretonne/statuses/26c7f04b273d540c2f10f39c54039311810a7d8a","head":{"label":"d1m0:ts_inverse_images","ref":"ts_inverse_images","sha":"26c7f04b273d540c2f10f39c54039311810a7d8a","user":{"login":"d1m0","id":1137033,"avatar_url":"https://avatars0.githubusercontent.com/u/1137033?v=3","gravatar_id":"","url":"https://api.github.com/users/d1m0","html_url":"https://github.com/d1m0","followers_url":"https://api.github.com/users/d1m0/followers","following_url":"https://api.github.com/users/d1m0/following{/other_user}","gists_url":"https://api.github.com/users/d1m0/gists{/gist_id}","starred_url":"https://api.github.com/users/d1m0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d1m0/subscriptions","organizations_url":"https://api.github.com/users/d1m0/orgs","repos_url":"https://api.github.com/users/d1m0/repos","events_url":"https://api.github.com/users/d1m0/events{/privacy}","received_events_url":"https://api.github.com/users/d1m0/received_events","type":"User","site_admin":false},"repo":{"id":94259994,"name":"cretonne","full_name":"d1m0/cretonne","owner":{"login":"d1m0","id":1137033,"avatar_url":"https://avatars0.githubusercontent.com/u/1137033?v=3","gravatar_id":"","url":"https://api.github.com/users/d1m0","html_url":"https://github.com/d1m0","followers_url":"https://api.github.com/users/d1m0/followers","following_url":"https://api.github.com/users/d1m0/following{/other_user}","gists_url":"https://api.github.com/users/d1m0/gists{/gist_id}","starred_url":"https://api.github.com/users/d1m0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d1m0/subscriptions","organizations_url":"https://api.github.com/users/d1m0/orgs","repos_url":"https://api.github.com/users/d1m0/repos","events_url":"https://api.github.com/users/d1m0/events{/privacy}","received_events_url":"https://api.github.com/users/d1m0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/d1m0/cretonne","description":"Cretonne code generator","fork":true,"url":"https://api.github.com/repos/d1m0/cretonne","forks_url":"https://api.github.com/repos/d1m0/cretonne/forks","keys_url":"https://api.github.com/repos/d1m0/cretonne/keys{/key_id}","collaborators_url":"https://api.github.com/repos/d1m0/cretonne/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/d1m0/cretonne/teams","hooks_url":"https://api.github.com/repos/d1m0/cretonne/hooks","issue_events_url":"https://api.github.com/repos/d1m0/cretonne/issues/events{/number}","events_url":"https://api.github.com/repos/d1m0/cretonne/events","assignees_url":"https://api.github.com/repos/d1m0/cretonne/assignees{/user}","branches_url":"https://api.github.com/repos/d1m0/cretonne/branches{/branch}","tags_url":"https://api.github.com/repos/d1m0/cretonne/tags","blobs_url":"https://api.github.com/repos/d1m0/cretonne/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/d1m0/cretonne/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/d1m0/cretonne/git/refs{/sha}","trees_url":"https://api.github.com/repos/d1m0/cretonne/git/trees{/sha}","statuses_url":"https://api.github.com/repos/d1m0/cretonne/statuses/{sha}","languages_url":"https://api.github.com/repos/d1m0/cretonne/languages","stargazers_url":"https://api.github.com/repos/d1m0/cretonne/stargazers","contributors_url":"https://api.github.com/repos/d1m0/cretonne/contributors","subscribers_url":"https://api.github.com/repos/d1m0/cretonne/subscribers","subscription_url":"https://api.github.com/repos/d1m0/cretonne/subscription","commits_url":"https://api.github.com/repos/d1m0/cretonne/commits{/sha}","git_commits_url":"https://api.github.com/repos/d1m0/cretonne/git/commits{/sha}","comments_url":"https://api.github.com/repos/d1m0/cretonne/comments{/number}","issue_comment_url":"https://api.github.com/repos/d1m0/cretonne/issues/comments{/number}","contents_url":"https://api.github.com/repos/d1m0/cretonne/contents/{+path}","compare_url":"https://api.github.com/repos/d1m0/cretonne/compare/{base}...{head}","merges_url":"https://api.github.com/repos/d1m0/cretonne/merges","archive_url":"https://api.github.com/repos/d1m0/cretonne/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/d1m0/cretonne/downloads","issues_url":"https://api.github.com/repos/d1m0/cretonne/issues{/number}","pulls_url":"https://api.github.com/repos/d1m0/cretonne/pulls{/number}","milestones_url":"https://api.github.com/repos/d1m0/cretonne/milestones{/number}","notifications_url":"https://api.github.com/repos/d1m0/cretonne/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/d1m0/cretonne/labels{/name}","releases_url":"https://api.github.com/repos/d1m0/cretonne/releases{/id}","deployments_url":"https://api.github.com/repos/d1m0/cretonne/deployments","created_at":"2017-06-13T21:32:46Z","updated_at":"2017-06-13T21:32:48Z","pushed_at":"2017-06-24T00:46:10Z","git_url":"git://github.com/d1m0/cretonne.git","ssh_url":"git@github.com:d1m0/cretonne.git","clone_url":"https://github.com/d1m0/cretonne.git","svn_url":"https://github.com/d1m0/cretonne","homepage":null,"size":2065,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"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":"stoklund:master","ref":"master","sha":"6a9438d274fb01357cfa5d5a041aaf431348569a","user":{"login":"stoklund","id":12660495,"avatar_url":"https://avatars3.githubusercontent.com/u/12660495?v=3","gravatar_id":"","url":"https://api.github.com/users/stoklund","html_url":"https://github.com/stoklund","followers_url":"https://api.github.com/users/stoklund/followers","following_url":"https://api.github.com/users/stoklund/following{/other_user}","gists_url":"https://api.github.com/users/stoklund/gists{/gist_id}","starred_url":"https://api.github.com/users/stoklund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoklund/subscriptions","organizations_url":"https://api.github.com/users/stoklund/orgs","repos_url":"https://api.github.com/users/stoklund/repos","events_url":"https://api.github.com/users/stoklund/events{/privacy}","received_events_url":"https://api.github.com/users/stoklund/received_events","type":"User","site_admin":false},"repo":{"id":50268165,"name":"cretonne","full_name":"stoklund/cretonne","owner":{"login":"stoklund","id":12660495,"avatar_url":"https://avatars3.githubusercontent.com/u/12660495?v=3","gravatar_id":"","url":"https://api.github.com/users/stoklund","html_url":"https://github.com/stoklund","followers_url":"https://api.github.com/users/stoklund/followers","following_url":"https://api.github.com/users/stoklund/following{/other_user}","gists_url":"https://api.github.com/users/stoklund/gists{/gist_id}","starred_url":"https://api.github.com/users/stoklund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoklund/subscriptions","organizations_url":"https://api.github.com/users/stoklund/orgs","repos_url":"https://api.github.com/users/stoklund/repos","events_url":"https://api.github.com/users/stoklund/events{/privacy}","received_events_url":"https://api.github.com/users/stoklund/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stoklund/cretonne","description":"Cretonne code generator","fork":false,"url":"https://api.github.com/repos/stoklund/cretonne","forks_url":"https://api.github.com/repos/stoklund/cretonne/forks","keys_url":"https://api.github.com/repos/stoklund/cretonne/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stoklund/cretonne/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stoklund/cretonne/teams","hooks_url":"https://api.github.com/repos/stoklund/cretonne/hooks","issue_events_url":"https://api.github.com/repos/stoklund/cretonne/issues/events{/number}","events_url":"https://api.github.com/repos/stoklund/cretonne/events","assignees_url":"https://api.github.com/repos/stoklund/cretonne/assignees{/user}","branches_url":"https://api.github.com/repos/stoklund/cretonne/branches{/branch}","tags_url":"https://api.github.com/repos/stoklund/cretonne/tags","blobs_url":"https://api.github.com/repos/stoklund/cretonne/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stoklund/cretonne/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stoklund/cretonne/git/refs{/sha}","trees_url":"https://api.github.com/repos/stoklund/cretonne/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stoklund/cretonne/statuses/{sha}","languages_url":"https://api.github.com/repos/stoklund/cretonne/languages","stargazers_url":"https://api.github.com/repos/stoklund/cretonne/stargazers","contributors_url":"https://api.github.com/repos/stoklund/cretonne/contributors","subscribers_url":"https://api.github.com/repos/stoklund/cretonne/subscribers","subscription_url":"https://api.github.com/repos/stoklund/cretonne/subscription","commits_url":"https://api.github.com/repos/stoklund/cretonne/commits{/sha}","git_commits_url":"https://api.github.com/repos/stoklund/cretonne/git/commits{/sha}","comments_url":"https://api.github.com/repos/stoklund/cretonne/comments{/number}","issue_comment_url":"https://api.github.com/repos/stoklund/cretonne/issues/comments{/number}","contents_url":"https://api.github.com/repos/stoklund/cretonne/contents/{+path}","compare_url":"https://api.github.com/repos/stoklund/cretonne/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stoklund/cretonne/merges","archive_url":"https://api.github.com/repos/stoklund/cretonne/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stoklund/cretonne/downloads","issues_url":"https://api.github.com/repos/stoklund/cretonne/issues{/number}","pulls_url":"https://api.github.com/repos/stoklund/cretonne/pulls{/number}","milestones_url":"https://api.github.com/repos/stoklund/cretonne/milestones{/number}","notifications_url":"https://api.github.com/repos/stoklund/cretonne/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stoklund/cretonne/labels{/name}","releases_url":"https://api.github.com/repos/stoklund/cretonne/releases{/id}","deployments_url":"https://api.github.com/repos/stoklund/cretonne/deployments","created_at":"2016-01-24T02:04:11Z","updated_at":"2017-06-26T15:32:29Z","pushed_at":"2017-06-24T01:15:19Z","git_url":"git://github.com/stoklund/cretonne.git","ssh_url":"git@github.com:stoklund/cretonne.git","clone_url":"https://github.com/stoklund/cretonne.git","svn_url":"https://github.com/stoklund/cretonne","homepage":null,"size":1959,"stargazers_count":280,"watchers_count":280,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":24,"forks":28,"open_issues":24,"watchers":280,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stoklund/cretonne/pulls/105"},"html":{"href":"https://github.com/stoklund/cretonne/pull/105"},"issue":{"href":"https://api.github.com/repos/stoklund/cretonne/issues/105"},"comments":{"href":"https://api.github.com/repos/stoklund/cretonne/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/stoklund/cretonne/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/stoklund/cretonne/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stoklund/cretonne/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/stoklund/cretonne/statuses/26c7f04b273d540c2f10f39c54039311810a7d8a"}}}}
{"actor":{"display_login":"stoklund"}}