Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursion/Forward-chaining in the pattern matcher. #1458

Closed
linas opened this issue Mar 25, 2015 · 4 comments

Comments

@linas
Copy link
Member

commented Mar 25, 2015

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).

To support recursion, two link types are needed: DefineLink and MatchLink. DefineLink is used to give a pattern a name:

DefineLink
     NameNode  "some name"
     BindLink
        ... etc.

while the MatchLink is use to "call" the previously defined pattern: i.e.

BindLink
       variable decls ...
       AndLink
             stuff.
             MatchLink
                  more stuff

The "more stuff" passed to the match link would need to correspond to the signature declared in the DefineLink.

Every time a MatchLink is encountered, the sub-pattern it asks for would need to be explored and grounded.

@bgoertzel

This comment has been minimized.

Copy link
Contributor

commented Mar 25, 2015

This would be a useful feature ;-)

On Thu, Mar 26, 2015 at 1:55 AM, Linas Vepštas notifications@github.com
wrote:

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).

To support recursion, two link types are needed: DefineLink and MatchLink.
DefineLink is used to give a pattern a name:

DefineLink
NameNode "some name"
BindLink
... etc.

while the MatchLink is use to "call" the previously defined pattern: i.e.

BindLink
variable decls ...
AndLink
stuff.
MatchLink
more stuff

The "more stuff" passed to the match link would need to correspond to the
signature declared in the DefineLink.

Every time a MatchLink is encountered, the sub-pattern it asks for would
need to be explored and grounded.


Reply to this email directly or view it on GitHub
#1458.

Ben Goertzel, PhD
http://goertzel.org

"The reasonable man adapts himself to the world: the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man." -- George Bernard Shaw

@linas

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2015

Status: this is partly implemented and sort-of-ish works in some simple cases. There are a few theoretical issues I haven't yet resolved, that prevent forward progress.

The next step is to support ExecutionOutputLink in the body of the pattern, so that, while pattern-matching, if there is an ExecutionOutputLink in the pattern, then it is executed on the spot, and matching continues with whatever it is that it returned as the new pattern.

There's some preliminary support for this now, but its not actually done yet.

@linas

This comment has been minimized.

Copy link
Member Author

commented Aug 31, 2015

Closing. Things have changed a lot since this oringianl report. Much of the work has been done or is being done within the scope of opencog/atomspace#74

@linas linas closed this Aug 31, 2015

@linas

This comment has been minimized.

Copy link
Member Author

commented Aug 31, 2015

Note the above MatchLink is now called PutLink. Some notes on recursion can be found here:

http://wiki.opencog.org/wikihome/index.php/PutLink#Recursion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.