{"action":"created","comment":{"url":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/comments/217097412","pull_request_review_id":154711817,"id":217097412,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzA5NzQxMg==","diff_hunk":"@@ -0,0 +1,118 @@\n+-- | The CEK machine.\n+-- Rules are the same as for the CK machine from \"Language.PlutusCore.Evaluation.CkMachine\",\n+-- except we do not use substitution and use environments instead.\n+-- The CEK machine relies on variables having\n+-- 1. equal 'Unique's whenever they have equal string names\n+-- 2. non-equal 'Unique's whenever they have non-equal string names\n+-- I.e. 'Unique's are used instead of string names, so a renamer pass is required.\n+-- This is for efficiency reasons.\n+-- The CEK machine generates booleans along the way which might contain globally non-unique 'Unique's.\n+-- This is not a problem as the CEK machines handles name capture by design.\n+\n+module PlutusCoreInterpreter.CekMachine\n+    ( EvaluationResult (..)\n+    , evaluateCek\n+    , runCek\n+    ) where\n+\n+import           Language.PlutusCore\n+import           Language.PlutusCore.Constant\n+import           Language.PlutusCore.Evaluation.MachineException (MachineError (..), MachineException (..))\n+import           Language.PlutusCore.Evaluation.Result           (EvaluationResult (..))\n+import           Language.PlutusCore.View\n+import           PlutusPrelude\n+\n+import           Data.IntMap                                     (IntMap)\n+import qualified Data.IntMap                                     as IntMap\n+\n+type Plain f = f TyName Name ()\n+\n+-- | Environments used by the CEK machine.\n+-- Each row is a mapping from the 'Unique' representing a variable to the 'Value' the\n+-- variable stands for and the environment the value was defined in.\n+newtype Environment = Environment (IntMap (Plain Value, Environment))","path":"plutus-core-interpreter/src/PlutusCoreInterpreter/CekMachine.hs","position":33,"original_position":33,"commit_id":"e4ba234bbed5874654fe07368561ab5dc212dd2a","original_commit_id":"e4ba234bbed5874654fe07368561ab5dc212dd2a","user":{"login":"michaelpj","id":1699466,"node_id":"MDQ6VXNlcjE2OTk0NjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1699466?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelpj","html_url":"https://github.com/michaelpj","followers_url":"https://api.github.com/users/michaelpj/followers","following_url":"https://api.github.com/users/michaelpj/following{/other_user}","gists_url":"https://api.github.com/users/michaelpj/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelpj/subscriptions","organizations_url":"https://api.github.com/users/michaelpj/orgs","repos_url":"https://api.github.com/users/michaelpj/repos","events_url":"https://api.github.com/users/michaelpj/events{/privacy}","received_events_url":"https://api.github.com/users/michaelpj/received_events","type":"User","site_admin":false},"body":"I'd be tempted to do `type Closure = (Plain Value, Environment)`.","created_at":"2018-09-12T16:14:11Z","updated_at":"2018-09-12T16:20:30Z","html_url":"https://github.com/input-output-hk/plutus-prototype/pull/79#discussion_r217097412","pull_request_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/79","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/comments/217097412"},"html":{"href":"https://github.com/input-output-hk/plutus-prototype/pull/79#discussion_r217097412"},"pull_request":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/79"}}},"pull_request":{"url":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/79","id":213945486,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzOTQ1NDg2","html_url":"https://github.com/input-output-hk/plutus-prototype/pull/79","diff_url":"https://github.com/input-output-hk/plutus-prototype/pull/79.diff","patch_url":"https://github.com/input-output-hk/plutus-prototype/pull/79.patch","issue_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/issues/79","number":79,"state":"open","locked":false,"title":"[WIP] Adds the CEK machine to plutus-core-interpreter","user":{"login":"effectfully","id":10480926,"node_id":"MDQ6VXNlcjEwNDgwOTI2","avatar_url":"https://avatars1.githubusercontent.com/u/10480926?v=4","gravatar_id":"","url":"https://api.github.com/users/effectfully","html_url":"https://github.com/effectfully","followers_url":"https://api.github.com/users/effectfully/followers","following_url":"https://api.github.com/users/effectfully/following{/other_user}","gists_url":"https://api.github.com/users/effectfully/gists{/gist_id}","starred_url":"https://api.github.com/users/effectfully/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/effectfully/subscriptions","organizations_url":"https://api.github.com/users/effectfully/orgs","repos_url":"https://api.github.com/users/effectfully/repos","events_url":"https://api.github.com/users/effectfully/events{/privacy}","received_events_url":"https://api.github.com/users/effectfully/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-07T14:27:37Z","updated_at":"2018-09-12T16:20:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d61edccb4e302252eaf29a369506396e01e363cc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/79/commits","review_comments_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/79/comments","review_comment_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/comments{/number}","comments_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/issues/79/comments","statuses_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/statuses/e4ba234bbed5874654fe07368561ab5dc212dd2a","head":{"label":"effectfully:plutus-core-interpreter","ref":"plutus-core-interpreter","sha":"e4ba234bbed5874654fe07368561ab5dc212dd2a","user":{"login":"effectfully","id":10480926,"node_id":"MDQ6VXNlcjEwNDgwOTI2","avatar_url":"https://avatars1.githubusercontent.com/u/10480926?v=4","gravatar_id":"","url":"https://api.github.com/users/effectfully","html_url":"https://github.com/effectfully","followers_url":"https://api.github.com/users/effectfully/followers","following_url":"https://api.github.com/users/effectfully/following{/other_user}","gists_url":"https://api.github.com/users/effectfully/gists{/gist_id}","starred_url":"https://api.github.com/users/effectfully/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/effectfully/subscriptions","organizations_url":"https://api.github.com/users/effectfully/orgs","repos_url":"https://api.github.com/users/effectfully/repos","events_url":"https://api.github.com/users/effectfully/events{/privacy}","received_events_url":"https://api.github.com/users/effectfully/received_events","type":"User","site_admin":false},"repo":{"id":140261039,"node_id":"MDEwOlJlcG9zaXRvcnkxNDAyNjEwMzk=","name":"plutus-prototype","full_name":"effectfully/plutus-prototype","owner":{"login":"effectfully","id":10480926,"node_id":"MDQ6VXNlcjEwNDgwOTI2","avatar_url":"https://avatars1.githubusercontent.com/u/10480926?v=4","gravatar_id":"","url":"https://api.github.com/users/effectfully","html_url":"https://github.com/effectfully","followers_url":"https://api.github.com/users/effectfully/followers","following_url":"https://api.github.com/users/effectfully/following{/other_user}","gists_url":"https://api.github.com/users/effectfully/gists{/gist_id}","starred_url":"https://api.github.com/users/effectfully/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/effectfully/subscriptions","organizations_url":"https://api.github.com/users/effectfully/orgs","repos_url":"https://api.github.com/users/effectfully/repos","events_url":"https://api.github.com/users/effectfully/events{/privacy}","received_events_url":"https://api.github.com/users/effectfully/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/effectfully/plutus-prototype","description":null,"fork":true,"url":"https://api.github.com/repos/effectfully/plutus-prototype","forks_url":"https://api.github.com/repos/effectfully/plutus-prototype/forks","keys_url":"https://api.github.com/repos/effectfully/plutus-prototype/keys{/key_id}","collaborators_url":"https://api.github.com/repos/effectfully/plutus-prototype/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/effectfully/plutus-prototype/teams","hooks_url":"https://api.github.com/repos/effectfully/plutus-prototype/hooks","issue_events_url":"https://api.github.com/repos/effectfully/plutus-prototype/issues/events{/number}","events_url":"https://api.github.com/repos/effectfully/plutus-prototype/events","assignees_url":"https://api.github.com/repos/effectfully/plutus-prototype/assignees{/user}","branches_url":"https://api.github.com/repos/effectfully/plutus-prototype/branches{/branch}","tags_url":"https://api.github.com/repos/effectfully/plutus-prototype/tags","blobs_url":"https://api.github.com/repos/effectfully/plutus-prototype/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/effectfully/plutus-prototype/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/effectfully/plutus-prototype/git/refs{/sha}","trees_url":"https://api.github.com/repos/effectfully/plutus-prototype/git/trees{/sha}","statuses_url":"https://api.github.com/repos/effectfully/plutus-prototype/statuses/{sha}","languages_url":"https://api.github.com/repos/effectfully/plutus-prototype/languages","stargazers_url":"https://api.github.com/repos/effectfully/plutus-prototype/stargazers","contributors_url":"https://api.github.com/repos/effectfully/plutus-prototype/contributors","subscribers_url":"https://api.github.com/repos/effectfully/plutus-prototype/subscribers","subscription_url":"https://api.github.com/repos/effectfully/plutus-prototype/subscription","commits_url":"https://api.github.com/repos/effectfully/plutus-prototype/commits{/sha}","git_commits_url":"https://api.github.com/repos/effectfully/plutus-prototype/git/commits{/sha}","comments_url":"https://api.github.com/repos/effectfully/plutus-prototype/comments{/number}","issue_comment_url":"https://api.github.com/repos/effectfully/plutus-prototype/issues/comments{/number}","contents_url":"https://api.github.com/repos/effectfully/plutus-prototype/contents/{+path}","compare_url":"https://api.github.com/repos/effectfully/plutus-prototype/compare/{base}...{head}","merges_url":"https://api.github.com/repos/effectfully/plutus-prototype/merges","archive_url":"https://api.github.com/repos/effectfully/plutus-prototype/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/effectfully/plutus-prototype/downloads","issues_url":"https://api.github.com/repos/effectfully/plutus-prototype/issues{/number}","pulls_url":"https://api.github.com/repos/effectfully/plutus-prototype/pulls{/number}","milestones_url":"https://api.github.com/repos/effectfully/plutus-prototype/milestones{/number}","notifications_url":"https://api.github.com/repos/effectfully/plutus-prototype/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/effectfully/plutus-prototype/labels{/name}","releases_url":"https://api.github.com/repos/effectfully/plutus-prototype/releases{/id}","deployments_url":"https://api.github.com/repos/effectfully/plutus-prototype/deployments","created_at":"2018-07-09T09:14:40Z","updated_at":"2018-09-04T09:32:08Z","pushed_at":"2018-09-12T16:06:55Z","git_url":"git://github.com/effectfully/plutus-prototype.git","ssh_url":"git@github.com:effectfully/plutus-prototype.git","clone_url":"https://github.com/effectfully/plutus-prototype.git","svn_url":"https://github.com/effectfully/plutus-prototype","homepage":null,"size":7608,"stargazers_count":0,"watchers_count":0,"language":"Haskell","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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"input-output-hk:master","ref":"master","sha":"525ba8a513b3da961b3c6f337e3d9973db120fb5","user":{"login":"input-output-hk","id":12909177,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTA5MTc3","avatar_url":"https://avatars3.githubusercontent.com/u/12909177?v=4","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"repo":{"id":73861563,"node_id":"MDEwOlJlcG9zaXRvcnk3Mzg2MTU2Mw==","name":"plutus-prototype","full_name":"input-output-hk/plutus-prototype","owner":{"login":"input-output-hk","id":12909177,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTA5MTc3","avatar_url":"https://avatars3.githubusercontent.com/u/12909177?v=4","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/input-output-hk/plutus-prototype","description":"The Plutus language reference implementation and tools","fork":false,"url":"https://api.github.com/repos/input-output-hk/plutus-prototype","forks_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/forks","keys_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/keys{/key_id}","collaborators_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/teams","hooks_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/hooks","issue_events_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/issues/events{/number}","events_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/events","assignees_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/assignees{/user}","branches_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/branches{/branch}","tags_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/tags","blobs_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/git/refs{/sha}","trees_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/git/trees{/sha}","statuses_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/statuses/{sha}","languages_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/languages","stargazers_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/stargazers","contributors_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/contributors","subscribers_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/subscribers","subscription_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/subscription","commits_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/commits{/sha}","git_commits_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/git/commits{/sha}","comments_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/comments{/number}","issue_comment_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/issues/comments{/number}","contents_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/contents/{+path}","compare_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/compare/{base}...{head}","merges_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/merges","archive_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/downloads","issues_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/issues{/number}","pulls_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls{/number}","milestones_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/milestones{/number}","notifications_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/labels{/name}","releases_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/releases{/id}","deployments_url":"https://api.github.com/repos/input-output-hk/plutus-prototype/deployments","created_at":"2016-11-15T22:38:43Z","updated_at":"2018-09-12T14:05:27Z","pushed_at":"2018-09-12T16:06:56Z","git_url":"git://github.com/input-output-hk/plutus-prototype.git","ssh_url":"git@github.com:input-output-hk/plutus-prototype.git","clone_url":"https://github.com/input-output-hk/plutus-prototype.git","svn_url":"https://github.com/input-output-hk/plutus-prototype","homepage":"","size":7607,"stargazers_count":127,"watchers_count":127,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":20,"open_issues":11,"watchers":127,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/79"},"html":{"href":"https://github.com/input-output-hk/plutus-prototype/pull/79"},"issue":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/issues/79"},"comments":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/input-output-hk/plutus-prototype/statuses/e4ba234bbed5874654fe07368561ab5dc212dd2a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"michaelpj"}}