Join GitHub today
Recursion/Forward-chaining in the pattern matcher. #1458
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:
while the MatchLink is use to "call" the previously defined pattern: i.e.
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.
This would be a useful feature ;-)
On Thu, Mar 26, 2015 at 1:55 AM, Linas Vepštas firstname.lastname@example.org
Ben Goertzel, PhD
"The reasonable man adapts himself to the world: the unreasonable one
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.
Note the above MatchLink is now called PutLink. Some notes on recursion can be found here: