{"action":"created","comment":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/comments/41599340","id":41599340,"diff_hunk":"@@ -123,3 +127,74 @@ void PutLinkUTest::test_filtering()\n \n \tlogger().info(\"END TEST: %s\", __FUNCTION__);\n }\n+\n+void PutLinkUTest::test_lambda()\n+{\n+\tlogger().info(\"BEGIN TEST: %s\", __FUNCTION__);\n+\n+\t// Test that the substitution follows the order of variables\n+\t// provided in the lambda rather than left-to-right in the body.\n+\tHandle lam =\n+\t\tL(LAMBDA_LINK,\n+\t\t  L(VARIABLE_LIST,\n+\t\t    N(VARIABLE_NODE, \"$x\"),\n+\t\t    N(VARIABLE_NODE, \"$y\")),\n+\t\t  L(INHERITANCE_LINK,\n+\t\t    N(VARIABLE_NODE, \"$y\"),\n+\t\t    N(VARIABLE_NODE, \"$x\")));\n+\tHandle put =\n+\t\tL(PUT_LINK,\n+\t\t  lam,\n+\t\t  L(LIST_LINK,\n+\t\t    N(CONCEPT_NODE, \"animal\"),\n+\t\t    N(CONCEPT_NODE, \"coyote\")));\n+\n+\tInstantiator inst(&_as);\n+\tHandle putted = inst.execute(put);\n+\n+\tHandle expected_putted =\n+\t\tL(INHERITANCE_LINK,\n+\t\t  N(CONCEPT_NODE, \"coyote\"),\n+\t\t  N(CONCEPT_NODE, \"animal\"));\n+\n+\tprintf(\"Expecting %s\\n\", expected_putted->toString().c_str());\n+\tprintf(\"Got %s\\n\", putted->toString().c_str());\n+\tTS_ASSERT_EQUALS(putted, expected_putted);\n+\n+\tlogger().info(\"END TEST: %s\", __FUNCTION__);\n+}\n+\n+void PutLinkUTest::test_forall()\n+{\n+\tlogger().info(\"BEGIN TEST: %s\", __FUNCTION__);\n+\n+\t// Identical to test_lambda but uses a forall instead.\n+\tHandle lam =\n+\t\tL(FORALL_LINK,\n+\t\t  L(VARIABLE_LIST,\n+\t\t    N(VARIABLE_NODE, \"$x\"),\n+\t\t    N(VARIABLE_NODE, \"$y\")),\n+\t\t  L(INHERITANCE_LINK,\n+\t\t    N(VARIABLE_NODE, \"$y\"),\n+\t\t    N(VARIABLE_NODE, \"$x\")));\n+\tHandle put =\n+\t\tL(PUT_LINK,\n+\t\t  lam,\n+\t\t  L(LIST_LINK,\n+\t\t    N(CONCEPT_NODE, \"animal\"),\n+\t\t    N(CONCEPT_NODE, \"coyote\")));\n+","path":"tests/atoms/PutLinkUTest.cxxtest","position":78,"original_position":78,"commit_id":"1c2c3f0321924117cd4ea45570981cd29008d42b","original_commit_id":"1c2c3f0321924117cd4ea45570981cd29008d42b","user":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"body":"@AmeBel I probably shouldn't insist on that cause it might bring more confusion than anything. On the practical level I agree with @linas. On a more philosophical level, I think one can indeed define a formal system where forall inherits the properties of a lambda while not falling into inconsistencies.","created_at":"2015-10-09T05:45:56Z","updated_at":"2015-10-09T05:45:56Z","html_url":"https://github.com/opencog/atomspace/pull/386#discussion_r41599340","pull_request_url":"https://api.github.com/repos/opencog/atomspace/pulls/386","_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments/41599340"},"html":{"href":"https://github.com/opencog/atomspace/pull/386#discussion_r41599340"},"pull_request":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/386"}}},"pull_request":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/386","id":47145204,"html_url":"https://github.com/opencog/atomspace/pull/386","diff_url":"https://github.com/opencog/atomspace/pull/386.diff","patch_url":"https://github.com/opencog/atomspace/pull/386.patch","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/386","number":386,"state":"closed","locked":false,"title":"Make forall a lambda","user":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"body":"Somewhat experimental, make ForAllLink inherit LambdaLink.\r\n\r\nThe practical side effect is that you can put a ForAllLink inside a PutLink.","created_at":"2015-10-08T12:18:44Z","updated_at":"2015-10-09T05:45:56Z","closed_at":"2015-10-08T12:38:02Z","merged_at":"2015-10-08T12:38:02Z","merge_commit_sha":"dde1cfc5cb617204bd5ca0e5c075e8861c7b6199","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opencog/atomspace/pulls/386/commits","review_comments_url":"https://api.github.com/repos/opencog/atomspace/pulls/386/comments","review_comment_url":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/386/comments","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/1c2c3f0321924117cd4ea45570981cd29008d42b","head":{"label":"ngeiswei:make-forall-a-lambda","ref":"make-forall-a-lambda","sha":"1c2c3f0321924117cd4ea45570981cd29008d42b","user":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"repo":{"id":34892320,"name":"atomspace","full_name":"ngeiswei/atomspace","owner":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngeiswei/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":true,"url":"https://api.github.com/repos/ngeiswei/atomspace","forks_url":"https://api.github.com/repos/ngeiswei/atomspace/forks","keys_url":"https://api.github.com/repos/ngeiswei/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngeiswei/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngeiswei/atomspace/teams","hooks_url":"https://api.github.com/repos/ngeiswei/atomspace/hooks","issue_events_url":"https://api.github.com/repos/ngeiswei/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/ngeiswei/atomspace/events","assignees_url":"https://api.github.com/repos/ngeiswei/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/ngeiswei/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/ngeiswei/atomspace/tags","blobs_url":"https://api.github.com/repos/ngeiswei/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngeiswei/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngeiswei/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngeiswei/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngeiswei/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/ngeiswei/atomspace/languages","stargazers_url":"https://api.github.com/repos/ngeiswei/atomspace/stargazers","contributors_url":"https://api.github.com/repos/ngeiswei/atomspace/contributors","subscribers_url":"https://api.github.com/repos/ngeiswei/atomspace/subscribers","subscription_url":"https://api.github.com/repos/ngeiswei/atomspace/subscription","commits_url":"https://api.github.com/repos/ngeiswei/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngeiswei/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngeiswei/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngeiswei/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/ngeiswei/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/ngeiswei/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngeiswei/atomspace/merges","archive_url":"https://api.github.com/repos/ngeiswei/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngeiswei/atomspace/downloads","issues_url":"https://api.github.com/repos/ngeiswei/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/ngeiswei/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/ngeiswei/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/ngeiswei/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngeiswei/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/ngeiswei/atomspace/releases{/id}","created_at":"2015-05-01T06:34:02Z","updated_at":"2015-05-03T09:13:21Z","pushed_at":"2015-10-08T17:56:15Z","git_url":"git://github.com/ngeiswei/atomspace.git","ssh_url":"git@github.com:ngeiswei/atomspace.git","clone_url":"https://github.com/ngeiswei/atomspace.git","svn_url":"https://github.com/ngeiswei/atomspace","homepage":"","size":141357,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opencog:master","ref":"master","sha":"c57b2f1ff0165894b7589a4c4b9305fbb131362b","user":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"repo":{"id":34678084,"name":"atomspace","full_name":"opencog/atomspace","owner":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencog/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":false,"url":"https://api.github.com/repos/opencog/atomspace","forks_url":"https://api.github.com/repos/opencog/atomspace/forks","keys_url":"https://api.github.com/repos/opencog/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencog/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencog/atomspace/teams","hooks_url":"https://api.github.com/repos/opencog/atomspace/hooks","issue_events_url":"https://api.github.com/repos/opencog/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/opencog/atomspace/events","assignees_url":"https://api.github.com/repos/opencog/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/opencog/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/opencog/atomspace/tags","blobs_url":"https://api.github.com/repos/opencog/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencog/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencog/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencog/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/opencog/atomspace/languages","stargazers_url":"https://api.github.com/repos/opencog/atomspace/stargazers","contributors_url":"https://api.github.com/repos/opencog/atomspace/contributors","subscribers_url":"https://api.github.com/repos/opencog/atomspace/subscribers","subscription_url":"https://api.github.com/repos/opencog/atomspace/subscription","commits_url":"https://api.github.com/repos/opencog/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencog/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencog/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencog/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencog/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/opencog/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencog/atomspace/merges","archive_url":"https://api.github.com/repos/opencog/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencog/atomspace/downloads","issues_url":"https://api.github.com/repos/opencog/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/opencog/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/opencog/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/opencog/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencog/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/opencog/atomspace/releases{/id}","created_at":"2015-04-27T16:32:57Z","updated_at":"2015-10-07T22:52:36Z","pushed_at":"2015-10-08T21:37:08Z","git_url":"git://github.com/opencog/atomspace.git","ssh_url":"git@github.com:opencog/atomspace.git","clone_url":"https://github.com/opencog/atomspace.git","svn_url":"https://github.com/opencog/atomspace","homepage":"","size":152137,"stargazers_count":25,"watchers_count":25,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":27,"forks":34,"open_issues":27,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/386"},"html":{"href":"https://github.com/opencog/atomspace/pull/386"},"issue":{"href":"https://api.github.com/repos/opencog/atomspace/issues/386"},"comments":{"href":"https://api.github.com/repos/opencog/atomspace/issues/386/comments"},"review_comments":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/386/comments"},"review_comment":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/386/commits"},"statuses":{"href":"https://api.github.com/repos/opencog/atomspace/statuses/1c2c3f0321924117cd4ea45570981cd29008d42b"}}}}