Boost logo

Glas :

Re: [glas] Skalar-Like concepts from GLAS and MTL

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2005-05-25 15:24:20

Peter Gottschling wrote:

>> As for the 'pure algebraic concepts', your concept definitions are in
>> line (but more detailed) of the current glas proposal. So I propose to
>> merge these in the current proposal.
> I am happy to read this. :-)

I've been thinking a lot about your proposal and I'm starting of with
adding the pure algebraic concepts. Here's the first concept I added
(Magma). I've also added that op is a model of BinaryFunctor with a link
to the STL definition of the word. I will continue to add the pure
algebraic structures and then continue with the others. Let me know if
you agree with the current documentation.


Glas: Magma concept

Magma concept


A magma is an algebraic structure on a finite or infinite set equipped with an operator where the set is closed under this operation.

Refinement of



S type of a set
Op type of functor
a, b Objects of type S
op model of BinaryFunction.
{S,op} model of Magma


Valid expressions

In addition to those defined by Assignable:
Name Expression Return type
Operation op(a,b) S or convertible to S

Expression semantics

Name Expression Precondition Semantics Postcondition

Complexity guarantees


Closure op(a,b) returns an element of the set S