proofDisproof.cc Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
proofDisproof.cc
Go to the documentation of this file.
1 #include "osl/checkmate/proofDisproof.h"
2 #include <boost/static_assert.hpp>
3 #include <iostream>
4
5 void osl::checkmate::
6 ProofDisproof::testConsistency()
7 {
8 BOOST_STATIC_ASSERT((ProofDisproof::BigProofNumber > ProofDisproof::PAWN_CHECK_MATE_PROOF));
9 BOOST_STATIC_ASSERT((ProofDisproof::NO_CHECK_MATE_PROOF > ProofDisproof::PAWN_CHECK_MATE_PROOF));
10 }
11
12 std::ostream& osl::checkmate::
13 operator<<(std::ostream& os, const ProofDisproof& pdp)
14 {
15 if (pdp == ProofDisproof::Checkmate())
16 os << "Checkmate";
17 else if (pdp == ProofDisproof::NoEscape())
18 os << "NoEscape";
19 else if (pdp == ProofDisproof::NoCheckmate())
20 os << "NoCheckmate";
21 else if (pdp == ProofDisproof::PawnCheckmate())
22 os << "PawnCheckmate";
23 else if (pdp == ProofDisproof::LoopDetection())
24 os << "LoopDetection";
25 else if (pdp == ProofDisproof::AttackBack())
26 os << "AttackBack";
27 else
28 os << "pdp-" << pdp.proof() << "," << pdp.disproof();
29 return os;
30 }
31
32 /* ------------------------------------------------------------------------- */
33 // ;;; Local Variables:
34 // ;;; mode:c++
35 // ;;; c-basic-offset:2
36 // ;;; End: