Boost logo

Boost :

From: Doug Gregor (gregod_at_[hidden])
Date: 2001-01-14 18:34:17


On Sunday 14 January 2001 02:43, you wrote:
> I've attempted to do a boost concept checking version of
> the algebra concepts from RPI. They can be view at:
>
> http://www.lsc.nd.edu/~jsiek/tlc/algebra/algebra_concepts.hpp

There is a distinct difference between the Boost concept checking library and
the concept checking we've been doing in our research at RPI: BCCL uses
structural conformance (i.e., will it compile) and we use named conformance
(i.e., has the user indicated that this semantic constraint holds). While
structural conformance is clearly necessary for better error messages and is
the only choice in some cases (e.g., standard library functions where the
interface cannot be changed), named conformance helps assert that the
algorithm is used correctly.

I mentioned before the Russian peasant algorithm for integer exponentiation,
which requires that its parameter be a semigroup element over the operation
*. Structural conformance will allow this algorithm to be instantiated with
an unsafe type (i.e., octonions) but the final result will be incorrect.
Named conformance, of course, won't allow this to occur.

Does Boost need named conformance checking? It can help assure correctness of
programs better than structural conformance, but it raises the bar
significantly for users. I wonder how useful algebraic concepts are without
named conformance as most of the usefulness of the algebra concept hierarchy
is in the semantic information. Both BOOST_CLASS_REQUIRES(Domain, Op,
Associative) and BOOST_CLASS_REQUIRES(Domain, Op, BinaryOp) perform the same
structural concept checks, but the first has a much stronger semantic
condition.

        Doug Gregor
        gregod_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk