• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*-----------------------------------------------------------------------------+
2 Copyright (c) 2008-2010: Joachim Faulhaber
3 +------------------------------------------------------------------------------+
4    Distributed under the Boost Software License, Version 1.0.
5       (See accompanying file LICENCE.txt or copy at
6            http://www.boost.org/LICENSE_1_0.txt)
7 +-----------------------------------------------------------------------------*/
8 #ifndef BOOST_LIBS_ICL_TEST_ICL_LAWS_HPP_JOFA_090119
9 #define BOOST_LIBS_ICL_TEST_ICL_LAWS_HPP_JOFA_090119
10 
11 #include <boost/icl/type_traits/identity_element.hpp>
12 #include <boost/icl/associative_interval_container.hpp>
13 
14 namespace boost{namespace icl
15 {
16 
17 template<class Type>
18 struct equality
19 {
20     typedef Type first_argument_type;
21     typedef Type second_argument_type;
22     typedef bool result_type;
23     typedef bool (type)(const Type&, const Type&);
24 };
25 
26 //------------------------------------------------------------------------------
27 // Associativity
28 //------------------------------------------------------------------------------
29 
30 // The definition of a boost test via a macro, that allows to be instantiated for
31 // different operator signs 'op_sign'. For every 'op_sign' a separate function
32 // template is generated by appending the suffic 'op_tag' to the function
33 // name.
34 // So this is the function template via macro that checks the law
35 // associativity for an operator 'op_sign'
36 #define DEFINE_ASSOCIATIVITY_CHECK_WRT(op_tag, op_sign) \
37 template<class Type, class TypeB, class TypeC> \
38 void check_associativity_wrt_##op_tag(const Type& a, const TypeB& b, const TypeC& c) \
39 { \
40     Type left  = (a op_sign b) op_sign c; \
41     Type right = a op_sign (b op_sign c); \
42     BOOST_CHECK(left==right); \
43 }
44 
45 #define DEFINE_ASSOCIATIVITY_CHECK_WRT_EQUAL(op_tag, op_sign) \
46 template<class Type, class TypeB, class TypeC> \
47 void check_associativity_wrt_equal_##op_tag \
48 (typename equality<Type>::type* equal, \
49 const Type& a, const TypeB& b, const TypeC& c) \
50 { \
51     Type left  = (a op_sign b) op_sign c; \
52     Type right = a op_sign (b op_sign c); \
53     BOOST_CHECK((*equal)(left,right)); \
54 }
55 
56 // Here we define the call of the test function thats definition
57 // template has been generated by the macro above.
58 #define CHECK_ASSOCIATIVITY_WRT(op_tag)       check_associativity_wrt_##op_tag
59 #define CHECK_ASSOCIATIVITY_WRT_EQUAL(op_tag) check_associativity_wrt_equal_##op_tag
60 
61 // Here we actually generate function templates by calling the defining
62 // macros.
63 DEFINE_ASSOCIATIVITY_CHECK_WRT      (plus,  + )
64 DEFINE_ASSOCIATIVITY_CHECK_WRT_EQUAL(plus,  + )
65 DEFINE_ASSOCIATIVITY_CHECK_WRT      (pipe,  | )
66 DEFINE_ASSOCIATIVITY_CHECK_WRT_EQUAL(pipe,  | )
67 DEFINE_ASSOCIATIVITY_CHECK_WRT      (et,    & )
68 DEFINE_ASSOCIATIVITY_CHECK_WRT_EQUAL(et,    & )
69 DEFINE_ASSOCIATIVITY_CHECK_WRT      (caret, ^ )
70 DEFINE_ASSOCIATIVITY_CHECK_WRT_EQUAL(caret, ^ )
71 
72 
73 //------------------------------------------------------------------------------
74 // Neutrality
75 //------------------------------------------------------------------------------
76 
77 #define DEFINE_RIGHT_NEUTRALITY_CHECK_WRT_EQUAL(op_tag, op_sign) \
78 template<class Type> \
79 void check_right_neutrality_wrt_equal_##op_tag \
80 (typename equality<Type>::type* equal, const Type& a, const Type& identity_element) \
81 { \
82     Type left  = a op_sign identity_element; \
83     Type right = identity_element; \
84     BOOST_CHECK((*equal)(left,right)); \
85 }
86 
87 #define DEFINE_RIGHT_NEUTRALITY_CHECK_WRT(op_tag, op_sign) \
88 template<class Type> \
89 void check_right_neutrality_wrt_##op_tag \
90 (typename equality<Type>::type* equal, const Type& a, const Type& identity_element) \
91 { \
92     Type left  = a op_sign identity_element; \
93     Type right = identity_element; \
94     BOOST_CHECK(left==right); \
95 }
96 
97 #define DEFINE_NEUTRALITY_CHECK_WRT_EQUAL(op_tag, op_sign) \
98 template<class Type> \
99 void check_neutrality_wrt_equal_##op_tag \
100 (typename equality<Type>::type* equal, const Type& a, const Type& identity_element) \
101 { \
102     Type left  = a op_sign identity_element; \
103     Type right = identity_element op_sign a; \
104     BOOST_CHECK((*equal)(left,right)); \
105 }
106 
107 #define DEFINE_NEUTRALITY_CHECK_WRT(op_tag, op_sign) \
108 template<class Type> \
109 void check_neutrality_wrt_##op_tag \
110 (const Type& a, const Type& identity_element) \
111 { \
112     Type left  = a op_sign identity_element; \
113     Type right = identity_element op_sign a; \
114     BOOST_CHECK(left==right); \
115 }
116 
117 #define CHECK_NEUTRALITY_WRT(op_tag) check_neutrality_wrt_##op_tag
118 #define CHECK_NEUTRALITY_WRT_EQUAL(op_tag) check_neutrality_wrt_equal_##op_tag
119 
120 DEFINE_NEUTRALITY_CHECK_WRT      (plus,  + )
121 DEFINE_NEUTRALITY_CHECK_WRT_EQUAL(plus,  + )
122 DEFINE_NEUTRALITY_CHECK_WRT      (pipe,  | )
123 DEFINE_NEUTRALITY_CHECK_WRT_EQUAL(pipe,  | )
124 DEFINE_NEUTRALITY_CHECK_WRT      (minus, - )
125 DEFINE_NEUTRALITY_CHECK_WRT_EQUAL(minus, - )
126 DEFINE_NEUTRALITY_CHECK_WRT      (et,    & )
127 DEFINE_NEUTRALITY_CHECK_WRT_EQUAL(et,    & )
128 DEFINE_NEUTRALITY_CHECK_WRT      (caret, ^ )
129 DEFINE_NEUTRALITY_CHECK_WRT_EQUAL(caret, ^ )
130 
131 //------------------------------------------------------------------------------
132 // Commutativity
133 //------------------------------------------------------------------------------
134 
135 #define DEFINE_COMMUTATIVITY_CHECK_WRT_EQUAL(op_tag, op_sign) \
136 template<class Type, class TypeB> \
137 void check_commutativity_wrt_equal_##op_tag \
138 (typename equality<Type>::type* equal, const Type& a, const TypeB& b) \
139 { \
140     Type left  = a op_sign b; \
141     Type right = b op_sign a; \
142     BOOST_CHECK((*equal)(left,right)); \
143 }
144 
145 #define DEFINE_COMMUTATIVITY_CHECK_WRT(op_tag, op_sign) \
146 template<class Type, class TypeB> \
147     void check_commutativity_wrt_##op_tag(const Type& a, const TypeB& b) \
148 { \
149     Type left  = a op_sign b; \
150     Type right = b op_sign a; \
151     BOOST_CHECK(left==right); \
152 }
153 
154 #define CHECK_COMMUTATIVITY_WRT_EQUAL(op_tag) check_commutativity_wrt_equal_##op_tag
155 #define CHECK_COMMUTATIVITY_WRT(op_tag) check_commutativity_wrt_##op_tag
156 
157 DEFINE_COMMUTATIVITY_CHECK_WRT      (plus,  + )
158 DEFINE_COMMUTATIVITY_CHECK_WRT_EQUAL(plus,  + )
159 DEFINE_COMMUTATIVITY_CHECK_WRT      (pipe,  | )
160 DEFINE_COMMUTATIVITY_CHECK_WRT_EQUAL(pipe,  | )
161 DEFINE_COMMUTATIVITY_CHECK_WRT      (et,    & )
162 DEFINE_COMMUTATIVITY_CHECK_WRT_EQUAL(et,    & )
163 DEFINE_COMMUTATIVITY_CHECK_WRT      (caret, ^ )
164 DEFINE_COMMUTATIVITY_CHECK_WRT_EQUAL(caret, ^ )
165 
166 //------------------------------------------------------------------------------
167 // Natural inversion
168 //------------------------------------------------------------------------------
169 
170 #define DEFINE_PARTIAL_INVERSION_CHECK_WRT_EQUAL(plus_tag, plus_sign) \
171 template<class Type> \
172     void check_partial_inversion_wrt_equal_##plus_tag \
173 (typename equality<Type>::type* equal, const Type& identity_element, const Type& var_a) \
174 { \
175     Type positive_difference  = var_a - var_a; \
176     BOOST_CHECK((*equal)(positive_difference, identity_element)); \
177 }
178 
179 #define DEFINE_PARTIAL_INVERSION_CHECK_WRT(plus_tag, plus_sign) \
180 template<class Type> \
181     void check_partial_inversion_wrt_##plus_tag \
182 (const Type& identity_element, const Type& var_a) \
183 { \
184     Type positive_difference  = var_a - var_a; \
185     BOOST_CHECK(positive_difference==identity_element); \
186 }
187 
188 #define CHECK_PARTIAL_INVERSION_WRT_EQUAL(plus_tag) check_partial_inversion_wrt_equal_##plus_tag
189 #define CHECK_PARTIAL_INVERSION_WRT(plus_tag) check_partial_inversion_wrt_##plus_tag
190 
191 DEFINE_PARTIAL_INVERSION_CHECK_WRT      (plus,  + )
192 DEFINE_PARTIAL_INVERSION_CHECK_WRT_EQUAL(plus,  + )
193 DEFINE_PARTIAL_INVERSION_CHECK_WRT      (pipe,  | )
194 DEFINE_PARTIAL_INVERSION_CHECK_WRT_EQUAL(pipe,  | )
195 
196 //------------------------------------------------------------------------------
197 // Inverse
198 //------------------------------------------------------------------------------
199 
200 #define DEFINE_INVERSE_CHECK_WRT_EQUAL(plus_tag, plus_sign) \
201 template<class Type> \
202     void check_inverse_wrt_equal_##plus_tag \
203 (typename equality<Type>::type* equal, const Type& identity_element, const Type& var_a) \
204 { \
205     Type positive_difference  = var_a - var_a; \
206     BOOST_CHECK((*equal)(positive_difference, identity_element)); \
207     Type negative_difference = (identity_element - var_a) plus_sign var_a; \
208     BOOST_CHECK((*equal)(negative_difference, identity_element)); \
209 }
210 
211 #define DEFINE_INVERSE_CHECK_WRT(plus_tag, plus_sign) \
212 template<class Type> \
213     void check_inverse_wrt_##plus_tag \
214 (const Type& identity_element, const Type& var_a) \
215 { \
216     Type positive_difference  = var_a - var_a; \
217     BOOST_CHECK(positive_difference==identity_element); \
218     Type negative_difference = (identity_element - var_a) plus_sign var_a; \
219     BOOST_CHECK(negative_difference==identity_element); \
220 }
221 
222 #define CHECK_INVERSE_WRT_EQUAL(plus_tag) check_inverse_wrt_equal_##plus_tag
223 #define CHECK_INVERSE_WRT(plus_tag) check_inverse_wrt_##plus_tag
224 
225 DEFINE_INVERSE_CHECK_WRT      (plus,  + )
226 DEFINE_INVERSE_CHECK_WRT_EQUAL(plus,  + )
227 DEFINE_INVERSE_CHECK_WRT      (pipe,  | )
228 DEFINE_INVERSE_CHECK_WRT_EQUAL(pipe,  | )
229 
230 //------------------------------------------------------------------------------
231 // Containedness laws (Valid for sets, NOT for maps)
232 //------------------------------------------------------------------------------
233 template<class Type, class TypeB>
check_intersection_containedness(const Type & a,const TypeB & b)234 void check_intersection_containedness(const Type& a, const TypeB& b)
235 {
236     BOOST_CHECK_EQUAL(contains(a, a & b), true);
237     BOOST_CHECK_EQUAL(contains(a, b & a), true);
238     BOOST_CHECK_EQUAL(within(a & b, a), true);
239     BOOST_CHECK_EQUAL(within(b & a, a), true);
240 }
241 
242 template<class Type, class TypeB>
check_union_containedness(const Type & a,const TypeB & b)243 void check_union_containedness(const Type& a, const TypeB& b)
244 {
245     BOOST_CHECK_EQUAL(within(a, a + b), true);
246     BOOST_CHECK_EQUAL(within(a, b + a), true);
247     BOOST_CHECK_EQUAL(contains(a + b, a), true);
248     BOOST_CHECK_EQUAL(contains(b + a, a), true);
249 }
250 
251 template<class MapT>
check_domain_containedness(const MapT & a)252 void check_domain_containedness(const MapT& a)
253 {
254     typedef typename MapT::set_type set_type;
255     set_type dom;
256     domain(dom, a);
257     BOOST_CHECK_EQUAL(within(dom, a), true);
258     BOOST_CHECK_EQUAL(contains(a, dom), true);
259 
260     if(!dom.empty())
261     {
262         typename MapT::domain_type a1 = *dom.begin();
263         BOOST_CHECK_EQUAL(within(a1, a), true);
264         BOOST_CHECK_EQUAL(contains(a, a1), true);
265     }
266 }
267 
268 //------------------------------------------------------------------------------
269 // Laws on inner complement, between and distance
270 //------------------------------------------------------------------------------
271 template<class Type, class SetT>
check_length_as_distance(const Type & object,SetT & in_between,typename Type::difference_type & between_len,typename Type::difference_type & obj_dist)272 bool check_length_as_distance( const Type& object
273                              , SetT& in_between
274                              , typename Type::difference_type& between_len
275                              , typename Type::difference_type& obj_dist )
276 {
277     //LAW LengthAsDistance: distance(x) == length(between(x))
278     icl::between(in_between, object);
279     between_len  = icl::length(in_between);
280     obj_dist     = icl::distance(object);
281     BOOST_CHECK_EQUAL(obj_dist, between_len);
282     return obj_dist == between_len;
283 }
284 
285 template<class Type, class SetT>
has_length_as_distance(const Type & object)286 bool has_length_as_distance(const Type& object)
287 {
288     typedef typename Type::difference_type DiffT;
289     SetT in_between; DiffT between_len, obj_dist;
290     return check_length_as_distance(object, in_between, between_len, obj_dist);
291 }
292 
293 template<class Type>
check_length_complementarity(const Type & object,typename Type::difference_type & obj_len,typename Type::difference_type & obj_dist,typename Type::difference_type & hull_len)294 bool check_length_complementarity( const Type& object
295                                  , typename Type::difference_type& obj_len
296                                  , typename Type::difference_type& obj_dist
297                                  , typename Type::difference_type& hull_len )
298 {
299     //LAW Length Complementarity: length(x) + distance(x) == length(hull(x))
300     obj_len  = icl::length(object);
301     obj_dist = icl::distance(object);
302     hull_len = icl::length(hull(object));
303     BOOST_CHECK_EQUAL(obj_len + obj_dist, hull_len);
304     return obj_len + obj_dist == hull_len;
305 }
306 
307 template<class Type>
has_length_complementarity(const Type & object)308 bool has_length_complementarity(const Type& object)
309 {
310     typedef typename Type::difference_type DiffT;
311     DiffT obj_len, obj_dist, hull_len;
312     return check_length_complementarity(object, obj_len, obj_dist, hull_len);
313 }
314 
315 template<class Type, class SetT>
check_inner_complementarity(const Type & object,SetT & in_between,SetT & lhs,SetT & rhs)316 bool check_inner_complementarity(const Type& object, SetT& in_between, SetT& lhs, SetT& rhs)
317 {
318     //LAW Inner Complementarity1: domain(x) + between(x)       =e= hull(x)
319     //LAW Inner Complementarity2: join(domain(x) + between(x))  == hull(x)
320     SetT dom;
321     icl::domain(dom, object);
322     lhs = dom + between(in_between, object);
323     join(lhs);
324     rhs = SetT(hull(object));
325     BOOST_CHECK_EQUAL(lhs, rhs);
326     return lhs == rhs;
327 }
328 
329 
330 template<class Type, class SetT>
has_inner_complementarity(const Type & object)331 bool has_inner_complementarity(const Type& object)
332 {
333     SetT in_between, lhs, rhs;
334     return check_inner_complementarity(object, in_between, lhs, rhs);
335 }
336 
337 
338 
339 //==============================================================================
340 // Law tests are now combined to test algebraic concepts.
341 //------------------------------------------------------------------------------
342 // Monodid EAN
343 //------------------------------------------------------------------------------
344 
345 #define DEFINE_MONOID_CHECK_WRT_EQUAL(op_tag) \
346 template<class Type, class TypeB, class TypeC> \
347 void check_monoid_wrt_equal_##op_tag \
348 (typename equality<Type>::type* equal, const Type& identity_element, \
349 const Type& a, const TypeB& b, const TypeC& c) \
350 { \
351     CHECK_ASSOCIATIVITY_WRT_EQUAL(op_tag)(equal,a,b,c); \
352     CHECK_NEUTRALITY_WRT_EQUAL(op_tag)(equal,a,identity_element); \
353 }
354 
355 #define DEFINE_MONOID_CHECK_WRT(op_tag) \
356 template<class Type, class TypeB, class TypeC> \
357 void check_monoid_wrt_##op_tag \
358 (const Type& identity_element, \
359 const Type& a, const TypeB& b, const TypeC& c) \
360 { \
361     CHECK_ASSOCIATIVITY_WRT(op_tag)(a,b,c); \
362     CHECK_NEUTRALITY_WRT(op_tag)(a,identity_element); \
363 }
364 
365 DEFINE_MONOID_CHECK_WRT      (plus)
366 DEFINE_MONOID_CHECK_WRT_EQUAL(plus)
367 DEFINE_MONOID_CHECK_WRT      (pipe)
368 DEFINE_MONOID_CHECK_WRT_EQUAL(pipe)
369 DEFINE_MONOID_CHECK_WRT      (et)
370 DEFINE_MONOID_CHECK_WRT_EQUAL(et)
371 DEFINE_MONOID_CHECK_WRT      (caret)
372 DEFINE_MONOID_CHECK_WRT_EQUAL(caret)
373 
374 #define CHECK_MONOID_WRT(op_tag) check_monoid_wrt_##op_tag
375 #define CHECK_MONOID_WRT_EQUAL(op_tag) check_monoid_wrt_equal_##op_tag
376 
377 //------------------------------------------------------------------------------
378 // Commutative or Abelian monodid EANC
379 //------------------------------------------------------------------------------
380 #define DEFINE_ABELIAN_MONOID_CHECK_WRT_EQUAL(op_tag) \
381 template<class Type, class TypeB, class TypeC> \
382 void check_abelian_monoid_wrt_equal_##op_tag \
383 (typename equality<Type>::type* equal, const Type& identity_element, \
384 const Type& a, const TypeB& b, const TypeC& c) \
385 { \
386     CHECK_ASSOCIATIVITY_WRT_EQUAL(op_tag)(equal,a,b,c); \
387     CHECK_NEUTRALITY_WRT_EQUAL(op_tag)(equal,a,identity_element); \
388     CHECK_COMMUTATIVITY_WRT_EQUAL(op_tag)(equal,a,b); \
389     CHECK_COMMUTATIVITY_WRT_EQUAL(op_tag)(equal,a,c); \
390 }
391 
392 #define DEFINE_ABELIAN_MONOID_CHECK_WRT(op_tag) \
393 template<class Type, class TypeB, class TypeC> \
394 void check_abelian_monoid_wrt_##op_tag \
395 (const Type& identity_element, \
396 const Type& a, const TypeB& b, const TypeC& c) \
397 { \
398     CHECK_ASSOCIATIVITY_WRT(op_tag)(a,b,c); \
399     CHECK_NEUTRALITY_WRT(op_tag)(a,identity_element); \
400     CHECK_COMMUTATIVITY_WRT(op_tag)(a,b); \
401     CHECK_COMMUTATIVITY_WRT(op_tag)(a,c); \
402 }
403 
404 DEFINE_ABELIAN_MONOID_CHECK_WRT      (plus)
405 DEFINE_ABELIAN_MONOID_CHECK_WRT_EQUAL(plus)
406 DEFINE_ABELIAN_MONOID_CHECK_WRT      (pipe)
407 DEFINE_ABELIAN_MONOID_CHECK_WRT_EQUAL(pipe)
408 DEFINE_ABELIAN_MONOID_CHECK_WRT      (et)
409 DEFINE_ABELIAN_MONOID_CHECK_WRT_EQUAL(et)
410 DEFINE_ABELIAN_MONOID_CHECK_WRT      (caret)
411 DEFINE_ABELIAN_MONOID_CHECK_WRT_EQUAL(caret)
412 
413 #define CHECK_ABELIAN_MONOID_WRT(op_tag) check_abelian_monoid_wrt_##op_tag
414 #define CHECK_ABELIAN_MONOID_WRT_EQUAL(op_tag) check_abelian_monoid_wrt_equal_##op_tag
415 
416 //------------------------------------------------------------------------------
417 // Abelian monodid EANC with partial inversion
418 //------------------------------------------------------------------------------
419 #define DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT_EQUAL(op_tag) \
420 template<class Type, class TypeB, class TypeC> \
421 void check_partial_invertive_monoid_wrt_equal_##op_tag \
422 (typename equality<Type>::type* equal, const Type& identity_element, \
423 const Type& a, const TypeB& b, const TypeC& c) \
424 { \
425     CHECK_ABELIAN_MONOID_WRT_EQUAL(op_tag)(equal,identity_element,a,b,c); \
426     CHECK_PARTIAL_INVERSION_WRT_EQUAL(op_tag)(equal,identity_element,a); \
427 }
428 
429 #define DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT(op_tag) \
430 template<class Type, class TypeB, class TypeC> \
431 void check_partial_invertive_monoid_wrt_##op_tag \
432 (const Type& identity_element, \
433 const Type& a, const TypeB& b, const TypeC& c) \
434 { \
435     CHECK_ABELIAN_MONOID_WRT(op_tag)(identity_element,a,b,c); \
436     CHECK_PARTIAL_INVERSION_WRT(op_tag)(identity_element,a); \
437 }
438 
439 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT      (plus)
440 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT_EQUAL(plus)
441 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT      (pipe)
442 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT_EQUAL(pipe)
443 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT      (et)
444 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT_EQUAL(et)
445 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT      (caret)
446 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_WRT_EQUAL(caret)
447 
448 #define CHECK_PARTIAL_INVERTIVE_MONOID_WRT(op_tag) check_partial_invertive_monoid_wrt_##op_tag
449 #define CHECK_PARTIAL_INVERTIVE_MONOID_WRT_EQUAL(op_tag) check_partial_invertive_monoid_wrt_equal_##op_tag
450 
451 //------------------------------------------------------------------------------
452 // Abelian group EANIC
453 //------------------------------------------------------------------------------
454 
455 #define DEFINE_ABELIAN_GROUP_CHECK_WRT_EQUAL(op_tag) \
456 template<class Type, class TypeB, class TypeC> \
457     void check_abelian_group_wrt_equal_##op_tag \
458 (typename equality<Type>::type* equal, const Type& identity_element, \
459 const Type& a, const TypeB& b, const TypeC& c) \
460 { \
461     CHECK_ABELIAN_MONOID_WRT_EQUAL(op_tag)(equal,identity_element,a,b,c); \
462     CHECK_INVERSE_WRT_EQUAL(op_tag)(equal,identity_element,a); \
463 }
464 
465 #define DEFINE_ABELIAN_GROUP_CHECK_WRT(op_tag) \
466 template<class Type, class TypeB, class TypeC> \
467     void check_abelian_group_wrt_##op_tag \
468 (const Type& identity_element, \
469 const Type& a, const TypeB& b, const TypeC& c) \
470 { \
471     CHECK_ABELIAN_MONOID_WRT(op_tag)(identity_element,a,b,c); \
472     CHECK_INVERSE_WRT(op_tag)(identity_element,a); \
473 }
474 
475 
476 DEFINE_ABELIAN_GROUP_CHECK_WRT      (plus)
477 DEFINE_ABELIAN_GROUP_CHECK_WRT_EQUAL(plus)
478 DEFINE_ABELIAN_GROUP_CHECK_WRT      (pipe)
479 DEFINE_ABELIAN_GROUP_CHECK_WRT_EQUAL(pipe)
480 
481 #define CHECK_ABELIAN_GROUP_WRT(op_tag) check_abelian_group_wrt_##op_tag
482 #define CHECK_ABELIAN_GROUP_WRT_EQUAL(op_tag) check_abelian_group_wrt_equal_##op_tag
483 
484 //------------------------------------------------------------------------------
485 // Modoid permuted
486 //------------------------------------------------------------------------------
487 
488 #define DEFINE_MONOID_CHECK_PERMUTED_WRT_EQUAL(op_tag) \
489 template<class TypeA, class TypeB, class Assoc> \
490 void check_monoid_permuted_wrt_equal_##op_tag \
491 (typename equality<TypeA>::type* equal, const TypeA& var_a, const TypeB& var_b, const Assoc& assoc) \
492 { \
493     CHECK_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeA>::value(), var_a, var_b, assoc);\
494     CHECK_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeA>::value(), var_a, assoc, var_b);\
495     CHECK_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeB>::value(), var_b, var_a, assoc);\
496     CHECK_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeB>::value(), var_b, assoc, var_a);\
497 }
498 
499 #define DEFINE_MONOID_CHECK_PERMUTED_WRT(op_tag) \
500 template<class TypeA, class TypeB, class Assoc> \
501 void check_monoid_permuted_wrt_##op_tag \
502 (const TypeA& var_a, const TypeB& var_b, const Assoc& assoc) \
503 { \
504     CHECK_MONOID_WRT(op_tag)(icl::identity_element<TypeA>::value(), var_a, var_b, assoc);\
505     CHECK_MONOID_WRT(op_tag)(icl::identity_element<TypeA>::value(), var_a, assoc, var_b);\
506     CHECK_MONOID_WRT(op_tag)(icl::identity_element<TypeB>::value(), var_b, var_a, assoc);\
507     CHECK_MONOID_WRT(op_tag)(icl::identity_element<TypeB>::value(), var_b, assoc, var_a);\
508 }
509 
510 
511 DEFINE_MONOID_CHECK_PERMUTED_WRT      (plus)
512 DEFINE_MONOID_CHECK_PERMUTED_WRT_EQUAL(plus)
513 DEFINE_MONOID_CHECK_PERMUTED_WRT      (pipe)
514 DEFINE_MONOID_CHECK_PERMUTED_WRT_EQUAL(pipe)
515 DEFINE_MONOID_CHECK_PERMUTED_WRT      (et)
516 DEFINE_MONOID_CHECK_PERMUTED_WRT_EQUAL(et)
517 DEFINE_MONOID_CHECK_PERMUTED_WRT      (caret)
518 DEFINE_MONOID_CHECK_PERMUTED_WRT_EQUAL(caret)
519 
520 #define CHECK_MONOID_PERMUTED_WRT(op_tag)       check_monoid_permuted_wrt_##op_tag
521 #define CHECK_MONOID_PERMUTED_WRT_EQUAL(op_tag) check_monoid_permuted_wrt_equal_##op_tag
522 
523 
524 //------------------------------------------------------------------------------
525 // Abelian modoid permuted
526 //------------------------------------------------------------------------------
527 
528 #define DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT_EQUAL(op_tag) \
529 template<class TypeA, class TypeB, class Assoc> \
530 void check_abelian_monoid_permuted_wrt_equal_##op_tag \
531 (typename equality<TypeA>::type* equal, const TypeA& var_a, const TypeB& var_b, const Assoc& assoc) \
532 { \
533     CHECK_ABELIAN_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeA>::value(), var_a, var_b, assoc);\
534     CHECK_ABELIAN_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeA>::value(), var_a, assoc, var_b);\
535     CHECK_ABELIAN_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeB>::value(), var_b, var_a, assoc);\
536     CHECK_ABELIAN_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeB>::value(), var_b, assoc, var_a);\
537 }
538 
539 #define DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT(op_tag) \
540 template<class TypeA, class TypeB, class Assoc> \
541 void check_abelian_monoid_permuted_wrt_##op_tag \
542 (const TypeA& var_a, const TypeB& var_b, const Assoc& assoc) \
543 { \
544     CHECK_ABELIAN_MONOID_WRT(op_tag)(icl::identity_element<TypeA>::value(), var_a, var_b, assoc);\
545     CHECK_ABELIAN_MONOID_WRT(op_tag)(icl::identity_element<TypeA>::value(), var_a, assoc, var_b);\
546     CHECK_ABELIAN_MONOID_WRT(op_tag)(icl::identity_element<TypeB>::value(), var_b, var_a, assoc);\
547     CHECK_ABELIAN_MONOID_WRT(op_tag)(icl::identity_element<TypeB>::value(), var_b, assoc, var_a);\
548 }
549 
550 
551 DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT      (plus)
552 DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT_EQUAL(plus)
553 DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT      (pipe)
554 DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT_EQUAL(pipe)
555 DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT      (et)
556 DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT_EQUAL(et)
557 DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT      (caret)
558 DEFINE_ABELIAN_MONOID_CHECK_PERMUTED_WRT_EQUAL(caret)
559 
560 #define CHECK_ABELIAN_MONOID_PERMUTED_WRT(op_tag)       check_abelian_monoid_permuted_wrt_##op_tag
561 #define CHECK_ABELIAN_MONOID_PERMUTED_WRT_EQUAL(op_tag) check_abelian_monoid_permuted_wrt_equal_##op_tag
562 
563 
564 //------------------------------------------------------------------------------
565 // Abelian modoid with partial inversion permuted
566 //------------------------------------------------------------------------------
567 
568 #define DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT_EQUAL(op_tag) \
569 template<class TypeA, class TypeB, class Assoc> \
570 void check_partial_invertive_monoid_permuted_wrt_equal_##op_tag \
571 (typename equality<TypeA>::type* equal, const TypeA& var_a, const TypeB& var_b, const Assoc& assoc) \
572 { \
573     CHECK_PARTIAL_INVERTIVE_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeA>::value(), var_a, var_b, assoc);\
574     CHECK_PARTIAL_INVERTIVE_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeA>::value(), var_a, assoc, var_b);\
575     CHECK_PARTIAL_INVERTIVE_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeB>::value(), var_b, var_a, assoc);\
576     CHECK_PARTIAL_INVERTIVE_MONOID_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeB>::value(), var_b, assoc, var_a);\
577 }
578 
579 #define DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT(op_tag) \
580 template<class TypeA, class TypeB, class Assoc> \
581 void check_partial_invertive_monoid_permuted_wrt_##op_tag \
582 (const TypeA& var_a, const TypeB& var_b, const Assoc& assoc) \
583 { \
584     CHECK_PARTIAL_INVERTIVE_MONOID_WRT(op_tag)(icl::identity_element<TypeA>::value(), var_a, var_b, assoc);\
585     CHECK_PARTIAL_INVERTIVE_MONOID_WRT(op_tag)(icl::identity_element<TypeA>::value(), var_a, assoc, var_b);\
586     CHECK_PARTIAL_INVERTIVE_MONOID_WRT(op_tag)(icl::identity_element<TypeB>::value(), var_b, var_a, assoc);\
587     CHECK_PARTIAL_INVERTIVE_MONOID_WRT(op_tag)(icl::identity_element<TypeB>::value(), var_b, assoc, var_a);\
588 }
589 
590 
591 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT      (plus)
592 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT_EQUAL(plus)
593 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT      (pipe)
594 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT_EQUAL(pipe)
595 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT      (et)
596 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT_EQUAL(et)
597 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT      (caret)
598 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_PERMUTED_WRT_EQUAL(caret)
599 
600 #define CHECK_PARTIAL_INVERTIVE_MONOID_PERMUTED_WRT(op_tag)       check_partial_invertive_monoid_permuted_wrt_##op_tag
601 #define CHECK_PARTIAL_INVERTIVE_MONOID_PERMUTED_WRT_EQUAL(op_tag) check_partial_invertive_monoid_permuted_wrt_equal_##op_tag
602 
603 
604 //------------------------------------------------------------------------------
605 // Abelian group permuted
606 //------------------------------------------------------------------------------
607 
608 #define DEFINE_ABELIAN_GROUP_CHECK_PERMUTED_WRT_EQUAL(op_tag) \
609 template<class TypeA, class TypeB, class Assoc> \
610     void check_abelian_group_permuted_wrt_equal_##op_tag \
611 (typename equality<TypeA>::type* equal, const TypeA& var_a, const TypeB& var_b, const Assoc& assoc) \
612 { \
613     CHECK_ABELIAN_GROUP_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeA>::value(), var_a, var_b, assoc);\
614     CHECK_ABELIAN_GROUP_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeA>::value(), var_a, assoc, var_b);\
615     CHECK_ABELIAN_GROUP_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeB>::value(), var_b, var_a, assoc);\
616     CHECK_ABELIAN_GROUP_WRT_EQUAL(op_tag)(equal, icl::identity_element<TypeB>::value(), var_b, assoc, var_a);\
617 }
618 
619 #define DEFINE_ABELIAN_GROUP_CHECK_PERMUTED_WRT(op_tag) \
620 template<class TypeA, class TypeB, class Assoc> \
621     void check_abelian_group_permuted_wrt_##op_tag \
622 (const TypeA& var_a, const TypeB& var_b, const Assoc& assoc) \
623 { \
624     CHECK_ABELIAN_GROUP_WRT(op_tag)(icl::identity_element<TypeA>::value(), var_a, var_b, assoc);\
625     CHECK_ABELIAN_GROUP_WRT(op_tag)(icl::identity_element<TypeA>::value(), var_a, assoc, var_b);\
626     CHECK_ABELIAN_GROUP_WRT(op_tag)(icl::identity_element<TypeB>::value(), var_b, var_a, assoc);\
627     CHECK_ABELIAN_GROUP_WRT(op_tag)(icl::identity_element<TypeB>::value(), var_b, assoc, var_a);\
628 }
629 
630 
631 DEFINE_ABELIAN_GROUP_CHECK_PERMUTED_WRT      (plus)
632 DEFINE_ABELIAN_GROUP_CHECK_PERMUTED_WRT_EQUAL(plus)
633 DEFINE_ABELIAN_GROUP_CHECK_PERMUTED_WRT      (pipe)
634 DEFINE_ABELIAN_GROUP_CHECK_PERMUTED_WRT_EQUAL(pipe)
635 
636 #define CHECK_ABELIAN_GROUP_PERMUTED_WRT(op_tag)       check_abelian_group_permuted_wrt_##op_tag
637 #define CHECK_ABELIAN_GROUP_PERMUTED_WRT_EQUAL(op_tag) check_abelian_group_permuted_wrt_equal_##op_tag
638 
639 
640 //------------------------------------------------------------------------------
641 // Modoid instance
642 //------------------------------------------------------------------------------
643 
644 #define DEFINE_MONOID_CHECK_INSTANCE_WRT_EQUAL(op_tag) \
645 template<class TypeA, class TypeB, class TypeC, class AssocA, class AssocB> \
646 void check_monoid_instance_wrt_equal_##op_tag \
647 (typename equality<TypeA>::type* equal, const TypeA& var_a, const TypeB& var_b, const TypeC& var_c, \
648  const AssocA& ass_a, const AssocB& ass_b) \
649 { \
650     CHECK_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, var_c);\
651     CHECK_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, ass_a);\
652     CHECK_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, ass_b);\
653 }
654 
655 #define DEFINE_MONOID_CHECK_INSTANCE_WRT(op_tag) \
656 template<class TypeA, class TypeB, class TypeC, class AssocA, class AssocB> \
657 void check_monoid_instance_wrt_##op_tag \
658 (const TypeA& var_a, const TypeB& var_b, const TypeC& var_c, \
659  const AssocA& ass_a, const AssocB& ass_b) \
660 { \
661     CHECK_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, var_c);\
662     CHECK_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, ass_a);\
663     CHECK_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, ass_b);\
664 }
665 
666 DEFINE_MONOID_CHECK_INSTANCE_WRT      (plus)
667 DEFINE_MONOID_CHECK_INSTANCE_WRT_EQUAL(plus)
668 DEFINE_MONOID_CHECK_INSTANCE_WRT      (pipe)
669 DEFINE_MONOID_CHECK_INSTANCE_WRT_EQUAL(pipe)
670 DEFINE_MONOID_CHECK_INSTANCE_WRT      (et)
671 DEFINE_MONOID_CHECK_INSTANCE_WRT_EQUAL(et)
672 DEFINE_MONOID_CHECK_INSTANCE_WRT      (caret)
673 DEFINE_MONOID_CHECK_INSTANCE_WRT_EQUAL(caret)
674 
675 #define CHECK_MONOID_INSTANCE_WRT(op_tag)       check_monoid_instance_wrt_##op_tag
676 #define CHECK_MONOID_INSTANCE_WRT_EQUAL(op_tag) check_monoid_instance_wrt_equal_##op_tag
677 
678 
679 
680 //------------------------------------------------------------------------------
681 // Abelian modoid instance
682 //------------------------------------------------------------------------------
683 
684 #define DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT_EQUAL(op_tag) \
685 template<class TypeA, class TypeB, class TypeC, class AssocA, class AssocB> \
686 void check_abelian_monoid_instance_wrt_equal_##op_tag \
687 (typename equality<TypeA>::type* equal, const TypeA& var_a, const TypeB& var_b, const TypeC& var_c, \
688  const AssocA& ass_a, const AssocB& ass_b) \
689 { \
690     CHECK_ABELIAN_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, var_c);\
691     CHECK_ABELIAN_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, ass_a);\
692     CHECK_ABELIAN_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, ass_b);\
693 }
694 
695 #define DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT(op_tag) \
696 template<class TypeA, class TypeB, class TypeC, class AssocA, class AssocB> \
697 void check_abelian_monoid_instance_wrt_##op_tag \
698 (const TypeA& var_a, const TypeB& var_b, const TypeC& var_c, \
699  const AssocA& ass_a, const AssocB& ass_b) \
700 { \
701     CHECK_ABELIAN_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, var_c);\
702     CHECK_ABELIAN_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, ass_a);\
703     CHECK_ABELIAN_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, ass_b);\
704 }
705 
706 DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT      (plus)
707 DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT_EQUAL(plus)
708 DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT      (pipe)
709 DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT_EQUAL(pipe)
710 DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT      (et)
711 DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT_EQUAL(et)
712 DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT      (caret)
713 DEFINE_ABELIAN_MONOID_CHECK_INSTANCE_WRT_EQUAL(caret)
714 
715 #define CHECK_ABELIAN_MONOID_INSTANCE_WRT(op_tag)       check_abelian_monoid_instance_wrt_##op_tag
716 #define CHECK_ABELIAN_MONOID_INSTANCE_WRT_EQUAL(op_tag) check_abelian_monoid_instance_wrt_equal_##op_tag
717 
718 
719 //------------------------------------------------------------------------------
720 // Abelian partial invertive modoid instance
721 //------------------------------------------------------------------------------
722 
723 #define DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT_EQUAL(op_tag) \
724 template<class TypeA, class TypeB, class TypeC, class AssocA, class AssocB> \
725 void check_partial_invertive_monoid_instance_wrt_equal_##op_tag \
726 (typename equality<TypeA>::type* equal, const TypeA& var_a, const TypeB& var_b, const TypeC& var_c, \
727  const AssocA& ass_a, const AssocB& ass_b) \
728 { \
729     CHECK_PARTIAL_INVERTIVE_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, var_c);\
730     CHECK_PARTIAL_INVERTIVE_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, ass_a);\
731     CHECK_PARTIAL_INVERTIVE_MONOID_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, ass_b);\
732 }
733 
734 #define DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT(op_tag) \
735 template<class TypeA, class TypeB, class TypeC, class AssocA, class AssocB> \
736 void check_partial_invertive_monoid_instance_wrt_##op_tag \
737 (const TypeA& var_a, const TypeB& var_b, const TypeC& var_c, \
738  const AssocA& ass_a, const AssocB& ass_b) \
739 { \
740     CHECK_PARTIAL_INVERTIVE_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, var_c);\
741     CHECK_PARTIAL_INVERTIVE_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, ass_a);\
742     CHECK_PARTIAL_INVERTIVE_MONOID_PERMUTED_WRT(op_tag)(var_a, var_b, ass_b);\
743 }
744 
745 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT      (plus)
746 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT_EQUAL(plus)
747 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT      (pipe)
748 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT_EQUAL(pipe)
749 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT      (et)
750 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT_EQUAL(et)
751 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT      (caret)
752 DEFINE_PARTIAL_INVERTIVE_MONOID_CHECK_INSTANCE_WRT_EQUAL(caret)
753 
754 #define CHECK_PARTIAL_INVERTIVE_MONOID_INSTANCE_WRT(op_tag)       check_partial_invertive_monoid_instance_wrt_##op_tag
755 #define CHECK_PARTIAL_INVERTIVE_MONOID_INSTANCE_WRT_EQUAL(op_tag) check_partial_invertive_monoid_instance_wrt_equal_##op_tag
756 
757 
758 //------------------------------------------------------------------------------
759 // Abelian group instance
760 //------------------------------------------------------------------------------
761 
762 #define DEFINE_ABELIAN_GROUP_CHECK_INSTANCE_WRT_EQUAL(op_tag) \
763 template<class TypeA, class TypeB, class TypeC, class AssocA, class AssocB> \
764     void check_abelian_group_instance_wrt_equal_##op_tag \
765 (typename equality<TypeA>::type* equal, const TypeA& var_a, const TypeB& var_b, const TypeC& var_c, \
766  const AssocA& ass_a, const AssocB& ass_b) \
767 { \
768     CHECK_ABELIAN_GROUP_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, var_c);\
769     CHECK_ABELIAN_GROUP_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, ass_a);\
770     CHECK_ABELIAN_GROUP_PERMUTED_WRT_EQUAL(op_tag)(equal, var_a, var_b, ass_b);\
771 }
772 
773 #define DEFINE_ABELIAN_GROUP_CHECK_INSTANCE_WRT(op_tag) \
774 template<class TypeA, class TypeB, class TypeC, class AssocA, class AssocB> \
775     void check_abelian_group_instance_wrt_##op_tag \
776 (const TypeA& var_a, const TypeB& var_b, const TypeC& var_c, \
777  const AssocA& ass_a, const AssocB& ass_b) \
778 { \
779     CHECK_ABELIAN_GROUP_PERMUTED_WRT(op_tag)(var_a, var_b, var_c);\
780     CHECK_ABELIAN_GROUP_PERMUTED_WRT(op_tag)(var_a, var_b, ass_a);\
781     CHECK_ABELIAN_GROUP_PERMUTED_WRT(op_tag)(var_a, var_b, ass_b);\
782 }
783 
784 DEFINE_ABELIAN_GROUP_CHECK_INSTANCE_WRT      (plus)
785 DEFINE_ABELIAN_GROUP_CHECK_INSTANCE_WRT_EQUAL(plus)
786 DEFINE_ABELIAN_GROUP_CHECK_INSTANCE_WRT      (pipe)
787 DEFINE_ABELIAN_GROUP_CHECK_INSTANCE_WRT_EQUAL(pipe)
788 
789 #define CHECK_ABELIAN_GROUP_INSTANCE_WRT(op_tag)       check_abelian_group_instance_wrt_##op_tag
790 #define CHECK_ABELIAN_GROUP_INSTANCE_WRT_EQUAL(op_tag) check_abelian_group_instance_wrt_equal_##op_tag
791 
792 }} // namespace icl boost
793 
794 #endif // BOOST_LIBS_ICL_TEST_ICL_LAWS_HPP_JOFA_090119
795 
796