COPASI API  4.16.103
test_cnormallogical.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/compareExpressions/unittests/test_cnormallogical.cpp,v $
3 // $Revision: 1.11 $
4 // $Name: $
5 // $Author: gauges $
6 // $Date: 2009/07/02 17:57:53 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 #include "test_cnormallogical.hpp"
29 
31 
32 void test_cnormallogical::setUp()
33 {
34  CCopasiRootContainer::init(false, 0, NULL);
35 }
36 
37 void test_cnormallogical::tearDown()
38 {
40 }
41 
42 void test_cnormallogical::test_SetOfSetsSorter_operator()
43 {
45  CNormalLogicalItem* pLogicalItem1 = new CNormalLogicalItem();
46  pLogicalItem1->setType(CNormalLogicalItem::TRUE);
47  CNormalLogicalItem* pLogicalItem2 = new CNormalLogicalItem();
48  pLogicalItem2->setType(CNormalLogicalItem::FALSE);
49  CNormalLogicalItem* pLogicalItem3 = new CNormalLogicalItem();
50  pLogicalItem3->setType(CNormalLogicalItem::EQ);
51  CNormalFraction* pFraction1 = new CNormalFraction();
52  pFraction1->multiply(7.0);
53  CNormalFraction* pFraction2 = new CNormalFraction();
54  pFraction1->multiply(9.0);
55  pLogicalItem3->setLeft(*pFraction1);
56  pLogicalItem3->setRight(*pFraction2);
57  delete pFraction1;
58  delete pFraction2;
71  set1.insert(std::make_pair(pLogicalItem1, true));
72  set2.insert(std::make_pair(pLogicalItem2, true));
73  set3.insert(std::make_pair(pLogicalItem3, true));
74  set4.insert(std::make_pair(pLogicalItem1, false));
75  set5.insert(std::make_pair(pLogicalItem2, false));
76  set6.insert(std::make_pair(pLogicalItem3, false));
77  std::pair<CNormalLogical::ItemSet, bool> pair1 = std::make_pair(set1, true);
78  std::pair<CNormalLogical::ItemSet, bool> pair2 = std::make_pair(set2, true);
79  std::pair<CNormalLogical::ItemSet, bool> pair3 = std::make_pair(set3, true);
80  std::pair<CNormalLogical::ItemSet, bool> pair4 = std::make_pair(set4, true);
81  std::pair<CNormalLogical::ItemSet, bool> pair5 = std::make_pair(set5, true);
82  std::pair<CNormalLogical::ItemSet, bool> pair6 = std::make_pair(set6, true);
83  std::pair<CNormalLogical::ItemSet, bool> pair7 = std::make_pair(set1, false);
84  std::pair<CNormalLogical::ItemSet, bool> pair8 = std::make_pair(set2, false);
85  std::pair<CNormalLogical::ItemSet, bool> pair9 = std::make_pair(set3, false);
86  std::pair<CNormalLogical::ItemSet, bool> pair10 = std::make_pair(set4, false);
87  std::pair<CNormalLogical::ItemSet, bool> pair11 = std::make_pair(set5, false);
88  std::pair<CNormalLogical::ItemSet, bool> pair12 = std::make_pair(set6, false);
89 
90  CPPUNIT_ASSERT(sorter(pair1, pair2) == true);
91  CPPUNIT_ASSERT(sorter(pair1, pair3) == true);
92  CPPUNIT_ASSERT(sorter(pair1, pair4) == true);
93  CPPUNIT_ASSERT(sorter(pair1, pair5) == true);
94  CPPUNIT_ASSERT(sorter(pair1, pair6) == true);
95  CPPUNIT_ASSERT(sorter(pair1, pair7) == true);
96  CPPUNIT_ASSERT(sorter(pair1, pair8) == true);
97  CPPUNIT_ASSERT(sorter(pair1, pair9) == true);
98  CPPUNIT_ASSERT(sorter(pair1, pair10) == true);
99  CPPUNIT_ASSERT(sorter(pair1, pair11) == true);
100  CPPUNIT_ASSERT(sorter(pair1, pair12) == true);
101 
102  CPPUNIT_ASSERT(sorter(pair2, pair3) == true);
103  CPPUNIT_ASSERT(sorter(pair2, pair4) == true);
104  CPPUNIT_ASSERT(sorter(pair2, pair5) == true);
105  CPPUNIT_ASSERT(sorter(pair2, pair6) == true);
106  CPPUNIT_ASSERT(sorter(pair2, pair7) == true);
107  CPPUNIT_ASSERT(sorter(pair2, pair8) == true);
108  CPPUNIT_ASSERT(sorter(pair2, pair9) == true);
109  CPPUNIT_ASSERT(sorter(pair2, pair10) == true);
110  CPPUNIT_ASSERT(sorter(pair2, pair11) == true);
111  CPPUNIT_ASSERT(sorter(pair2, pair12) == true);
112 
113  CPPUNIT_ASSERT(sorter(pair3, pair4) == true);
114  CPPUNIT_ASSERT(sorter(pair3, pair5) == true);
115  CPPUNIT_ASSERT(sorter(pair3, pair6) == true);
116  CPPUNIT_ASSERT(sorter(pair3, pair7) == true);
117  CPPUNIT_ASSERT(sorter(pair3, pair8) == true);
118  CPPUNIT_ASSERT(sorter(pair3, pair9) == true);
119  CPPUNIT_ASSERT(sorter(pair3, pair10) == true);
120  CPPUNIT_ASSERT(sorter(pair3, pair11) == true);
121  CPPUNIT_ASSERT(sorter(pair3, pair12) == true);
122 
123  CPPUNIT_ASSERT(sorter(pair4, pair5) == true);
124  CPPUNIT_ASSERT(sorter(pair4, pair6) == true);
125  CPPUNIT_ASSERT(sorter(pair4, pair7) == true);
126  CPPUNIT_ASSERT(sorter(pair4, pair8) == true);
127  CPPUNIT_ASSERT(sorter(pair4, pair9) == true);
128  CPPUNIT_ASSERT(sorter(pair4, pair10) == true);
129  CPPUNIT_ASSERT(sorter(pair4, pair11) == true);
130  CPPUNIT_ASSERT(sorter(pair4, pair12) == true);
131 
132  CPPUNIT_ASSERT(sorter(pair5, pair6) == true);
133  CPPUNIT_ASSERT(sorter(pair5, pair7) == true);
134  CPPUNIT_ASSERT(sorter(pair5, pair8) == true);
135  CPPUNIT_ASSERT(sorter(pair5, pair9) == true);
136  CPPUNIT_ASSERT(sorter(pair5, pair10) == true);
137  CPPUNIT_ASSERT(sorter(pair5, pair11) == true);
138  CPPUNIT_ASSERT(sorter(pair5, pair12) == true);
139 
140  CPPUNIT_ASSERT(sorter(pair6, pair7) == true);
141  CPPUNIT_ASSERT(sorter(pair6, pair8) == true);
142  CPPUNIT_ASSERT(sorter(pair6, pair9) == true);
143  CPPUNIT_ASSERT(sorter(pair6, pair10) == true);
144  CPPUNIT_ASSERT(sorter(pair6, pair11) == true);
145  CPPUNIT_ASSERT(sorter(pair6, pair12) == true);
146 
147  CPPUNIT_ASSERT(sorter(pair7, pair8) == true);
148  CPPUNIT_ASSERT(sorter(pair7, pair9) == true);
149  CPPUNIT_ASSERT(sorter(pair7, pair10) == true);
150  CPPUNIT_ASSERT(sorter(pair7, pair11) == true);
151  CPPUNIT_ASSERT(sorter(pair7, pair12) == true);
152 
153  CPPUNIT_ASSERT(sorter(pair8, pair9) == true);
154  CPPUNIT_ASSERT(sorter(pair8, pair10) == true);
155  CPPUNIT_ASSERT(sorter(pair8, pair11) == true);
156  CPPUNIT_ASSERT(sorter(pair8, pair12) == true);
157 
158  CPPUNIT_ASSERT(sorter(pair9, pair10) == true);
159  CPPUNIT_ASSERT(sorter(pair9, pair11) == true);
160  CPPUNIT_ASSERT(sorter(pair9, pair12) == true);
161 
162  CPPUNIT_ASSERT(sorter(pair10, pair11) == true);
163  CPPUNIT_ASSERT(sorter(pair10, pair12) == true);
164 
165  CPPUNIT_ASSERT(sorter(pair11, pair12) == true);
166 
167  // turn all tests around
168  CPPUNIT_ASSERT(sorter(pair2, pair1) == false);
169  CPPUNIT_ASSERT(sorter(pair3, pair1) == false);
170  CPPUNIT_ASSERT(sorter(pair4, pair1) == false);
171  CPPUNIT_ASSERT(sorter(pair5, pair1) == false);
172  CPPUNIT_ASSERT(sorter(pair6, pair1) == false);
173  CPPUNIT_ASSERT(sorter(pair7, pair1) == false);
174  CPPUNIT_ASSERT(sorter(pair8, pair1) == false);
175  CPPUNIT_ASSERT(sorter(pair9, pair1) == false);
176  CPPUNIT_ASSERT(sorter(pair10, pair1) == false);
177  CPPUNIT_ASSERT(sorter(pair11, pair1) == false);
178  CPPUNIT_ASSERT(sorter(pair12, pair1) == false);
179 
180  CPPUNIT_ASSERT(sorter(pair3, pair2) == false);
181  CPPUNIT_ASSERT(sorter(pair4, pair2) == false);
182  CPPUNIT_ASSERT(sorter(pair5, pair2) == false);
183  CPPUNIT_ASSERT(sorter(pair6, pair2) == false);
184  CPPUNIT_ASSERT(sorter(pair7, pair2) == false);
185  CPPUNIT_ASSERT(sorter(pair8, pair2) == false);
186  CPPUNIT_ASSERT(sorter(pair9, pair2) == false);
187  CPPUNIT_ASSERT(sorter(pair10, pair2) == false);
188  CPPUNIT_ASSERT(sorter(pair11, pair2) == false);
189  CPPUNIT_ASSERT(sorter(pair12, pair2) == false);
190 
191  CPPUNIT_ASSERT(sorter(pair4, pair3) == false);
192  CPPUNIT_ASSERT(sorter(pair5, pair3) == false);
193  CPPUNIT_ASSERT(sorter(pair6, pair3) == false);
194  CPPUNIT_ASSERT(sorter(pair7, pair3) == false);
195  CPPUNIT_ASSERT(sorter(pair8, pair3) == false);
196  CPPUNIT_ASSERT(sorter(pair9, pair3) == false);
197  CPPUNIT_ASSERT(sorter(pair10, pair3) == false);
198  CPPUNIT_ASSERT(sorter(pair11, pair3) == false);
199  CPPUNIT_ASSERT(sorter(pair12, pair3) == false);
200 
201  CPPUNIT_ASSERT(sorter(pair5, pair4) == false);
202  CPPUNIT_ASSERT(sorter(pair6, pair4) == false);
203  CPPUNIT_ASSERT(sorter(pair7, pair4) == false);
204  CPPUNIT_ASSERT(sorter(pair8, pair4) == false);
205  CPPUNIT_ASSERT(sorter(pair9, pair4) == false);
206  CPPUNIT_ASSERT(sorter(pair10, pair4) == false);
207  CPPUNIT_ASSERT(sorter(pair11, pair4) == false);
208  CPPUNIT_ASSERT(sorter(pair12, pair4) == false);
209 
210  CPPUNIT_ASSERT(sorter(pair6, pair5) == false);
211  CPPUNIT_ASSERT(sorter(pair7, pair5) == false);
212  CPPUNIT_ASSERT(sorter(pair8, pair5) == false);
213  CPPUNIT_ASSERT(sorter(pair9, pair5) == false);
214  CPPUNIT_ASSERT(sorter(pair10, pair5) == false);
215  CPPUNIT_ASSERT(sorter(pair11, pair5) == false);
216  CPPUNIT_ASSERT(sorter(pair12, pair5) == false);
217 
218  CPPUNIT_ASSERT(sorter(pair7, pair6) == false);
219  CPPUNIT_ASSERT(sorter(pair8, pair6) == false);
220  CPPUNIT_ASSERT(sorter(pair9, pair6) == false);
221  CPPUNIT_ASSERT(sorter(pair10, pair6) == false);
222  CPPUNIT_ASSERT(sorter(pair11, pair6) == false);
223  CPPUNIT_ASSERT(sorter(pair12, pair6) == false);
224 
225  CPPUNIT_ASSERT(sorter(pair8, pair7) == false);
226  CPPUNIT_ASSERT(sorter(pair9, pair7) == false);
227  CPPUNIT_ASSERT(sorter(pair10, pair7) == false);
228  CPPUNIT_ASSERT(sorter(pair11, pair7) == false);
229  CPPUNIT_ASSERT(sorter(pair12, pair7) == false);
230 
231  CPPUNIT_ASSERT(sorter(pair9, pair8) == false);
232  CPPUNIT_ASSERT(sorter(pair10, pair8) == false);
233  CPPUNIT_ASSERT(sorter(pair11, pair8) == false);
234  CPPUNIT_ASSERT(sorter(pair12, pair8) == false);
235 
236  CPPUNIT_ASSERT(sorter(pair10, pair9) == false);
237  CPPUNIT_ASSERT(sorter(pair11, pair9) == false);
238  CPPUNIT_ASSERT(sorter(pair12, pair9) == false);
239 
240  CPPUNIT_ASSERT(sorter(pair11, pair10) == false);
241  CPPUNIT_ASSERT(sorter(pair12, pair10) == false);
242 
243  CPPUNIT_ASSERT(sorter(pair12, pair11) == false);
244 
245  // make sure no entry is smaller than itself
246  CPPUNIT_ASSERT(sorter(pair1, pair1) == false);
247  CPPUNIT_ASSERT(sorter(pair2, pair2) == false);
248  CPPUNIT_ASSERT(sorter(pair3, pair3) == false);
249  CPPUNIT_ASSERT(sorter(pair4, pair4) == false);
250  CPPUNIT_ASSERT(sorter(pair5, pair5) == false);
251  CPPUNIT_ASSERT(sorter(pair6, pair6) == false);
252  CPPUNIT_ASSERT(sorter(pair7, pair7) == false);
253  CPPUNIT_ASSERT(sorter(pair8, pair6) == false);
254  CPPUNIT_ASSERT(sorter(pair9, pair9) == false);
255  CPPUNIT_ASSERT(sorter(pair10, pair10) == false);
256  CPPUNIT_ASSERT(sorter(pair11, pair11) == false);
257  CPPUNIT_ASSERT(sorter(pair12, pair12) == false);
258 
259  delete pLogicalItem1;
260  delete pLogicalItem2;
261  delete pLogicalItem3;
262 }
263 
264 void test_cnormallogical::test_SetSorter_operator()
265 {
267  CNormalLogicalItem* pLogicalItem1 = new CNormalLogicalItem();
268  pLogicalItem1->setType(CNormalLogicalItem::TRUE);
269  CNormalLogicalItem* pLogicalItem2 = new CNormalLogicalItem();
270  pLogicalItem2->setType(CNormalLogicalItem::FALSE);
271  CNormalLogicalItem* pLogicalItem3 = new CNormalLogicalItem();
272  pLogicalItem3->setType(CNormalLogicalItem::EQ);
273  CNormalFraction* pFraction1 = new CNormalFraction();
274  pFraction1->multiply(7.0);
275  CNormalFraction* pFraction2 = new CNormalFraction();
276  pFraction1->multiply(9.0);
277  pLogicalItem3->setLeft(*pFraction1);
278  pLogicalItem3->setRight(*pFraction2);
279  delete pFraction1;
280  delete pFraction2;
281  std::pair<CNormalLogicalItem*, bool> pair1 = std::make_pair(pLogicalItem1, false);
282  std::pair<CNormalLogicalItem*, bool> pair2 = std::make_pair(pLogicalItem1, true);
283  std::pair<CNormalLogicalItem*, bool> pair3 = std::make_pair(pLogicalItem2, false);
284  std::pair<CNormalLogicalItem*, bool> pair4 = std::make_pair(pLogicalItem2, true);
285  std::pair<CNormalLogicalItem*, bool> pair5 = std::make_pair(pLogicalItem3, false);
286  std::pair<CNormalLogicalItem*, bool> pair6 = std::make_pair(pLogicalItem3, true);
287 
288  CPPUNIT_ASSERT(sorter(pair1, pair3) == true);
289  CPPUNIT_ASSERT(sorter(pair3, pair5) == true);
290  CPPUNIT_ASSERT(sorter(pair1, pair5) == true);
291 
292  CPPUNIT_ASSERT(sorter(pair2, pair4) == true);
293  CPPUNIT_ASSERT(sorter(pair4, pair6) == true);
294  CPPUNIT_ASSERT(sorter(pair2, pair6) == true);
295 
296  CPPUNIT_ASSERT(sorter(pair2, pair1) == true);
297  CPPUNIT_ASSERT(sorter(pair4, pair1) == true);
298  CPPUNIT_ASSERT(sorter(pair6, pair1) == true);
299 
300  CPPUNIT_ASSERT(sorter(pair2, pair3) == true);
301  CPPUNIT_ASSERT(sorter(pair4, pair3) == true);
302  CPPUNIT_ASSERT(sorter(pair6, pair3) == true);
303 
304  CPPUNIT_ASSERT(sorter(pair2, pair5) == true);
305  CPPUNIT_ASSERT(sorter(pair4, pair5) == true);
306  CPPUNIT_ASSERT(sorter(pair6, pair5) == true);
307 
308  // turn all comparisons around
309  CPPUNIT_ASSERT(sorter(pair3, pair1) == false);
310  CPPUNIT_ASSERT(sorter(pair5, pair3) == false);
311  CPPUNIT_ASSERT(sorter(pair5, pair1) == false);
312 
313  CPPUNIT_ASSERT(sorter(pair4, pair2) == false);
314  CPPUNIT_ASSERT(sorter(pair6, pair4) == false);
315  CPPUNIT_ASSERT(sorter(pair6, pair2) == false);
316 
317  CPPUNIT_ASSERT(sorter(pair1, pair2) == false);
318  CPPUNIT_ASSERT(sorter(pair1, pair4) == false);
319  CPPUNIT_ASSERT(sorter(pair1, pair6) == false);
320 
321  CPPUNIT_ASSERT(sorter(pair3, pair2) == false);
322  CPPUNIT_ASSERT(sorter(pair3, pair4) == false);
323  CPPUNIT_ASSERT(sorter(pair3, pair6) == false);
324 
325  CPPUNIT_ASSERT(sorter(pair5, pair2) == false);
326  CPPUNIT_ASSERT(sorter(pair5, pair4) == false);
327  CPPUNIT_ASSERT(sorter(pair5, pair6) == false);
328 
329  // make sure no entry is smaller than itself
330  CPPUNIT_ASSERT(sorter(pair1, pair1) == false);
331  CPPUNIT_ASSERT(sorter(pair2, pair2) == false);
332  CPPUNIT_ASSERT(sorter(pair3, pair3) == false);
333  CPPUNIT_ASSERT(sorter(pair4, pair4) == false);
334  CPPUNIT_ASSERT(sorter(pair5, pair5) == false);
335  CPPUNIT_ASSERT(sorter(pair6, pair6) == false);
336 
337  delete pLogicalItem1;
338  delete pLogicalItem2;
339  delete pLogicalItem3;
340 }
341 
342 void test_cnormallogical::test_SetSorter_LogicalItem()
343 {
345  CPPUNIT_ASSERT(set.size() == 0);
346  CNormalLogicalItem* pItem = new CNormalLogicalItem();
347 
348  pItem->setType(CNormalLogicalItem::TRUE);
349  CNormalLogicalItem* pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
350  CPPUNIT_ASSERT(pNewItem != NULL);
351  set.insert(std::make_pair(pNewItem, false));
352  CPPUNIT_ASSERT(set.size() == 1);
353  pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
354  set.insert(std::make_pair(pNewItem, false));
355  CPPUNIT_ASSERT(set.size() == 1);
356  delete pNewItem;
357  pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
358  CPPUNIT_ASSERT(pNewItem != NULL);
359  set.insert(std::make_pair(pNewItem, true));
360  CPPUNIT_ASSERT(set.size() == 2);
362  set.clear();
363  CPPUNIT_ASSERT(set.size() == 0);
364 
365  pItem->setType(CNormalLogicalItem::FALSE);
366  pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
367  CPPUNIT_ASSERT(pNewItem != NULL);
368  set.insert(std::make_pair(pNewItem, false));
369  CPPUNIT_ASSERT(set.size() == 1);
370  pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
371  set.insert(std::make_pair(pNewItem, false));
372  CPPUNIT_ASSERT(set.size() == 1);
373  delete pNewItem;
374  pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
375  CPPUNIT_ASSERT(pNewItem != NULL);
376  set.insert(std::make_pair(pNewItem, true));
377  CPPUNIT_ASSERT(set.size() == 2);
379  set.clear();
380  CPPUNIT_ASSERT(set.size() == 0);
381 
382  pItem->setType(CNormalLogicalItem::LT);
383  CNormalFraction* pFraction = new CNormalFraction();
384  pFraction->multiply(3.0);
385  pItem->setLeft(*pFraction);
386  pFraction->multiply(5.0);
387  pItem->setRight(*pFraction);
388  delete pFraction;
389  pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
390  CPPUNIT_ASSERT(pNewItem != NULL);
391  set.insert(std::make_pair(pNewItem, false));
392  CPPUNIT_ASSERT(set.size() == 1);
393  pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
394  set.insert(std::make_pair(pNewItem, false));
395  CPPUNIT_ASSERT(set.size() == 1);
396  delete pNewItem;
397  pNewItem = dynamic_cast<CNormalLogicalItem*>(pItem->copy());
398  CPPUNIT_ASSERT(pNewItem != NULL);
399  set.insert(std::make_pair(pNewItem, true));
400  CPPUNIT_ASSERT(set.size() == 2);
402  set.clear();
403  CPPUNIT_ASSERT(set.size() == 0);
404 
405  delete pItem;
406 }
407 
408 void test_cnormallogical::test_SetOfSetsSorter_LogicalItem()
409 {
411  CPPUNIT_ASSERT(setOfSets.size() == 0);
413  CNormalLogicalItem* pLogicalItem = new CNormalLogicalItem();
414  pLogicalItem->setType(CNormalLogicalItem::TRUE);
415  CNormalLogicalItem* pNewItem = dynamic_cast<CNormalLogicalItem*>(pLogicalItem->copy());
416  CPPUNIT_ASSERT(pNewItem != NULL);
417 
418  set.insert(std::make_pair(pNewItem, false));
419  setOfSets.insert(std::make_pair(set, false));
420  CPPUNIT_ASSERT(setOfSets.size() == 1);
421  // add the same thing again
422  set.clear();
423  CPPUNIT_ASSERT(set.size() == 0);
424  pNewItem = dynamic_cast<CNormalLogicalItem*>(pLogicalItem->copy());
425  CPPUNIT_ASSERT(pNewItem != NULL);
426  set.insert(std::make_pair(pNewItem, false));
427  setOfSets.insert(std::make_pair(set, false));
428  CPPUNIT_ASSERT(setOfSets.size() == 1);
429 
431  set.clear();
432  CPPUNIT_ASSERT(set.size() == 0);
433  pNewItem = dynamic_cast<CNormalLogicalItem*>(pLogicalItem->copy());
434  CPPUNIT_ASSERT(pNewItem != NULL);
435  set.insert(std::make_pair(pNewItem, true));
436  setOfSets.insert(std::make_pair(set, false));
437  CPPUNIT_ASSERT(setOfSets.size() == 2);
438  // add the same thing again
439  set.clear();
440  CPPUNIT_ASSERT(set.size() == 0);
441  pNewItem = dynamic_cast<CNormalLogicalItem*>(pLogicalItem->copy());
442  CPPUNIT_ASSERT(pNewItem != NULL);
443  set.insert(std::make_pair(pNewItem, true));
444  setOfSets.insert(std::make_pair(set, false));
445  CPPUNIT_ASSERT(setOfSets.size() == 2);
446 
448  set.clear();
449  CPPUNIT_ASSERT(set.size() == 0);
450  pNewItem = dynamic_cast<CNormalLogicalItem*>(pLogicalItem->copy());
451  CPPUNIT_ASSERT(pNewItem != NULL);
452  set.insert(std::make_pair(pNewItem, false));
453  setOfSets.insert(std::make_pair(set, true));
454  CPPUNIT_ASSERT(setOfSets.size() == 3);
455  // add the same thing again
456  set.clear();
457  CPPUNIT_ASSERT(set.size() == 0);
458  pNewItem = dynamic_cast<CNormalLogicalItem*>(pLogicalItem->copy());
459  CPPUNIT_ASSERT(pNewItem != NULL);
460  set.insert(std::make_pair(pNewItem, false));
461  setOfSets.insert(std::make_pair(set, true));
462  CPPUNIT_ASSERT(setOfSets.size() == 3);
463 
465  set.clear();
466  CPPUNIT_ASSERT(set.size() == 0);
467  pNewItem = dynamic_cast<CNormalLogicalItem*>(pLogicalItem->copy());
468  CPPUNIT_ASSERT(pNewItem != NULL);
469  set.insert(std::make_pair(pNewItem, true));
470  setOfSets.insert(std::make_pair(set, true));
471  CPPUNIT_ASSERT(setOfSets.size() == 4);
472  // add the same thing again
473  set.clear();
474  CPPUNIT_ASSERT(set.size() == 0);
475  pNewItem = dynamic_cast<CNormalLogicalItem*>(pLogicalItem->copy());
476  CPPUNIT_ASSERT(pNewItem != NULL);
477  set.insert(std::make_pair(pNewItem, true));
478  setOfSets.insert(std::make_pair(set, true));
479  CPPUNIT_ASSERT(setOfSets.size() == 4);
481  set.clear();
483  delete pLogicalItem;
484 }
485 
486 void test_cnormallogical::test_simplify_1()
487 {
488  CNormalLogicalItem* pCond = new CNormalLogicalItem();
490  std::string infix("A");
491  CEvaluationTree* pTree = new CEvaluationTree();
492  pTree->setInfix(infix);
493  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
495  pCond->setLeft(*pFraction);
496  delete pTree;
497  delete pFraction;
498 
499  infix = "PI";
500  pTree = new CEvaluationTree();
501  pTree->setInfix(infix);
502  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
504  pCond->setRight(*pFraction);
505  delete pTree;
506  delete pFraction;
507 
508  CNormalLogicalItem* pTrue = new CNormalLogicalItem();
510 
511  CNormalLogicalItem* pFalse = new CNormalLogicalItem();
513  infix = "4";
514  pTree = new CEvaluationTree();
515  pTree->setInfix(infix);
516  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
518  pFalse->setLeft(*pFraction);
519  delete pTree;
520  delete pFraction;
521 
522  infix = "A";
523  pTree = new CEvaluationTree();
524  pTree->setInfix(infix);
525  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
527  pFalse->setRight(*pFraction);
528  delete pTree;
529  delete pFraction;
530 
531  CNormalChoiceLogical* pLogicalChoice = new CNormalChoiceLogical();
532  CNormalLogical* pTmpLogical = new CNormalLogical();
534  tmpSet.insert(std::make_pair(new CNormalLogicalItem(*pCond), false));
535  pTmpLogical->getAndSets().insert(std::make_pair(tmpSet, false));
536  pLogicalChoice->setCondition(*pTmpLogical);
537  delete pCond;
538  delete pTmpLogical;
539  tmpSet.clear();
540 
541  pTmpLogical = new CNormalLogical();
542  tmpSet.insert(std::make_pair(new CNormalLogicalItem(*pTrue), false));
543  pTmpLogical->getAndSets().insert(std::make_pair(tmpSet, false));
544  pLogicalChoice->setTrueExpression(*pTmpLogical);
545  delete pTrue;
546  delete pTmpLogical;
547  tmpSet.clear();
548 
549  pTmpLogical = new CNormalLogical();
550  tmpSet.insert(std::make_pair(new CNormalLogicalItem(*pFalse), false));
551  pTmpLogical->getAndSets().insert(std::make_pair(tmpSet, false));
552  pLogicalChoice->setFalseExpression(*pTmpLogical);
553  delete pFalse;
554  delete pTmpLogical;
555  tmpSet.clear();
556 
557  CNormalLogical* pLogical = new CNormalLogical();
559  set.insert(std::make_pair(pLogicalChoice, false));
560  pLogical->getChoices().insert(std::make_pair(set, false));
561 
562  CPPUNIT_ASSERT(pLogical->simplify() == true);
563 
564  CPPUNIT_ASSERT(pLogical->getChoices().size() == 0);
565  const CNormalLogical::ItemSetOfSets& orItems = pLogical->getAndSets();
566  CPPUNIT_ASSERT(orItems.size() == 1);
567 
568  CNormalLogical::ItemSetOfSets::const_iterator it = orItems.begin();
569  CPPUNIT_ASSERT(it->second == false);
570  const CNormalLogical::ItemSet& andSet2 = it->first;
571  CPPUNIT_ASSERT(andSet2.size() == 2);
572 
573  CNormalLogical::ItemSet::const_iterator it2 = andSet2.begin();
574  CPPUNIT_ASSERT(it2->second == false);
575  const CNormalLogicalItem* pItem = it2->first;
576  CPPUNIT_ASSERT(pItem->getType() == CNormalLogicalItem::NE);
577 
578  pFraction = &pItem->getLeft();
579  CPPUNIT_ASSERT(pFraction != NULL);
580  CPPUNIT_ASSERT(pFraction->checkDenominatorOne() == true);
581 
582  const CNormalSum* pNumerator = &pFraction->getNumerator();
583  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
584  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
585  CPPUNIT_ASSERT(pProducts->size() == 1);
586  const CNormalProduct* pProduct = *(pProducts->begin());
587  CPPUNIT_ASSERT(pProduct != NULL);
588  CPPUNIT_ASSERT(pProduct->getFactor() == 4.0);
589  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
590 
591  pFraction = &pItem->getRight();
592  CPPUNIT_ASSERT(pFraction != NULL);
593  CPPUNIT_ASSERT(pFraction->checkDenominatorOne() == true);
594 
595  pNumerator = &pFraction->getNumerator();
596  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
597  pProducts = &pNumerator->getProducts();
598  CPPUNIT_ASSERT(pProducts->size() == 1);
599  pProduct = *(pProducts->begin());
600  CPPUNIT_ASSERT(pProduct != NULL);
601  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
602  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
603  const CNormalItemPower* pItemPower = *(pProduct->getItemPowers().begin());
604  CPPUNIT_ASSERT(pItemPower != NULL);
605  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
606  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
607  const CNormalItem* pNormalItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
608  CPPUNIT_ASSERT(pNormalItem != NULL);
609  CPPUNIT_ASSERT(pNormalItem->getType() == CNormalItem::VARIABLE);
610  CPPUNIT_ASSERT(pNormalItem->getName() == "A");
611 
612  ++it2;
613  CPPUNIT_ASSERT(it2->second == false);
614  pItem = it2->first;
615  CPPUNIT_ASSERT(pItem->getType() == CNormalLogicalItem::LE);
616 
617  pFraction = &pItem->getLeft();
618  CPPUNIT_ASSERT(pFraction != NULL);
619  CPPUNIT_ASSERT(pFraction->checkDenominatorOne() == true);
620 
621  pNumerator = &pFraction->getNumerator();
622  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
623  pProducts = &pNumerator->getProducts();
624  CPPUNIT_ASSERT(pProducts->size() == 1);
625  pProduct = *(pProducts->begin());
626  CPPUNIT_ASSERT(pProduct != NULL);
627  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
628  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
629  pItemPower = *(pProduct->getItemPowers().begin());
630  CPPUNIT_ASSERT(pItemPower != NULL);
631  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
632  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
633  pNormalItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
634  CPPUNIT_ASSERT(pNormalItem != NULL);
635  CPPUNIT_ASSERT(pNormalItem->getType() == CNormalItem::VARIABLE);
636  CPPUNIT_ASSERT(pNormalItem->getName() == "A");
637 
638  pFraction = &pItem->getRight();
639  CPPUNIT_ASSERT(pFraction != NULL);
640  CPPUNIT_ASSERT(pFraction->checkDenominatorOne() == true);
641 
642  pNumerator = &pFraction->getNumerator();
643  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
644  pProducts = &pNumerator->getProducts();
645  CPPUNIT_ASSERT(pProducts->size() == 1);
646  pProduct = *(pProducts->begin());
647  CPPUNIT_ASSERT(pProduct != NULL);
648  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
649  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
650  pItemPower = *(pProduct->getItemPowers().begin());
651  CPPUNIT_ASSERT(pItemPower != NULL);
652  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
653  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
654  pNormalItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
655  CPPUNIT_ASSERT(pNormalItem != NULL);
656  CPPUNIT_ASSERT(pNormalItem->getType() == CNormalItem::CONSTANT);
657  CPPUNIT_ASSERT(pNormalItem->getName() == "PI");
658 
659  delete pLogical;
660 }
661 
662 void test_cnormallogical::test_SetSorter_operator2()
663 {
664  // create items to sort
665  // A: (PI < A) !A: (A <= PI)
666  // B: (4 != A) !B: (4 == A)
667  // C: (2 == T) !C: (2 != T)
668  // D: (D != F) !D: (D == F)
669  // E: (SIN (PI*D) < X) !E: (X <= SIN(PI*D))
670  // F: (2*T^(3J) != 6.2) !F: (2*T^(3J) == 6.2)
671  std::string infix("A");
672  CEvaluationTree* pTree = new CEvaluationTree();
673  pTree->setInfix(infix);
674  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
676  CPPUNIT_ASSERT(pA != NULL);
677  infix = "PI";
678  pTree->setInfix(infix);
679  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
681  CPPUNIT_ASSERT(pPI != NULL);
682  infix = "D";
683  pTree->setInfix(infix);
684  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
686  CPPUNIT_ASSERT(pD != NULL);
687  infix = "F";
688  pTree->setInfix(infix);
689  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
691  CPPUNIT_ASSERT(pF != NULL);
692  infix = "T";
693  pTree->setInfix(infix);
694  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
696  CPPUNIT_ASSERT(pT != NULL);
697  infix = "X";
698  pTree->setInfix(infix);
699  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
701  CPPUNIT_ASSERT(pX != NULL);
702  infix = "SIN(PI*D)";
703  pTree->setInfix(infix);
704  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
706  CPPUNIT_ASSERT(pSIN != NULL);
707  infix = "2*T^(3*J)";
708  pTree->setInfix(infix);
709  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
711  CPPUNIT_ASSERT(pPOWER != NULL);
712  infix = "2";
713  pTree->setInfix(infix);
714  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
716  CPPUNIT_ASSERT(pTWO != NULL);
717  infix = "4";
718  pTree->setInfix(infix);
719  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
721  CPPUNIT_ASSERT(pFOUR != NULL);
722  infix = "6.2";
723  pTree->setInfix(infix);
724  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
726  CPPUNIT_ASSERT(pSIX != NULL);
727  delete pTree;
728 
729  // A: (PI < A) !A: (A <= PI)
732  pLA->setLeft(*pPI);
733  pLA->setRight(*pA);
734  CNormalLogicalItem* pLNotA = new CNormalLogicalItem();
736  pLNotA->setLeft(*pA);
737  pLNotA->setRight(*pPI);
738  // B: (4 != A) !B: (4 == A)
741  pLB->setLeft(*pFOUR);
742  pLB->setRight(*pA);
743  CNormalLogicalItem* pLNotB = new CNormalLogicalItem();
745  pLNotB->setLeft(*pFOUR);
746  pLNotB->setRight(*pA);
747  // C: (2 == T) !C: (2 != T)
750  pLC->setLeft(*pTWO);
751  pLC->setRight(*pT);
752  CNormalLogicalItem* pLNotC = new CNormalLogicalItem();
754  pLNotC->setLeft(*pTWO);
755  pLNotC->setRight(*pT);
756  // D: (D != F) !D: (D == F)
759  pLD->setLeft(*pD);
760  pLD->setRight(*pF);
761  CNormalLogicalItem* pLNotD = new CNormalLogicalItem();
763  pLNotD->setLeft(*pD);
764  pLNotD->setRight(*pF);
765  // E: (SIN (PI*D) < X) !E: (X <= SIN(PI*D))
768  pLE->setLeft(*pSIN);
769  pLE->setRight(*pX);
770  CNormalLogicalItem* pLNotE = new CNormalLogicalItem();
772  pLNotE->setLeft(*pX);
773  pLNotE->setRight(*pSIN);
774  // F: (2*T^(3J) != 6.2) !F: (2*T^(3J) == 6.2)
777  pLF->setLeft(*pPOWER);
778  pLF->setRight(*pSIX);
779  CNormalLogicalItem* pLNotF = new CNormalLogicalItem();
781  pLNotF->setLeft(*pPOWER);
782  pLNotF->setRight(*pSIX);
783 
784  delete pA;
785  delete pPI;
786  delete pT;
787  delete pX;
788  delete pF;
789  delete pD;
790  delete pPOWER;
791  delete pSIN;
792  delete pTWO;
793  delete pFOUR;
794  delete pSIX;
795 
796  // now compare the items with each other
798  // pLA with the rest
799  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == false);
800  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
801  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == false);
802  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
803  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
804  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == false);
805  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == false);
806  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
807  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
808  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
809  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == false);
810  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLA, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
811 
812  // pLNotA with the rest
813  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == false);
814  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == false);
815  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == false);
816  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
817  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
818  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == false);
819  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == false);
820  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
821  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == false);
822  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
823  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == false);
824  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotA, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
825 
826  // pLB with the rest
827  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == true);
828  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
829  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == false);
830  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
831  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
832  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == false);
833  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == false);
834  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
835  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
836  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
837  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == false);
838  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLB, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
839 
840  // pLNotB with the rest
841  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == true);
842  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
843  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == true);
844  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
845  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
846  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == true);
847  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == true);
848  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
849  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
850  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
851  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == true);
852  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotB, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
853 
854  // pLC with the rest
855  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == true);
856  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
857  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == true);
858  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == true);
859  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
860  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == true);
861  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == true);
862  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
863  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
864  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
865  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == true);
866  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLC, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == true);
867 
868  // pLNotC with the rest
869  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == true);
870  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
871  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == true);
872  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
873  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
874  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == false);
875  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == false);
876  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
877  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
878  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
879  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == true);
880  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotC, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
881 
882  // pLD with the rest
883  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == true);
884  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
885  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == true);
886  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
887  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
888  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == true);
889  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == false);
890  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
891  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
892  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
893  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == true);
894  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLD, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
895 
896  // pLNotD with the rest
897  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == true);
898  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
899  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == true);
900  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == true);
901  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == true);
902  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == true);
903  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == true);
904  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
905  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
906  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
907  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == true);
908  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotD, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == true);
909 
910  // pLE with the rest
911  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == false);
912  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
913  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == false);
914  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
915  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
916  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == false);
917  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == false);
918  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
919  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == false);
920  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
921  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == false);
922  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLE, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
923 
924  // pLNotE with the rest
925  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == false);
926  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == false);
927  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == false);
928  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
929  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
930  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == false);
931  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == false);
932  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
933  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == false);
934  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == false);
935  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == false);
936  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotE, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
937 
938  // pLF with the rest
939  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == true);
940  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
941  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == true);
942  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == false);
943  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
944  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == false);
945  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == false);
946  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
947  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
948  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
949  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == false);
950  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLF, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
951 
952  // pLNotF with the rest
953  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLA, false)) == true);
954  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLNotA, false)) == true);
955  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLB, false)) == true);
956  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLNotB, false)) == true);
957  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLC, false)) == false);
958  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLNotC, false)) == true);
959  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLD, false)) == true);
960  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLNotD, false)) == false);
961  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLE, false)) == true);
962  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLNotE, false)) == true);
963  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLF, false)) == true);
964  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogicalItem*, bool>(pLNotF, false), std::pair<CNormalLogicalItem*, bool>(pLNotF, false)) == false);
965 
966  // now try the whole thing in a real set
967  std::set<std::pair<CNormalLogicalItem*, bool>, CNormalLogical::SetSorter<CNormalLogicalItem> > sortedSet;
968  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
969  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotA, false));
970  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLB, false));
971  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
972  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false));
973  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false));
974  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLD, false));
975  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
976  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
977  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotE, false));
978  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
979  sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotF, false));
980  CPPUNIT_ASSERT(sortedSet.size() == 12);
981  // make sure no item is inserted twice
982  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false)).second == false);
983  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotA, false)).second == false);
984  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLB, false)).second == false);
985  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false)).second == false);
986  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false)).second == false);
987  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false)).second == false);
988  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLD, false)).second == false);
989  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false)).second == false);
990  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false)).second == false);
991  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotE, false)).second == false);
992  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false)).second == false);
993  CPPUNIT_ASSERT(sortedSet.insert(std::pair<CNormalLogicalItem*, bool>(pLNotF, false)).second == false);
994  CPPUNIT_ASSERT(sortedSet.size() == 12);
995 
996  // check the order in the set
997  std::set<std::pair<CNormalLogicalItem*, bool>, CNormalLogical::SetSorter<CNormalLogicalItem> >::iterator it = sortedSet.begin();
998  CPPUNIT_ASSERT(it->first == pLNotD);
999  CPPUNIT_ASSERT(it->second == false);
1000  ++it;
1001  CPPUNIT_ASSERT(it->first == pLC);
1002  CPPUNIT_ASSERT(it->second == false);
1003  ++it;
1004  CPPUNIT_ASSERT(it->first == pLNotF);
1005  CPPUNIT_ASSERT(it->second == false);
1006  ++it;
1007  CPPUNIT_ASSERT(it->first == pLNotB);
1008  CPPUNIT_ASSERT(it->second == false);
1009  ++it;
1010  CPPUNIT_ASSERT(it->first == pLD);
1011  CPPUNIT_ASSERT(it->second == false);
1012  ++it;
1013  CPPUNIT_ASSERT(it->first == pLNotC);
1014  CPPUNIT_ASSERT(it->second == false);
1015  ++it;
1016  CPPUNIT_ASSERT(it->first == pLF);
1017  CPPUNIT_ASSERT(it->second == false);
1018  ++it;
1019  CPPUNIT_ASSERT(it->first == pLB);
1020  CPPUNIT_ASSERT(it->second == false);
1021  ++it;
1022  CPPUNIT_ASSERT(it->first == pLA);
1023  CPPUNIT_ASSERT(it->second == false);
1024  ++it;
1025  CPPUNIT_ASSERT(it->first == pLE);
1026  CPPUNIT_ASSERT(it->second == false);
1027  ++it;
1028  CPPUNIT_ASSERT(it->first == pLNotA);
1029  CPPUNIT_ASSERT(it->second == false);
1030  ++it;
1031  CPPUNIT_ASSERT(it->first == pLNotE);
1032  CPPUNIT_ASSERT(it->second == false);
1033  ++it;
1034  CPPUNIT_ASSERT(it == sortedSet.end());
1035 
1036  delete pLA;
1037  delete pLNotA;
1038  delete pLB;
1039  delete pLNotB;
1040  delete pLC;
1041  delete pLNotC;
1042  delete pLD;
1043  delete pLNotD;
1044  delete pLE;
1045  delete pLNotE;
1046  delete pLF;
1047  delete pLNotF;
1048 }
1049 
1050 void test_cnormallogical::test_SetOfSetsSorter_operator2()
1051 {
1052  // create items to sort
1053  // A: (PI < A) !A: (A <= PI)
1054  // B: (4 != A) !B: (4 == A)
1055  // C: (2 == T) !C: (2 != T)
1056  // D: (D != F) !D: (D == F)
1057  // E: (SIN (PI*D) < X) !E: (X <= SIN(PI*D))
1058  // F: (2*T^(3J) != 6.2) !F: (2*T^(3J) == 6.2)
1059  std::string infix("A");
1060  CEvaluationTree* pTree = new CEvaluationTree();
1061  pTree->setInfix(infix);
1062  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1064  CPPUNIT_ASSERT(pA != NULL);
1065  infix = "PI";
1066  pTree->setInfix(infix);
1067  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1069  CPPUNIT_ASSERT(pPI != NULL);
1070  infix = "D";
1071  pTree->setInfix(infix);
1072  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1074  CPPUNIT_ASSERT(pD != NULL);
1075  infix = "F";
1076  pTree->setInfix(infix);
1077  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1079  CPPUNIT_ASSERT(pF != NULL);
1080  infix = "T";
1081  pTree->setInfix(infix);
1082  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1084  CPPUNIT_ASSERT(pT != NULL);
1085  infix = "X";
1086  pTree->setInfix(infix);
1087  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1089  CPPUNIT_ASSERT(pX != NULL);
1090  infix = "SIN(PI*D)";
1091  pTree->setInfix(infix);
1092  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1094  CPPUNIT_ASSERT(pSIN != NULL);
1095  infix = "2*T^(3*J)";
1096  pTree->setInfix(infix);
1097  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1099  CPPUNIT_ASSERT(pPOWER != NULL);
1100  infix = "2";
1101  pTree->setInfix(infix);
1102  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1104  CPPUNIT_ASSERT(pTWO != NULL);
1105  infix = "4";
1106  pTree->setInfix(infix);
1107  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1109  CPPUNIT_ASSERT(pFOUR != NULL);
1110  infix = "6.2";
1111  pTree->setInfix(infix);
1112  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1114  CPPUNIT_ASSERT(pSIX != NULL);
1115  delete pTree;
1116 
1117  // A: (PI < A) !A: (A <= PI)
1120  pLA->setLeft(*pPI);
1121  pLA->setRight(*pA);
1122  CNormalLogicalItem* pLNotA = new CNormalLogicalItem();
1124  pLNotA->setLeft(*pA);
1125  pLNotA->setRight(*pPI);
1126  // B: (4 != A) !B: (4 == A)
1129  pLB->setLeft(*pFOUR);
1130  pLB->setRight(*pA);
1131  CNormalLogicalItem* pLNotB = new CNormalLogicalItem();
1133  pLNotB->setLeft(*pFOUR);
1134  pLNotB->setRight(*pA);
1135  // C: (2 == T) !C: (2 != T)
1138  pLC->setLeft(*pTWO);
1139  pLC->setRight(*pT);
1140  CNormalLogicalItem* pLNotC = new CNormalLogicalItem();
1142  pLNotC->setLeft(*pTWO);
1143  pLNotC->setRight(*pT);
1144  // D: (D != F) !D: (D == F)
1147  pLD->setLeft(*pD);
1148  pLD->setRight(*pF);
1149  CNormalLogicalItem* pLNotD = new CNormalLogicalItem();
1151  pLNotD->setLeft(*pD);
1152  pLNotD->setRight(*pF);
1153  // E: (SIN (PI*D) < X) !E: (X <= SIN(PI*D))
1156  pLE->setLeft(*pSIN);
1157  pLE->setRight(*pX);
1158  CNormalLogicalItem* pLNotE = new CNormalLogicalItem();
1160  pLNotE->setLeft(*pX);
1161  pLNotE->setRight(*pSIN);
1162  // F: (2*T^(3J) != 6.2) !F: (2*T^(3J) == 6.2)
1165  pLF->setLeft(*pPOWER);
1166  pLF->setRight(*pSIX);
1167  CNormalLogicalItem* pLNotF = new CNormalLogicalItem();
1169  pLNotF->setLeft(*pPOWER);
1170  pLNotF->setRight(*pSIX);
1171 
1172  delete pA;
1173  delete pPI;
1174  delete pT;
1175  delete pX;
1176  delete pF;
1177  delete pD;
1178  delete pPOWER;
1179  delete pSIN;
1180  delete pTWO;
1181  delete pFOUR;
1182  delete pSIX;
1183 
1184  // create 12 sorted sets and add them to a Set of Sets
1185  CNormalLogical::ItemSet sortedSet1, sortedSet2, sortedSet3, sortedSet4, sortedSet5, sortedSet6, sortedSet7, sortedSet8, sortedSet9, sortedSet10, sortedSet11, sortedSet12;
1186  // add one item to each sorted set
1187  sortedSet1.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1188  sortedSet2.insert(std::pair<CNormalLogicalItem*, bool>(pLNotA, false));
1189  sortedSet3.insert(std::pair<CNormalLogicalItem*, bool>(pLB, false));
1190  sortedSet4.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1191  sortedSet5.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false));
1192  sortedSet6.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false));
1193  sortedSet7.insert(std::pair<CNormalLogicalItem*, bool>(pLD, false));
1194  sortedSet8.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
1195  sortedSet9.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1196  sortedSet10.insert(std::pair<CNormalLogicalItem*, bool>(pLNotE, false));
1197  sortedSet11.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1198  sortedSet12.insert(std::pair<CNormalLogicalItem*, bool>(pLNotF, false));
1199 
1200  // check the sets agains each other
1202  // sortedSet1 with the rest
1203  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == false);
1204  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1205  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1206  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1207  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1208  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1209  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1210  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1211  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1212  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1213  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == false);
1214  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1215 
1216  // sortedSet2 with the rest
1217  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == false);
1218  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1219  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1220  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1221  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1222  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1223  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1224  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1225  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == false);
1226  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1227  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == false);
1228  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1229 
1230  // sortedSet3 with the rest
1231  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1232  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1233  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1234  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1235  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1236  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1237  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1238  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1239  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1240  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1241  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == false);
1242  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1243 
1244  // sortedSet4 with the rest
1245  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1246  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1247  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1248  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1249  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1250  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == true);
1251  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1252  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1253  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1254  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1255  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1256  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1257 
1258  // sortedSet5 with the rest
1259  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1260  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1261  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1262  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == true);
1263  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1264  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == true);
1265  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1266  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1267  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1268  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1269  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1270  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == true);
1271 
1272  // sortedSet6 with the rest
1273  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1274  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1275  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1276  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1277  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1278  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1279  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1280  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1281  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1282  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1283  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1284  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1285 
1286  // sortedSet7 with the rest
1287  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1288  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1289  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1290  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1291  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1292  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == true);
1293  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1294  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1295  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1296  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1297  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1298  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1299 
1300  // sortedSet8 with the rest
1301  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1302  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1303  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1304  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == true);
1305  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == true);
1306  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == true);
1307  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1308  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1309  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1310  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1311  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1312  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == true);
1313 
1314  // sortedSet9 with the rest
1315  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == false);
1316  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1317  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1318  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1319  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1320  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1321  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1322  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1323  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == false);
1324  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1325  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == false);
1326  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1327 
1328  // sortedSet10 with the rest
1329  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == false);
1330  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1331  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1332  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1333  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1334  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1335  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1336  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1337  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == false);
1338  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == false);
1339  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == false);
1340  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1341 
1342  // sortedSet11 with the rest
1343  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1344  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1345  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1346  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1347  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1348  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1349  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1350  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1351  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1352  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1353  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == false);
1354  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1355 
1356  // sortedSet12 with the rest
1357  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1358  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == true);
1359  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1360  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == true);
1361  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1362  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == true);
1363  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1364  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1365  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1366  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1367  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1368  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1369 
1370  // test with several entries per ItemSet
1371  // add one item to each sorted set
1372  sortedSet1.clear();
1373  sortedSet2.clear();
1374  sortedSet3.clear();
1375  sortedSet4.clear();
1376  sortedSet5.clear();
1377  sortedSet6.clear();
1378  sortedSet7.clear();
1379  sortedSet8.clear();
1380  sortedSet9.clear();
1381  sortedSet10.clear();
1382  sortedSet11.clear();
1383  sortedSet12.clear();
1384 
1385  // fill set1 with 6 items and check if they are in the right order
1386  sortedSet1.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1387  sortedSet1.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1388  sortedSet1.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1389  sortedSet1.insert(std::pair<CNormalLogicalItem*, bool>(pLD, false));
1390  sortedSet1.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false));
1391  sortedSet1.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1392  CNormalLogical::ItemSet::iterator it = sortedSet1.begin();
1393  CPPUNIT_ASSERT(it->first == pLNotB);
1394  CPPUNIT_ASSERT(it->second == false);
1395  ++it;
1396  CPPUNIT_ASSERT(it->first == pLD);
1397  CPPUNIT_ASSERT(it->second == false);
1398  ++it;
1399  CPPUNIT_ASSERT(it->first == pLNotC);
1400  CPPUNIT_ASSERT(it->second == false);
1401  ++it;
1402  CPPUNIT_ASSERT(it->first == pLF);
1403  CPPUNIT_ASSERT(it->second == false);
1404  ++it;
1405  CPPUNIT_ASSERT(it->first == pLA);
1406  CPPUNIT_ASSERT(it->second == false);
1407  ++it;
1408  CPPUNIT_ASSERT(it->first == pLE);
1409  CPPUNIT_ASSERT(it->second == false);
1410  ++it;
1411  CPPUNIT_ASSERT(it == sortedSet1.end());
1412 
1413  // fill set2 with 6 items and check if they are in the right order
1414  sortedSet2.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1415  sortedSet2.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1416  sortedSet2.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1417  sortedSet2.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
1418  sortedSet2.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false));
1419  sortedSet2.insert(std::pair<CNormalLogicalItem*, bool>(pLNotF, false));
1420  it = sortedSet2.begin();
1421  CPPUNIT_ASSERT(it->first == pLNotD);
1422  CPPUNIT_ASSERT(it->second == false);
1423  ++it;
1424  CPPUNIT_ASSERT(it->first == pLC);
1425  CPPUNIT_ASSERT(it->second == false);
1426  ++it;
1427  CPPUNIT_ASSERT(it->first == pLNotF);
1428  CPPUNIT_ASSERT(it->second == false);
1429  ++it;
1430  CPPUNIT_ASSERT(it->first == pLNotB);
1431  CPPUNIT_ASSERT(it->second == false);
1432  ++it;
1433  CPPUNIT_ASSERT(it->first == pLA);
1434  CPPUNIT_ASSERT(it->second == false);
1435  ++it;
1436  CPPUNIT_ASSERT(it->first == pLE);
1437  CPPUNIT_ASSERT(it->second == false);
1438  ++it;
1439  CPPUNIT_ASSERT(it == sortedSet2.end());
1440 
1441  // fill set3 with 6 items and check if they are in the right order
1442  sortedSet3.insert(std::pair<CNormalLogicalItem*, bool>(pLNotA, false));
1443  sortedSet3.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1444  sortedSet3.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1445  sortedSet3.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
1446  sortedSet3.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false));
1447  sortedSet3.insert(std::pair<CNormalLogicalItem*, bool>(pLNotF, false));
1448  it = sortedSet3.begin();
1449  CPPUNIT_ASSERT(it->first == pLNotD);
1450  CPPUNIT_ASSERT(it->second == false);
1451  ++it;
1452  CPPUNIT_ASSERT(it->first == pLNotF);
1453  CPPUNIT_ASSERT(it->second == false);
1454  ++it;
1455  CPPUNIT_ASSERT(it->first == pLNotB);
1456  CPPUNIT_ASSERT(it->second == false);
1457  ++it;
1458  CPPUNIT_ASSERT(it->first == pLNotC);
1459  CPPUNIT_ASSERT(it->second == false);
1460  ++it;
1461  CPPUNIT_ASSERT(it->first == pLE);
1462  CPPUNIT_ASSERT(it->second == false);
1463  ++it;
1464  CPPUNIT_ASSERT(it->first == pLNotA);
1465  CPPUNIT_ASSERT(it->second == false);
1466  ++it;
1467  CPPUNIT_ASSERT(it == sortedSet3.end());
1468 
1469  // fill set4 with 6 items and check if they are in the right order
1470  sortedSet4.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1471  sortedSet4.insert(std::pair<CNormalLogicalItem*, bool>(pLB, false));
1472  sortedSet4.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1473  sortedSet4.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
1474  sortedSet4.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false));
1475  sortedSet4.insert(std::pair<CNormalLogicalItem*, bool>(pLNotF, false));
1476  it = sortedSet4.begin();
1477  CPPUNIT_ASSERT(it->first == pLNotD);
1478  CPPUNIT_ASSERT(it->second == false);
1479  ++it;
1480  CPPUNIT_ASSERT(it->first == pLNotF);
1481  CPPUNIT_ASSERT(it->second == false);
1482  ++it;
1483  CPPUNIT_ASSERT(it->first == pLNotC);
1484  CPPUNIT_ASSERT(it->second == false);
1485  ++it;
1486  CPPUNIT_ASSERT(it->first == pLB);
1487  CPPUNIT_ASSERT(it->second == false);
1488  ++it;
1489  CPPUNIT_ASSERT(it->first == pLA);
1490  CPPUNIT_ASSERT(it->second == false);
1491  ++it;
1492  CPPUNIT_ASSERT(it->first == pLE);
1493  CPPUNIT_ASSERT(it->second == false);
1494  ++it;
1495  CPPUNIT_ASSERT(it == sortedSet4.end());
1496 
1497  // fill set5 with 6 items and check if they are in the right order
1498  sortedSet5.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1499  sortedSet5.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1500  sortedSet5.insert(std::pair<CNormalLogicalItem*, bool>(pLNotE, false));
1501  sortedSet5.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
1502  sortedSet5.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false));
1503  sortedSet5.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1504  it = sortedSet5.begin();
1505  CPPUNIT_ASSERT(it->first == pLNotD);
1506  CPPUNIT_ASSERT(it->second == false);
1507  ++it;
1508  CPPUNIT_ASSERT(it->first == pLC);
1509  CPPUNIT_ASSERT(it->second == false);
1510  ++it;
1511  CPPUNIT_ASSERT(it->first == pLNotB);
1512  CPPUNIT_ASSERT(it->second == false);
1513  ++it;
1514  CPPUNIT_ASSERT(it->first == pLF);
1515  CPPUNIT_ASSERT(it->second == false);
1516  ++it;
1517  CPPUNIT_ASSERT(it->first == pLA);
1518  CPPUNIT_ASSERT(it->second == false);
1519  ++it;
1520  CPPUNIT_ASSERT(it->first == pLNotE);
1521  CPPUNIT_ASSERT(it->second == false);
1522  ++it;
1523  CPPUNIT_ASSERT(it == sortedSet5.end());
1524 
1525  // fill set6 with 6 items and check if they are in the right order
1526  sortedSet6.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1527  sortedSet6.insert(std::pair<CNormalLogicalItem*, bool>(pLB, false));
1528  sortedSet6.insert(std::pair<CNormalLogicalItem*, bool>(pLNotE, false));
1529  sortedSet6.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
1530  sortedSet6.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false));
1531  sortedSet6.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1532  it = sortedSet6.begin();
1533  CPPUNIT_ASSERT(it->first == pLNotD);
1534  CPPUNIT_ASSERT(it->second == false);
1535  ++it;
1536  CPPUNIT_ASSERT(it->first == pLC);
1537  CPPUNIT_ASSERT(it->second == false);
1538  ++it;
1539  CPPUNIT_ASSERT(it->first == pLF);
1540  CPPUNIT_ASSERT(it->second == false);
1541  ++it;
1542  CPPUNIT_ASSERT(it->first == pLB);
1543  CPPUNIT_ASSERT(it->second == false);
1544  ++it;
1545  CPPUNIT_ASSERT(it->first == pLA);
1546  CPPUNIT_ASSERT(it->second == false);
1547  ++it;
1548  CPPUNIT_ASSERT(it->first == pLNotE);
1549  CPPUNIT_ASSERT(it->second == false);
1550  ++it;
1551  CPPUNIT_ASSERT(it == sortedSet6.end());
1552 
1553  // fill set7 with 6 items and check if they are in the right order
1554  sortedSet7.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1555  sortedSet7.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1556  sortedSet7.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1557  sortedSet7.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
1558  sortedSet7.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false));
1559  sortedSet7.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1560  it = sortedSet7.begin();
1561  CPPUNIT_ASSERT(it->first == pLNotD);
1562  CPPUNIT_ASSERT(it->second == false);
1563  ++it;
1564  CPPUNIT_ASSERT(it->first == pLNotB);
1565  CPPUNIT_ASSERT(it->second == false);
1566  ++it;
1567  CPPUNIT_ASSERT(it->first == pLNotC);
1568  CPPUNIT_ASSERT(it->second == false);
1569  ++it;
1570  CPPUNIT_ASSERT(it->first == pLF);
1571  CPPUNIT_ASSERT(it->second == false);
1572  ++it;
1573  CPPUNIT_ASSERT(it->first == pLA);
1574  CPPUNIT_ASSERT(it->second == false);
1575  ++it;
1576  CPPUNIT_ASSERT(it->first == pLE);
1577  CPPUNIT_ASSERT(it->second == false);
1578  ++it;
1579  CPPUNIT_ASSERT(it == sortedSet7.end());
1580 
1581  // fill set8 with 6 items and check if they are in the right order
1582  sortedSet8.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1583  sortedSet8.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1584  sortedSet8.insert(std::pair<CNormalLogicalItem*, bool>(pLNotE, false));
1585  sortedSet8.insert(std::pair<CNormalLogicalItem*, bool>(pLD, false));
1586  sortedSet8.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false));
1587  sortedSet8.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1588  it = sortedSet8.begin();
1589  CPPUNIT_ASSERT(it->first == pLNotB);
1590  CPPUNIT_ASSERT(it->second == false);
1591  ++it;
1592  CPPUNIT_ASSERT(it->first == pLD);
1593  CPPUNIT_ASSERT(it->second == false);
1594  ++it;
1595  CPPUNIT_ASSERT(it->first == pLNotC);
1596  CPPUNIT_ASSERT(it->second == false);
1597  ++it;
1598  CPPUNIT_ASSERT(it->first == pLF);
1599  CPPUNIT_ASSERT(it->second == false);
1600  ++it;
1601  CPPUNIT_ASSERT(it->first == pLA);
1602  CPPUNIT_ASSERT(it->second == false);
1603  ++it;
1604  CPPUNIT_ASSERT(it->first == pLNotE);
1605  CPPUNIT_ASSERT(it->second == false);
1606  ++it;
1607  CPPUNIT_ASSERT(it == sortedSet8.end());
1608 
1609  // fill set9 with 6 items and check if they are in the right order
1610  sortedSet9.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1611  sortedSet9.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1612  sortedSet9.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1613  sortedSet9.insert(std::pair<CNormalLogicalItem*, bool>(pLD, false));
1614  sortedSet9.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false));
1615  sortedSet9.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1616  it = sortedSet9.begin();
1617  CPPUNIT_ASSERT(it->first == pLC);
1618  CPPUNIT_ASSERT(it->second == false);
1619  ++it;
1620  CPPUNIT_ASSERT(it->first == pLNotB);
1621  CPPUNIT_ASSERT(it->second == false);
1622  ++it;
1623  CPPUNIT_ASSERT(it->first == pLD);
1624  CPPUNIT_ASSERT(it->second == false);
1625  ++it;
1626  CPPUNIT_ASSERT(it->first == pLF);
1627  CPPUNIT_ASSERT(it->second == false);
1628  ++it;
1629  CPPUNIT_ASSERT(it->first == pLA);
1630  CPPUNIT_ASSERT(it->second == false);
1631  ++it;
1632  CPPUNIT_ASSERT(it->first == pLE);
1633  CPPUNIT_ASSERT(it->second == false);
1634  ++it;
1635  CPPUNIT_ASSERT(it == sortedSet9.end());
1636 
1637  // fill set10 with 6 items and check if they are in the right order
1638  sortedSet10.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1639  sortedSet10.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1640  sortedSet10.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1641  sortedSet10.insert(std::pair<CNormalLogicalItem*, bool>(pLD, false));
1642  sortedSet10.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false));
1643  sortedSet10.insert(std::pair<CNormalLogicalItem*, bool>(pLNotF, false));
1644  it = sortedSet10.begin();
1645  CPPUNIT_ASSERT(it->first == pLC);
1646  CPPUNIT_ASSERT(it->second == false);
1647  ++it;
1648  CPPUNIT_ASSERT(it->first == pLNotF);
1649  CPPUNIT_ASSERT(it->second == false);
1650  ++it;
1651  CPPUNIT_ASSERT(it->first == pLNotB);
1652  CPPUNIT_ASSERT(it->second == false);
1653  ++it;
1654  CPPUNIT_ASSERT(it->first == pLD);
1655  CPPUNIT_ASSERT(it->second == false);
1656  ++it;
1657  CPPUNIT_ASSERT(it->first == pLA);
1658  CPPUNIT_ASSERT(it->second == false);
1659  ++it;
1660  CPPUNIT_ASSERT(it->first == pLE);
1661  CPPUNIT_ASSERT(it->second == false);
1662  ++it;
1663  CPPUNIT_ASSERT(it == sortedSet10.end());
1664 
1665  // fill set11 with 6 items and check if they are in the right order
1666  sortedSet11.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1667  sortedSet11.insert(std::pair<CNormalLogicalItem*, bool>(pLB, false));
1668  sortedSet11.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1669  sortedSet11.insert(std::pair<CNormalLogicalItem*, bool>(pLD, false));
1670  sortedSet11.insert(std::pair<CNormalLogicalItem*, bool>(pLNotC, false));
1671  sortedSet11.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1672  it = sortedSet11.begin();
1673  CPPUNIT_ASSERT(it->first == pLD);
1674  CPPUNIT_ASSERT(it->second == false);
1675  ++it;
1676  CPPUNIT_ASSERT(it->first == pLNotC);
1677  CPPUNIT_ASSERT(it->second == false);
1678  ++it;
1679  CPPUNIT_ASSERT(it->first == pLF);
1680  CPPUNIT_ASSERT(it->second == false);
1681  ++it;
1682  CPPUNIT_ASSERT(it->first == pLB);
1683  CPPUNIT_ASSERT(it->second == false);
1684  ++it;
1685  CPPUNIT_ASSERT(it->first == pLA);
1686  CPPUNIT_ASSERT(it->second == false);
1687  ++it;
1688  CPPUNIT_ASSERT(it->first == pLE);
1689  CPPUNIT_ASSERT(it->second == false);
1690  ++it;
1691  CPPUNIT_ASSERT(it == sortedSet11.end());
1692 
1693  // fill set12 with 6 items and check if they are in the right order
1694  sortedSet12.insert(std::pair<CNormalLogicalItem*, bool>(pLA, false));
1695  sortedSet12.insert(std::pair<CNormalLogicalItem*, bool>(pLNotB, false));
1696  sortedSet12.insert(std::pair<CNormalLogicalItem*, bool>(pLE, false));
1697  sortedSet12.insert(std::pair<CNormalLogicalItem*, bool>(pLNotD, false));
1698  sortedSet12.insert(std::pair<CNormalLogicalItem*, bool>(pLC, false));
1699  sortedSet12.insert(std::pair<CNormalLogicalItem*, bool>(pLF, false));
1700  it = sortedSet12.begin();
1701  CPPUNIT_ASSERT(it->first == pLNotD);
1702  CPPUNIT_ASSERT(it->second == false);
1703  ++it;
1704  CPPUNIT_ASSERT(it->first == pLC);
1705  CPPUNIT_ASSERT(it->second == false);
1706  ++it;
1707  CPPUNIT_ASSERT(it->first == pLNotB);
1708  CPPUNIT_ASSERT(it->second == false);
1709  ++it;
1710  CPPUNIT_ASSERT(it->first == pLF);
1711  CPPUNIT_ASSERT(it->second == false);
1712  ++it;
1713  CPPUNIT_ASSERT(it->first == pLA);
1714  CPPUNIT_ASSERT(it->second == false);
1715  ++it;
1716  CPPUNIT_ASSERT(it->first == pLE);
1717  CPPUNIT_ASSERT(it->second == false);
1718  ++it;
1719  CPPUNIT_ASSERT(it == sortedSet12.end());
1720 
1721  // now we compare the sets against each other
1722 
1723  // sortedSet1 with the rest
1724  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == false);
1725  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1726  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1727  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1728  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1729  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1730  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1731  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1732  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == false);
1733  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == false);
1734  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1735  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1736 
1737  // sortedSet2 with the rest
1738  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1739  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1740  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1741  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == true);
1742  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == true);
1743  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == true);
1744  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1745  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1746  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1747  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1748  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1749  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == true);
1750 
1751  // sortedSet3 with the rest
1752  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1753  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1754  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1755  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == true);
1756  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1757  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1758  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1759  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1760  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1761  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1762  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1763  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1764 
1765  // sortedSet4 with the rest
1766  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1767  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1768  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1769  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1770  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1771  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1772  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1773  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1774  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1775  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1776  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1777  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1778 
1779  // sortedSet5 with the rest
1780  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1781  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1782  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1783  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == true);
1784  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1785  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == true);
1786  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1787  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1788  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1789  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1790  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1791  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1792 
1793  // sortedSet6 with the rest
1794  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1795  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1796  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1797  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == true);
1798  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1799  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1800  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1801  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1802  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1803  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1804  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1805  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1806 
1807  // sortedSet7 with the rest
1808  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1809  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1810  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1811  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1812  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1813  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1814  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1815  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1816  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1817  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1818  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1819  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1820 
1821  // sortedSet8 with the rest
1822  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == false);
1823  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1824  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1825  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1826  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1827  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1828  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1829  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1830  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == false);
1831  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == false);
1832  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1833  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1834 
1835  // sortedSet9 with the rest
1836  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1837  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1838  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1839  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1840  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1841  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1842  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1843  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1844  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == false);
1845  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == false);
1846  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1847  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1848 
1849  // sortedSet10 with the rest
1850  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1851  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1852  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1853  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1854  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1855  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1856  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1857  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1858  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1859  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == false);
1860  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1861  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1862 
1863  // sortedSet11 with the rest
1864  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == false);
1865  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1866  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == false);
1867  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == false);
1868  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == false);
1869  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == false);
1870  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == false);
1871  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == false);
1872  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == false);
1873  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == false);
1874  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == false);
1875  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1876 
1877  // sortedSet12 with the rest
1878  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false)) == true);
1879  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false)) == false);
1880  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false)) == true);
1881  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false)) == true);
1882  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false)) == true);
1883  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false)) == true);
1884  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false)) == true);
1885  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false)) == true);
1886  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false)) == true);
1887  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false)) == true);
1888  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false)) == true);
1889  CPPUNIT_ASSERT(sorter(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false), std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false)) == false);
1890 
1891  // now test the whole thing in a real set
1893  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet1, false));
1894  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet2, false));
1895  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet3, false));
1896  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet4, false));
1897  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet5, false));
1898  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet6, false));
1899  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet7, false));
1900  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet8, false));
1901  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet9, false));
1902  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet10, false));
1903  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet11, false));
1904  sset.insert(std::pair<CNormalLogical::ItemSet, bool>(sortedSet12, false));
1905  CPPUNIT_ASSERT(sset.size() == 12);
1906  CNormalLogical::ItemSetOfSets::iterator sit = sset.begin();
1907  CPPUNIT_ASSERT(sit->first == sortedSet2);
1908  CPPUNIT_ASSERT(sit->second == false);
1909  ++sit;
1910  CPPUNIT_ASSERT(sit->first == sortedSet12);
1911  CPPUNIT_ASSERT(sit->second == false);
1912  ++sit;
1913  CPPUNIT_ASSERT(sit->first == sortedSet5);
1914  CPPUNIT_ASSERT(sit->second == false);
1915  ++sit;
1916  CPPUNIT_ASSERT(sit->first == sortedSet6);
1917  CPPUNIT_ASSERT(sit->second == false);
1918  ++sit;
1919  CPPUNIT_ASSERT(sit->first == sortedSet3);
1920  CPPUNIT_ASSERT(sit->second == false);
1921  ++sit;
1922  CPPUNIT_ASSERT(sit->first == sortedSet4);
1923  CPPUNIT_ASSERT(sit->second == false);
1924  ++sit;
1925  CPPUNIT_ASSERT(sit->first == sortedSet7);
1926  CPPUNIT_ASSERT(sit->second == false);
1927  ++sit;
1928  CPPUNIT_ASSERT(sit->first == sortedSet10);
1929  CPPUNIT_ASSERT(sit->second == false);
1930  ++sit;
1931  CPPUNIT_ASSERT(sit->first == sortedSet9);
1932  CPPUNIT_ASSERT(sit->second == false);
1933  ++sit;
1934  CPPUNIT_ASSERT(sit->first == sortedSet1);
1935  CPPUNIT_ASSERT(sit->second == false);
1936  ++sit;
1937  CPPUNIT_ASSERT(sit->first == sortedSet8);
1938  CPPUNIT_ASSERT(sit->second == false);
1939  ++sit;
1940  CPPUNIT_ASSERT(sit->first == sortedSet11);
1941  CPPUNIT_ASSERT(sit->second == false);
1942  ++sit;
1943  CPPUNIT_ASSERT(sit == sset.end());
1944 
1945  delete pLA;
1946  delete pLNotA;
1947  delete pLB;
1948  delete pLNotB;
1949  delete pLC;
1950  delete pLNotC;
1951  delete pLD;
1952  delete pLNotD;
1953  delete pLE;
1954  delete pLNotE;
1955  delete pLF;
1956  delete pLNotF;
1957 }
1958 
1959 /* This test is not necessary right now.
1960 void test_cnormallogical::test_simplify_2()
1961 {
1962 // if(2==T) then FALSE else NOT(D==F)
1963 CNormalLogicalItem* pCond=new CNormalLogicalItem();
1964 pCond->setType(CNormalLogicalItem::EQ);
1965 std::string infix("2");
1966 CEvaluationTree* pTree = new CEvaluationTree();
1967 pTree->setInfix(infix);
1968 CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1969 const CNormalFraction* pFraction = CNormalTranslation::normAndSimplifyReptdly(pTree->getRoot());
1970 pCond->setLeft(*pFraction);
1971 delete pTree;
1972 delete pFraction;
1973 
1974 infix="T";
1975 pTree = new CEvaluationTree();
1976 pTree->setInfix(infix);
1977 CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1978 pFraction = CNormalTranslation::normAndSimplifyReptdly(pTree->getRoot());
1979 pCond->setRight(*pFraction);
1980 delete pTree;
1981 delete pFraction;
1982 
1983 CNormalLogicalItem* pTrue=new CNormalLogicalItem();
1984 pTrue->setType(CNormalLogicalItem::FALSE);
1985 
1986 CNormalLogicalItem* pFalse=new CNormalLogicalItem();
1987 pFalse->setType(CNormalLogicalItem::EQ);
1988 infix="D";
1989 pTree = new CEvaluationTree();
1990 pTree->setInfix(infix);
1991 CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1992 pFraction = CNormalTranslation::normAndSimplifyReptdly(pTree->getRoot());
1993 pFalse->setLeft(*pFraction);
1994 delete pTree;
1995 delete pFraction;
1996 
1997 infix="F";
1998 pTree = new CEvaluationTree();
1999 pTree->setInfix(infix);
2000 CPPUNIT_ASSERT(pTree->getRoot() != NULL);
2001 pFraction = CNormalTranslation::normAndSimplifyReptdly(pTree->getRoot());
2002 pFalse->setRight(*pFraction);
2003 delete pTree;
2004 delete pFraction;
2005 
2006 CNormalChoiceLogical* pLogicalChoice=new CNormalChoiceLogical();
2007 CNormalLogical* pTmpLogical=new CNormalLogical();
2008 CNormalLogical::ItemSet tmpSet;
2009 tmpSet.insert(std::make_pair(new CNormalLogicalItem(*pCond),false));
2010 pTmpLogical->getAndSets().insert(std::make_pair(tmpSet,false));
2011 pLogicalChoice->setCondition(*pTmpLogical);
2012 delete pCond;
2013 delete pTmpLogical;
2014 tmpSet.clear();
2015 
2016 pTmpLogical=new CNormalLogical();
2017 tmpSet.insert(std::make_pair(new CNormalLogicalItem(*pTrue),false));
2018 pTmpLogical->getAndSets().insert(std::make_pair(tmpSet,false));
2019 pLogicalChoice->setTrueExpression(*pTmpLogical);
2020 delete pTrue;
2021 delete pTmpLogical;
2022 tmpSet.clear();
2023 
2024 pTmpLogical=new CNormalLogical();
2025 tmpSet.insert(std::make_pair(new CNormalLogicalItem(*pFalse),false));
2026 pTmpLogical->getAndSets().insert(std::make_pair(tmpSet,false));
2027 pLogicalChoice->setFalseExpression(*pTmpLogical);
2028 delete pFalse;
2029 delete pTmpLogical;
2030 tmpSet.clear();
2031 
2032 CNormalLogical* pLogical=new CNormalLogical();
2033 CNormalLogical::ChoiceSet set;
2034 set.insert(std::make_pair(pLogicalChoice,false));
2035 pLogical->getChoices().insert(std::make_pair(set,false));
2036 
2037 pLogical->simplify();
2038 
2039 CPPUNIT_ASSERT(pLogical->getChoices().size()==0);
2040 const CNormalLogical::ItemSetOfSets& orItems=pLogical->getAndSets();
2041 CPPUNIT_ASSERT(orItems.size()==2);
2042 
2043 CNormalLogical::ItemSetOfSets::const_iterator it=orItems.begin();
2044 CPPUNIT_ASSERT(it->second==false);
2045 const CNormalLogical::ItemSet& andSet=it->first;
2046 CPPUNIT_ASSERT(andSet.size()==1);
2047 CNormalLogical::ItemSet::const_iterator it2=andSet.begin();
2048 CPPUNIT_ASSERT(it2->second==false);
2049 const CNormalLogicalItem* pItem=it2->first;
2050 CPPUNIT_ASSERT(pItem->getType()==CNormalLogicalItem::FALSE);
2051 
2052 ++it;
2053 CPPUNIT_ASSERT(it->second==false);
2054 const CNormalLogical::ItemSet& andSet2=it->first;
2055 CPPUNIT_ASSERT(andSet2.size()==2);
2056 
2057 it2=andSet2.begin();
2058 CPPUNIT_ASSERT(it2->second==false);
2059 pItem=it2->first;
2060 CPPUNIT_ASSERT(pItem->getType()==CNormalLogicalItem::NE);
2061 
2062 pFraction=&pItem->getLeft();
2063 CPPUNIT_ASSERT(pFraction != NULL);
2064 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() == true);
2065 
2066 const CNormalSum* pNumerator = &pFraction->getNumerator();
2067 CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
2068 const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
2069 CPPUNIT_ASSERT(pProducts->size() == 1);
2070 const CNormalProduct* pProduct = *(pProducts->begin());
2071 CPPUNIT_ASSERT(pProduct != NULL);
2072 CPPUNIT_ASSERT(pProduct->getFactor() == 4.0);
2073 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2074 
2075 pFraction=&pItem->getRight();
2076 CPPUNIT_ASSERT(pFraction != NULL);
2077 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() == true);
2078 
2079 pNumerator = &pFraction->getNumerator();
2080 CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
2081 pProducts = &pNumerator->getProducts();
2082 CPPUNIT_ASSERT(pProducts->size() == 1);
2083 pProduct = *(pProducts->begin());
2084 CPPUNIT_ASSERT(pProduct != NULL);
2085 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2086 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2087 const CNormalItemPower* pItemPower = *(pProduct->getItemPowers().begin());
2088 CPPUNIT_ASSERT(pItemPower != NULL);
2089 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2090 CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2091 const CNormalItem* pNormalItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2092 CPPUNIT_ASSERT(pNormalItem != NULL);
2093 CPPUNIT_ASSERT(pNormalItem->getType() == CNormalItem::VARIABLE);
2094 CPPUNIT_ASSERT(pNormalItem->getName() == "A");
2095 
2096 ++it2;
2097 CPPUNIT_ASSERT(it2->second==false);
2098 pItem=it2->first;
2099 CPPUNIT_ASSERT(pItem->getType()==CNormalLogicalItem::LE);
2100 
2101 pFraction=&pItem->getLeft();
2102 CPPUNIT_ASSERT(pFraction != NULL);
2103 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() == true);
2104 
2105 pNumerator = &pFraction->getNumerator();
2106 CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
2107 pProducts = &pNumerator->getProducts();
2108 CPPUNIT_ASSERT(pProducts->size() == 1);
2109 pProduct = *(pProducts->begin());
2110 CPPUNIT_ASSERT(pProduct != NULL);
2111 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2112 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2113 pItemPower = *(pProduct->getItemPowers().begin());
2114 CPPUNIT_ASSERT(pItemPower != NULL);
2115 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2116 CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2117 pNormalItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2118 CPPUNIT_ASSERT(pNormalItem != NULL);
2119 CPPUNIT_ASSERT(pNormalItem->getType() == CNormalItem::VARIABLE);
2120 CPPUNIT_ASSERT(pNormalItem->getName() == "A");
2121 
2122 pFraction=&pItem->getRight();
2123 CPPUNIT_ASSERT(pFraction != NULL);
2124 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() == true);
2125 
2126 pNumerator = &pFraction->getNumerator();
2127 CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
2128 pProducts = &pNumerator->getProducts();
2129 CPPUNIT_ASSERT(pProducts->size() == 1);
2130 pProduct = *(pProducts->begin());
2131 CPPUNIT_ASSERT(pProduct != NULL);
2132 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2133 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2134 pItemPower = *(pProduct->getItemPowers().begin());
2135 CPPUNIT_ASSERT(pItemPower != NULL);
2136 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2137 CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2138 pNormalItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2139 CPPUNIT_ASSERT(pNormalItem != NULL);
2140 CPPUNIT_ASSERT(pNormalItem->getType() == CNormalItem::CONSTANT);
2141 CPPUNIT_ASSERT(pNormalItem->getName() == "PI");
2142 
2143 delete pLogical;
2144 }
2145  */
ChoiceSetOfSets & getChoices()
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
static void cleanSetOfSets(TemplateSetOfSets< TYPE > &s)
bool multiply(const C_FLOAT64 &number)
virtual CNormalBase * copy() const
bool setRight(const CNormalFraction &right)
CNormalFraction & getLeft()
virtual bool simplify()
bool setLeft(const CNormalFraction &left)
bool setTrueExpression(const CNormalLogical &branch)
bool setFalseExpression(const CNormalLogical &branch)
static void cleanSet(const TemplateSet< TYPE > &s)
bool setCondition(const CNormalLogical &cond)
static void init(int argc, char *argv[], const bool &withGui=false)
CEvaluationNode * getRoot()
const std::set< CNormalProduct *, compareProducts > & getProducts() const
Definition: CNormalSum.cpp:416
virtual bool setInfix(const std::string &infix)
CNormalFraction & getRight()
ItemSetOfSets & getAndSets()