Hi Linas, Ramin, etc. ,
In the course of the recent dialogue w/ Linas about the pattern
matcher, it has occurred to me that it would be very useful to have
some extensions to the current Execution Link...
As currently defined at
http://wiki.opencog.org/w/ExecutionLink
the practical definition of ExecutionLink seems to be
ExecutionLink
SchemaNode schema-name
ListLink
SomeAtom arg_1
OtherAtom arg_2
...
However, in the prior OpenCog conceptual documentation, there is an
optional additional argument, so that we would have
BindLink
VariableNode $v1
ExecutionLink
SchemaNode schema-name
ListLink
SomeAtom arg_1
OtherAtom arg_2
...
$v1
The semantics of this would be: once the schema is run on the given
arguments, the resultant output is put into the variable $v1
For convenience, we could also define a SequentialExecutionLink.
This would take as its argument a list of GroundedSchemaNodes, i.e.
BindLink
VariableNode $v1
VariableNode $v2
...
VariableNode $vn
SequentialExecutionLink
(GroundedSchemaNode gs_1, args_1)
(GroundedSchemaNode gs_2, args_2)
...
(GroundedSchemaNode gs_n, args_n)
The basic idea is that, when the Sequential ExecutionLink is executed, then
-- The output of running GroundedSchemaNode gs_k, is placed into the
variable $v_k
-- The argument of GroundedSchemaNode gs_k, args_k, may use the
variables $v_1 ... $v_(k-1)....
-- Also, the GroundedSchemaNode gs_k, itself, may be defined as one of
the variables $v1 ... $v_{k-1}
...
Using this construct, a PLN ForwardInferenceStep might be written like
BindLink
VariableNode $var, $R, $var1
SequentialExecutionLink
GroundedSchemaNode ChooseRandomLinkSourceInAttentionalFocus
(GroundedSchemaNode ChooseInferenceRule , $var )
(GroundedSchemaNode ChooseInferenceArgument, ($var, $R) )
(GroundedSchemaNode $R, ($var, $var1) )
...
This would seem to give us a simple way to code simple cognitive
processes (like inference steps) directly in the OpenCog hypergraph...
In the case of backward inference, one of the GroundedSchemaNodes
invoked in the sequence would itself contain code invoking the pattern
matcher...
We could also have Simultaneous ExecutionLink, of course, and nest the
two types to do stuff like (suppressing the explicit List and
compressing the notation a little)
BindLink
VariableNode ($v1, $v2, $v3, $v4)
SequentialExecutionLink
GroundedSchemaNode gs1
SimultaneousExecutionLink
(GroundedSchemaNode gs2 ,$v1 )
(GroundedSchemaNode gs3, $v1 )
(GroundedSchemaNode gs4, ($v2, $v3))
The "executor" in the pattern matcher could potentially be extended to
handle these constructs...
Thoughts?
-- Ben
--
Ben Goertzel, PhD
http://goertzel.org
"My humanity is a constant self-overcoming" -- Friedrich Nietzsche