Boost logo

Glas :

Re: [glas] pure algebraic concepts cfr additive

From: Peter Gottschling (pgottsch_at_[hidden])
Date: 2005-05-26 19:02:28


On May 26, 2005, at 3:22 PM, Toon Knapen wrote:

> I'm currently wondering if it's a good idea to consider AdditiveMagma
> to be a refinement of the Magma concept. This might sound strange but
> let me explain.
>
> For the pure algebraic concepts, we always talk about a set S and some
> operation-type which is conform to a BinaryFunctor.
> In the case of an AdditiveMagma, we don't need a seperate
> BinaryFunctor but instead we have an 'operator+(const T&)'. The
> operator+ is defined on the elements of the set.

Of course, this looks strange in the first place that a single-type
concept refines a multi-type concept. By definition a refinement is an
addition of requirements, which implies that every type T that model
concept C2 necessarily models C1 if C2 is a refinement of C1. To have
this property between AdditiveMagma and Magma we need an extra tool,
the default functor. As I defined the concepts and the default
functors, every type that models AdditiveMagma is always a model of
Magma using the default functor.

We can discuss if this is really a refinement in the pure sense of the
definition. We could may be call it semi-refinement or weak refinement
for distinction because it uses a tool. The important point is that it
works for implementations, i.e. every type that model some additive
concept can _always_ call a template function requiring the
corresponding pure algebraic function. And this is from my prospective
more important than whether we call it refinement or semi-refinement.

BTW, we shall also check whether we can implement this (semi-)
refinement with the type traits for identity and inverse.
>
> Additionally, it is also possible to take a model of an AdditiveMagma
> and an operator that together are a model of a Magma. It might sound
> weird but I think this is kind of powerfull.
>
This was my intension to show that addition and multiplication are only
two instances of operation. Surely, the most important by far but not
the only ones.

Peter
------------
Peter Gottschling
Research Associate
Open Systems Laboratory
Indiana University
301i Lindley Hall
Bloomington, IN 47405
Tel.: +1 812 855-8898 Fax: +1 812 856 0853
http://www.osl.iu.edu/~pgottsch