{"action":"created","issue":{"url":"https://api.github.com/repos/opencog/opencog/issues/1458","labels_url":"https://api.github.com/repos/opencog/opencog/issues/1458/labels{/name}","comments_url":"https://api.github.com/repos/opencog/opencog/issues/1458/comments","events_url":"https://api.github.com/repos/opencog/opencog/issues/1458/events","html_url":"https://github.com/opencog/opencog/issues/1458","id":64333696,"number":1458,"title":"Recursion/Forward-chaining in the pattern matcher.","user":{"login":"linas","id":94368,"avatar_url":"https://avatars.githubusercontent.com/u/94368?v=3","gravatar_id":"","url":"https://api.github.com/users/linas","html_url":"https://github.com/linas","followers_url":"https://api.github.com/users/linas/followers","following_url":"https://api.github.com/users/linas/following{/other_user}","gists_url":"https://api.github.com/users/linas/gists{/gist_id}","starred_url":"https://api.github.com/users/linas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linas/subscriptions","organizations_url":"https://api.github.com/users/linas/orgs","repos_url":"https://api.github.com/users/linas/repos","events_url":"https://api.github.com/users/linas/events{/privacy}","received_events_url":"https://api.github.com/users/linas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opencog/opencog/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/opencog/opencog/labels/pattern-match","name":"pattern-match","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-25T17:55:10Z","updated_at":"2015-03-25T22:53:34Z","closed_at":null,"body":"Currently, forward-chaining is being developed as part of PLN.  A version of it, however, could be done in the pattern matcher, itself.  In many ways, the pattern matcher resembles the ProLog programming language, in terms of what it does.  Patterns are like ProLog programs.  The most significant missing feature is recursion (aka forward-chaining).\r\n\r\nTo support recursion, two link types are needed: DefineLink and MatchLink.  DefineLink is used to give a pattern a name:\r\n```\r\nDefineLink\r\n     NameNode  \"some name\"\r\n     BindLink\r\n        ... etc.\r\n```\r\nwhile the MatchLink is use to \"call\" the previously defined pattern: i.e.\r\n```\r\nBindLink\r\n       variable decls ...\r\n       AndLink\r\n             stuff.\r\n             MatchLink\r\n                  more stuff\r\n```\r\n\r\nThe \"more stuff\" passed to the match link would need to correspond to the signature declared in the DefineLink.\r\n\r\nEvery time a MatchLink is encountered, the sub-pattern it asks for would need to be explored and grounded."},"comment":{"url":"https://api.github.com/repos/opencog/opencog/issues/comments/86244467","html_url":"https://github.com/opencog/opencog/issues/1458#issuecomment-86244467","issue_url":"https://api.github.com/repos/opencog/opencog/issues/1458","id":86244467,"user":{"login":"bgoertzel","id":5907804,"avatar_url":"https://avatars.githubusercontent.com/u/5907804?v=3","gravatar_id":"","url":"https://api.github.com/users/bgoertzel","html_url":"https://github.com/bgoertzel","followers_url":"https://api.github.com/users/bgoertzel/followers","following_url":"https://api.github.com/users/bgoertzel/following{/other_user}","gists_url":"https://api.github.com/users/bgoertzel/gists{/gist_id}","starred_url":"https://api.github.com/users/bgoertzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgoertzel/subscriptions","organizations_url":"https://api.github.com/users/bgoertzel/orgs","repos_url":"https://api.github.com/users/bgoertzel/repos","events_url":"https://api.github.com/users/bgoertzel/events{/privacy}","received_events_url":"https://api.github.com/users/bgoertzel/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T22:53:34Z","updated_at":"2015-03-25T22:53:34Z","body":"This would be a useful feature ;-)\n\nOn Thu, Mar 26, 2015 at 1:55 AM, Linas Vepštas <notifications@github.com>\nwrote:\n\n> Currently, forward-chaining is being developed as part of PLN. A version\n> of it, however, could be done in the pattern matcher, itself. In many ways,\n> the pattern matcher resembles the ProLog programming language, in terms of\n> what it does. Patterns are like ProLog programs. The most significant\n> missing feature is recursion (aka forward-chaining).\n>\n> To support recursion, two link types are needed: DefineLink and MatchLink.\n> DefineLink is used to give a pattern a name:\n>\n> DefineLink\n>      NameNode  \"some name\"\n>      BindLink\n>         ... etc.\n>\n> while the MatchLink is use to \"call\" the previously defined pattern: i.e.\n>\n> BindLink\n>        variable decls ...\n>        AndLink\n>              stuff.\n>              MatchLink\n>                   more stuff\n>\n> The \"more stuff\" passed to the match link would need to correspond to the\n> signature declared in the DefineLink.\n>\n> Every time a MatchLink is encountered, the sub-pattern it asks for would\n> need to be explored and grounded.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/opencog/opencog/issues/1458>.\n>\n\n\n\n-- \nBen Goertzel, PhD\nhttp://goertzel.org\n\n\"The reasonable man adapts himself to the world: the unreasonable one\npersists in trying to adapt the world to himself. Therefore all progress\ndepends on the unreasonable man.\" -- George Bernard Shaw\n"}}