ComposeLink

From OpenCog
Jump to: navigation, search

ComposeLink (not implemented yet) would implement function composition. With that one could simplify the following Atomese code

DefineLink
   DefinedSchemaNode “getRobotCurrentSeriesPredictabilityDiscontinuitySeries”
      LambdaLink
         ListLink
            TypedVariableLink
               VariableNode "$T"
               TypeNode "TimeNode"
            TypedVariableLink
               VariableNode "$N"
               TypeNode "NumberNode"
         ExecutionOutputLink
            GroundedSchemaNode “py:calculateDiscontinuities”
            ExecutionOutputLink
               DefinedSchemaNode “getRobotCurrentSeriesPredictability”
               ListLink
                  VariableNode "$T"
                  VariableNode "$N"

replacing it by

DefineLink
   DefinedSchemaNode “getRobotCurrentSeriesPredictabilityDiscontinuitySeries”
   ComposeLink
      GroundedSchemaNode “py:calculateDiscontinuities”
      DefinedSchemaNode “getRobotCurrentSeriesPredictability”

The type system would also implicitly create an appropriate type signature for the result of the composition.