{"action":"created","comment":{"url":"https://api.github.com/repos/rchain/rchain/pulls/comments/166110862","pull_request_review_id":94138099,"id":166110862,"diff_hunk":"@@ -22,18 +22,58 @@ trait GroundNormalizeVisitor extends AbsynGround.Visitor[Ground, Any]\n   override def visit( gi: GroundUri, n: Any ) : Ground = GUri(gi.uri_)\n }\n \n+trait NameNormalizeVisitor extends Name.Visitor[NameVisitOutputs, NameVisitInputs] {\n+  val procVisitor : Proc.Visitor[ProcVisitOutputs, ProcVisitInputs]\n+\n+  override def visit( n: NameWildcard, input: NameVisitInputs ) = {\n+    NameVisitOutputs(ChanVar(WildCard()), input.knownFree.setWildcardUsed())\n+  }\n+  override def visit( n: NameVar, input: NameVisitInputs ) = {\n+    input.env.get(n.var_) match {\n+      case Some( (level, NameSort) ) => {\n+        NameVisitOutputs(\n+          ChanVar(BoundVar(level)),\n+          input.knownFree)\n+      }\n+      case Some( (level, ProcSort) ) => {\n+        throw new Error(\"Proc variable used in process context.\")\n+      }\n+      case None => {\n+        input.knownFree.get(n.var_) match {\n+          case None =>\n+            val newBindingsPair = \n+              input.knownFree.newBindings(List((n.var_, NameSort)))\n+            NameVisitOutputs(\n+              ChanVar(FreeVar(newBindingsPair._2(0))),\n+              newBindingsPair._1)\n+          case _ => throw new Error(\n+            \"Free variable used as binder may not be used twice.\")\n+        }\n+      }\n+    }\n+  }\n+\n+  override def visit( n: NameQuote, input: NameVisitInputs ) = {","path":"rholang/src/main/scala/rholang/interpreter/Normalize.scala","position":35,"original_position":35,"commit_id":"03c4a146d2113c3d5c006ce114c0bcc5e5ba3360","original_commit_id":"2f6ff22ba72840257f7eba3d28cf6531fcf21a9b","user":{"login":"henrytill","id":6430643,"avatar_url":"https://avatars3.githubusercontent.com/u/6430643?v=4","gravatar_id":"","url":"https://api.github.com/users/henrytill","html_url":"https://github.com/henrytill","followers_url":"https://api.github.com/users/henrytill/followers","following_url":"https://api.github.com/users/henrytill/following{/other_user}","gists_url":"https://api.github.com/users/henrytill/gists{/gist_id}","starred_url":"https://api.github.com/users/henrytill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrytill/subscriptions","organizations_url":"https://api.github.com/users/henrytill/orgs","repos_url":"https://api.github.com/users/henrytill/repos","events_url":"https://api.github.com/users/henrytill/events{/privacy}","received_events_url":"https://api.github.com/users/henrytill/received_events","type":"User","site_admin":false},"body":"Formatting.","created_at":"2018-02-05T21:03:16Z","updated_at":"2018-02-05T21:44:01Z","html_url":"https://github.com/rchain/rchain/pull/224#discussion_r166110862","pull_request_url":"https://api.github.com/repos/rchain/rchain/pulls/224","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments/166110862"},"html":{"href":"https://github.com/rchain/rchain/pull/224#discussion_r166110862"},"pull_request":{"href":"https://api.github.com/repos/rchain/rchain/pulls/224"}}},"pull_request":{"url":"https://api.github.com/repos/rchain/rchain/pulls/224","id":166929716,"html_url":"https://github.com/rchain/rchain/pull/224","diff_url":"https://github.com/rchain/rchain/pull/224.diff","patch_url":"https://github.com/rchain/rchain/pull/224.patch","issue_url":"https://api.github.com/repos/rchain/rchain/issues/224","number":224,"state":"open","locked":false,"title":"Rholang: Normalizer: Add Name normalization","user":{"login":"guardbotmk3","id":33846152,"avatar_url":"https://avatars1.githubusercontent.com/u/33846152?v=4","gravatar_id":"","url":"https://api.github.com/users/guardbotmk3","html_url":"https://github.com/guardbotmk3","followers_url":"https://api.github.com/users/guardbotmk3/followers","following_url":"https://api.github.com/users/guardbotmk3/following{/other_user}","gists_url":"https://api.github.com/users/guardbotmk3/gists{/gist_id}","starred_url":"https://api.github.com/users/guardbotmk3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardbotmk3/subscriptions","organizations_url":"https://api.github.com/users/guardbotmk3/orgs","repos_url":"https://api.github.com/users/guardbotmk3/repos","events_url":"https://api.github.com/users/guardbotmk3/events{/privacy}","received_events_url":"https://api.github.com/users/guardbotmk3/received_events","type":"User","site_admin":false},"body":"Mostly, name normalization delegates to process normalization except for vars\r\nand wildcards. Add tests for var, wildcard, and a sampling of delegation tests.","created_at":"2018-02-02T23:53:46Z","updated_at":"2018-02-05T21:44:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f6ed002e8216d2f7b61972d9a4544fcb4140b7f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pyrocto","id":30355933,"avatar_url":"https://avatars1.githubusercontent.com/u/30355933?v=4","gravatar_id":"","url":"https://api.github.com/users/pyrocto","html_url":"https://github.com/pyrocto","followers_url":"https://api.github.com/users/pyrocto/followers","following_url":"https://api.github.com/users/pyrocto/following{/other_user}","gists_url":"https://api.github.com/users/pyrocto/gists{/gist_id}","starred_url":"https://api.github.com/users/pyrocto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyrocto/subscriptions","organizations_url":"https://api.github.com/users/pyrocto/orgs","repos_url":"https://api.github.com/users/pyrocto/repos","events_url":"https://api.github.com/users/pyrocto/events{/privacy}","received_events_url":"https://api.github.com/users/pyrocto/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/rchain/rchain/pulls/224/commits","review_comments_url":"https://api.github.com/repos/rchain/rchain/pulls/224/comments","review_comment_url":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rchain/rchain/issues/224/comments","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/03c4a146d2113c3d5c006ce114c0bcc5e5ba3360","head":{"label":"guardbotmk3:dev-normalize-visitor","ref":"dev-normalize-visitor","sha":"03c4a146d2113c3d5c006ce114c0bcc5e5ba3360","user":{"login":"guardbotmk3","id":33846152,"avatar_url":"https://avatars1.githubusercontent.com/u/33846152?v=4","gravatar_id":"","url":"https://api.github.com/users/guardbotmk3","html_url":"https://github.com/guardbotmk3","followers_url":"https://api.github.com/users/guardbotmk3/followers","following_url":"https://api.github.com/users/guardbotmk3/following{/other_user}","gists_url":"https://api.github.com/users/guardbotmk3/gists{/gist_id}","starred_url":"https://api.github.com/users/guardbotmk3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardbotmk3/subscriptions","organizations_url":"https://api.github.com/users/guardbotmk3/orgs","repos_url":"https://api.github.com/users/guardbotmk3/repos","events_url":"https://api.github.com/users/guardbotmk3/events{/privacy}","received_events_url":"https://api.github.com/users/guardbotmk3/received_events","type":"User","site_admin":false},"repo":{"id":112254277,"name":"rchain","full_name":"guardbotmk3/rchain","owner":{"login":"guardbotmk3","id":33846152,"avatar_url":"https://avatars1.githubusercontent.com/u/33846152?v=4","gravatar_id":"","url":"https://api.github.com/users/guardbotmk3","html_url":"https://github.com/guardbotmk3","followers_url":"https://api.github.com/users/guardbotmk3/followers","following_url":"https://api.github.com/users/guardbotmk3/following{/other_user}","gists_url":"https://api.github.com/users/guardbotmk3/gists{/gist_id}","starred_url":"https://api.github.com/users/guardbotmk3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardbotmk3/subscriptions","organizations_url":"https://api.github.com/users/guardbotmk3/orgs","repos_url":"https://api.github.com/users/guardbotmk3/repos","events_url":"https://api.github.com/users/guardbotmk3/events{/privacy}","received_events_url":"https://api.github.com/users/guardbotmk3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guardbotmk3/rchain","description":null,"fork":true,"url":"https://api.github.com/repos/guardbotmk3/rchain","forks_url":"https://api.github.com/repos/guardbotmk3/rchain/forks","keys_url":"https://api.github.com/repos/guardbotmk3/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardbotmk3/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardbotmk3/rchain/teams","hooks_url":"https://api.github.com/repos/guardbotmk3/rchain/hooks","issue_events_url":"https://api.github.com/repos/guardbotmk3/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/guardbotmk3/rchain/events","assignees_url":"https://api.github.com/repos/guardbotmk3/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/guardbotmk3/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/guardbotmk3/rchain/tags","blobs_url":"https://api.github.com/repos/guardbotmk3/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardbotmk3/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardbotmk3/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardbotmk3/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardbotmk3/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/guardbotmk3/rchain/languages","stargazers_url":"https://api.github.com/repos/guardbotmk3/rchain/stargazers","contributors_url":"https://api.github.com/repos/guardbotmk3/rchain/contributors","subscribers_url":"https://api.github.com/repos/guardbotmk3/rchain/subscribers","subscription_url":"https://api.github.com/repos/guardbotmk3/rchain/subscription","commits_url":"https://api.github.com/repos/guardbotmk3/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardbotmk3/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardbotmk3/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardbotmk3/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardbotmk3/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/guardbotmk3/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardbotmk3/rchain/merges","archive_url":"https://api.github.com/repos/guardbotmk3/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardbotmk3/rchain/downloads","issues_url":"https://api.github.com/repos/guardbotmk3/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/guardbotmk3/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/guardbotmk3/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/guardbotmk3/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardbotmk3/rchain/labels{/name}","releases_url":"https://api.github.com/repos/guardbotmk3/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/guardbotmk3/rchain/deployments","created_at":"2017-11-27T22:08:36Z","updated_at":"2017-11-27T22:08:40Z","pushed_at":"2018-02-05T21:18:02Z","git_url":"git://github.com/guardbotmk3/rchain.git","ssh_url":"git@github.com:guardbotmk3/rchain.git","clone_url":"https://github.com/guardbotmk3/rchain.git","svn_url":"https://github.com/guardbotmk3/rchain","homepage":null,"size":6127,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rchain:dev","ref":"dev","sha":"9af8d97e0898e6d50718b7b67ef1e51d0ae84fa4","user":{"login":"rchain","id":20671765,"avatar_url":"https://avatars0.githubusercontent.com/u/20671765?v=4","gravatar_id":"","url":"https://api.github.com/users/rchain","html_url":"https://github.com/rchain","followers_url":"https://api.github.com/users/rchain/followers","following_url":"https://api.github.com/users/rchain/following{/other_user}","gists_url":"https://api.github.com/users/rchain/gists{/gist_id}","starred_url":"https://api.github.com/users/rchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchain/subscriptions","organizations_url":"https://api.github.com/users/rchain/orgs","repos_url":"https://api.github.com/users/rchain/repos","events_url":"https://api.github.com/users/rchain/events{/privacy}","received_events_url":"https://api.github.com/users/rchain/received_events","type":"Organization","site_admin":false},"repo":{"id":84493691,"name":"rchain","full_name":"rchain/rchain","owner":{"login":"rchain","id":20671765,"avatar_url":"https://avatars0.githubusercontent.com/u/20671765?v=4","gravatar_id":"","url":"https://api.github.com/users/rchain","html_url":"https://github.com/rchain","followers_url":"https://api.github.com/users/rchain/followers","following_url":"https://api.github.com/users/rchain/following{/other_user}","gists_url":"https://api.github.com/users/rchain/gists{/gist_id}","starred_url":"https://api.github.com/users/rchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchain/subscriptions","organizations_url":"https://api.github.com/users/rchain/orgs","repos_url":"https://api.github.com/users/rchain/repos","events_url":"https://api.github.com/users/rchain/events{/privacy}","received_events_url":"https://api.github.com/users/rchain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rchain/rchain","description":null,"fork":false,"url":"https://api.github.com/repos/rchain/rchain","forks_url":"https://api.github.com/repos/rchain/rchain/forks","keys_url":"https://api.github.com/repos/rchain/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rchain/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rchain/rchain/teams","hooks_url":"https://api.github.com/repos/rchain/rchain/hooks","issue_events_url":"https://api.github.com/repos/rchain/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/rchain/rchain/events","assignees_url":"https://api.github.com/repos/rchain/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/rchain/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/rchain/rchain/tags","blobs_url":"https://api.github.com/repos/rchain/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rchain/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rchain/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/rchain/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/rchain/rchain/languages","stargazers_url":"https://api.github.com/repos/rchain/rchain/stargazers","contributors_url":"https://api.github.com/repos/rchain/rchain/contributors","subscribers_url":"https://api.github.com/repos/rchain/rchain/subscribers","subscription_url":"https://api.github.com/repos/rchain/rchain/subscription","commits_url":"https://api.github.com/repos/rchain/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/rchain/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/rchain/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/rchain/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/rchain/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/rchain/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rchain/rchain/merges","archive_url":"https://api.github.com/repos/rchain/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rchain/rchain/downloads","issues_url":"https://api.github.com/repos/rchain/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/rchain/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/rchain/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/rchain/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rchain/rchain/labels{/name}","releases_url":"https://api.github.com/repos/rchain/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/rchain/rchain/deployments","created_at":"2017-03-09T22:15:35Z","updated_at":"2018-02-05T14:32:40Z","pushed_at":"2018-02-05T21:18:29Z","git_url":"git://github.com/rchain/rchain.git","ssh_url":"git@github.com:rchain/rchain.git","clone_url":"https://github.com/rchain/rchain.git","svn_url":"https://github.com/rchain/rchain","homepage":null,"size":6153,"stargazers_count":140,"watchers_count":140,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":39,"open_issues":17,"watchers":140,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/224"},"html":{"href":"https://github.com/rchain/rchain/pull/224"},"issue":{"href":"https://api.github.com/repos/rchain/rchain/issues/224"},"comments":{"href":"https://api.github.com/repos/rchain/rchain/issues/224/comments"},"review_comments":{"href":"https://api.github.com/repos/rchain/rchain/pulls/224/comments"},"review_comment":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rchain/rchain/pulls/224/commits"},"statuses":{"href":"https://api.github.com/repos/rchain/rchain/statuses/03c4a146d2113c3d5c006ce114c0bcc5e5ba3360"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"henrytill"}}