File: proofDisproof.cc

package info (click to toggle)
libosl 0.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 273,976 kB
  • sloc: cpp: 129,625; ansic: 7,145; ruby: 1,290; makefile: 558; perl: 413; sh: 35
file content (36 lines) | stat: -rw-r--r-- 1,106 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "osl/checkmate/proofDisproof.h"
#include <boost/static_assert.hpp>
#include <iostream>

void osl::checkmate::
ProofDisproof::testConsistency()
{
  BOOST_STATIC_ASSERT((ProofDisproof::BigProofNumber > ProofDisproof::PAWN_CHECK_MATE_PROOF));
  BOOST_STATIC_ASSERT((ProofDisproof::NO_CHECK_MATE_PROOF > ProofDisproof::PAWN_CHECK_MATE_PROOF));
}

std::ostream& osl::checkmate::
operator<<(std::ostream& os, const ProofDisproof& pdp)
{
  if (pdp == ProofDisproof::Checkmate())
    os << "Checkmate";
  else if (pdp == ProofDisproof::NoEscape())
    os << "NoEscape";
  else if (pdp == ProofDisproof::NoCheckmate())
    os << "NoCheckmate";
  else if (pdp == ProofDisproof::PawnCheckmate())
    os << "PawnCheckmate";
  else if (pdp == ProofDisproof::LoopDetection())
    os << "LoopDetection";
  else if (pdp == ProofDisproof::AttackBack())
    os << "AttackBack";
  else
    os << "pdp-" << pdp.proof() << "," << pdp.disproof();
  return os;
}

/* ------------------------------------------------------------------------- */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End: