ConsLink

From OpenCog
Jump to: navigation, search

ConsLink is a proposed link type that could be used to represent lists as a binary trees. It is the Atomese equivalent of cons.

Motivation

Such representation is better suited for recursing over lists, and would offer an alternative, possibly finer, mechanism to extract information from lists in addition to GlobNode.

Example

List A B C

would be equivalent to

Cons
  A
  Cons
    B
    Cons
      C
      List

Open Questions

  • Should such equivalence be hardcoded in the AtomSpace? Should the reduct engine take care of it instead?
  • There seem to be fundamental problems with ConsLinks: they are not editable (thus, they suffer from the same issues that SetLink suffers from)
  • ConsLink is also difficult to pattern match, because it is not possible to know, a priori, how long a ConsLink list might be, and so one doesn't know how to write a pattern for it.