00001
00002
00003 #ifndef _CHECKTABLEANALYZER_H
00004 #define _CHECKTABLEANALYZER_H
00005
00006 #include <iosfwd>
00007 #include <cstddef>
00008 namespace osl
00009 {
00010 namespace hash
00011 {
00012 class HashKey;
00013 }
00014 class PathEncoding;
00015 namespace checkmate
00016 {
00017 class CheckHashRecord;
00018 class TwinTable;
00019 namespace analyzer
00020 {
00021 using hash::HashKey;
00029 class CheckTableAnalyzer
00030 {
00031 const TwinTable& table;
00032 bool useOutlineFormat;
00033 public:
00034 explicit CheckTableAnalyzer(const TwinTable&, bool outline=true);
00035 ~CheckTableAnalyzer();
00036
00040 void showTree(const CheckHashRecord *record, std::ostream& os,
00041 int maxDepth, bool expandFinalState=true,
00042 bool showTerminalMoves=false, size_t threshold=0) const;
00046 size_t treeSize(const CheckHashRecord *record) const;
00050 size_t proofTreeSize(const CheckHashRecord *record,
00051 const HashKey& key,
00052 const PathEncoding& path,
00053 bool orNode) const;
00054 size_t proofTreeSize(const CheckHashRecord *record,
00055 const HashKey& key,
00056 const PathEncoding& path,
00057 bool orNode, size_t &leaf_size) const;
00061 size_t disproofTreeSize(const CheckHashRecord *record,
00062 const HashKey& key,
00063 const PathEncoding& path,
00064 bool orNode, bool isPartialStack=false) const;
00065 size_t disproofTreeSize(const CheckHashRecord *record,
00066 const HashKey& key,
00067 const PathEncoding& path,
00068 bool orNode, size_t& leaf_size,
00069 bool isPartialStack=false) const;
00073 size_t proofOrDisproofTreeSize(const CheckHashRecord *record,
00074 const HashKey& key,
00075 const PathEncoding& path,
00076 bool orNode, bool isPartialStack=false) const;
00077 size_t proofOrDisproofTreeSize(const CheckHashRecord *record,
00078 const HashKey& key,
00079 const PathEncoding& path,
00080 bool orNode, size_t& leaf_size,
00081 bool isPartialStack=false) const;
00082
00086 size_t showProofTree(const CheckHashRecord *record,
00087 const HashKey& key, const PathEncoding& path,
00088 bool orNode, std::ostream& os,
00089 bool isPartialStack=false) const;
00090 };
00091 }
00092 }
00093 using checkmate::analyzer::CheckTableAnalyzer;
00094 }
00095
00096 #endif
00097
00098
00099
00100