TypeProduct

From OpenCog
Jump to: navigation, search

The TypeProduct is a hypothetical, unimplemented, proposed atom type that would implement the concept of a product type. Currently, the TypeProduct can be implemented by hacking together a SignatureLink together with an AndLink.

In type theory, the product type is a form of Cartesian product or tuple; is is the product in the category of sets. The coproduct is described by the TypeChoice Link; it corresponds to the sum type, and thus is a form of disjoint union, and is thus the coproduct in the category of sets.

Since we have an explicit, easy-to-use TypeChoice for the sum type, it makes sense to have an explicit, easy-to-use TypeProduct for the product type. On the other hand, we are trying to not over-engineer the system, so this does not yet exist.

The concept of a product type is a rather hi-fallutin way of talking about what are called "ordered pairs", "lists" and "tuples" in ordinary programming languages. Thus, other plausible names for this thing could be TypeList or TypeTuple. However, we kind of like the mathematical name better, because we believe that you will find this stuff easier to use if you actually understand what the heck is going on! And, for that, its important to review the theory of types, as implemented in the AtomSpace.