]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
removed ASTUtil.h and merged with UsefulDefs.h
authorvijay_ganesh <vijay_ganesh@e59a4935-1847-0410-ae03-e826735625c1>
Mon, 12 Oct 2009 20:58:21 +0000 (20:58 +0000)
committervijay_ganesh <vijay_ganesh@e59a4935-1847-0410-ae03-e826735625c1>
Mon, 12 Oct 2009 20:58:21 +0000 (20:58 +0000)
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@297 e59a4935-1847-0410-ae03-e826735625c1

src/AST/ASTUtil.cpp
src/AST/ASTUtil.h [deleted file]
src/AST/UsefulDefs.h

index 48e32f7c1c57227ac7a93a4c138f9a8452b08ac1..09898021cebe4b15b7ef2e57c09a9d9032a4521a 100644 (file)
@@ -7,7 +7,7 @@
  ********************************************************************/
 // -*- c++ -*-
 
-#include "ASTUtil.h"
+#include "UsefulDefs.h"
 #include "../main/Globals.h"
 namespace BEEV
 {
@@ -40,8 +40,13 @@ namespace BEEV
         if (!strcmp(functionname, "print_func_stats"))
           {
             cout << endl;
-            for (function_counters::iterator it = s.begin(), itend = s.end(); it != itend; it++)
-              cout << "Number of times the function: " << it->first << ": is called: " << it->second << endl;
+            for (function_counters::iterator 
+                  it = s.begin(), itend = s.end(); 
+                it != itend; it++)
+              cout << "Number of times the function: " 
+                  << it->first 
+                  << ": is called: " 
+                  << it->second << endl;
             return;
           }
         s[functionname] += 1;
diff --git a/src/AST/ASTUtil.h b/src/AST/ASTUtil.h
deleted file mode 100644 (file)
index e69aa59..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/********************************************************************
- * AUTHORS: Vijay Ganesh
- *
- * BEGIN DATE: November, 2005
- *
- * LICENSE: Please view LICENSE file in the home dir of this Program
- ********************************************************************/
-// -*- c++ -*-
-
-#ifndef ASTUTIL_H
-#define ASTUTIL_H
-
-#include <iostream>
-#include <vector>
-#include <cstring>
-
-#ifdef EXT_HASH_MAP
- #include <ext/hash_set>
- #include <ext/hash_map>
-#elif defined(TR1_UNORDERED_MAP)
- #include <tr1/unordered_map>
- #include <tr1/unordered_set>
-#else
- #include <hash_set>
- #include <hash_map>
-#endif
-
-#define HASHMAP      hash_map
-#define HASHSET      hash_set
-#define HASHMULTISET hash_multiset
-
-using namespace std;
-namespace BEEV {
-#ifdef EXT_HASH_MAP
-  using namespace __gnu_cxx;
-#endif
-
-  extern void (*vc_error_hdlr)(const char* err_msg);
-  /*Spacer class is basically just an int, but the new class allows
-    overloading of << with a special definition that prints the int as
-    that many spaces. */
-  class Spacer {
-  public:
-    int _spaces;
-    Spacer(int spaces) { _spaces = spaces; }
-    friend ostream& operator<<(ostream& os, const Spacer &ind);
-  };
-
-  inline Spacer spaces(int width) {
-    Spacer sp(width);
-    return sp;
-  }
-
-  struct eqstr {
-    bool operator()(const char* s1, const char* s2) const {
-      return strcmp(s1, s2) == 0;
-    }
-  };
-
-  // Table for storing function count stats.
-#ifdef TR1_UNORDERED_MAP
-  typedef tr1::unordered_map<
-    const char*,
-    int,
-    tr1::hash<const char *>,
-    eqstr> function_counters;
-#else
-  typedef HASHMAP<
-    const char*,
-    int,
-    hash<char *>,
-    eqstr> function_counters;
-#endif
-
-  void CountersAndStats(const char * functionname);
-}; // end namespace.
-#endif
index 473cad82a5bf43b4f75f3998a8421955da3b5cd1..b6e50eb66362625487988f56bbfec029f9ff89b0 100644 (file)
 #include <algorithm>
 #include <assert.h>
 
-#define  INITIAL_TABLE_SIZE 100
+#include "../main/Globals.h"
+#include "ASTKind.h"
+#include "../extlib-constbv/constantbv.h"
+#include "RunTimes.h"
 
 #ifdef EXT_HASH_MAP
  #include <ext/hash_set>
  #include <hash_map>
 #endif
 
-#include "../main/Globals.h"
-#include "ASTUtil.h"
-#include "ASTKind.h"
-#include "../extlib-constbv/constantbv.h"
-#include "RunTimes.h"
-
 #define HASHMAP      hash_map
 #define HASHSET      hash_set
 #define HASHMULTISET hash_multiset
+#define  INITIAL_TABLE_SIZE 100
 
 namespace BEEV {
-
   using namespace std;
   using namespace MINISAT;
 #ifdef EXT_HASH_MAP
@@ -77,6 +74,55 @@ namespace BEEV {
   typedef vector<ASTNode> ASTVec;
   typedef unsigned int * CBV;
   extern ASTVec _empty_ASTVec;
+
+  // Error handling function
+  extern void (*vc_error_hdlr)(const char* err_msg);
+  
+  /******************************************************************
+   * Class Spacer: 
+   *
+   * Spacer class is basically just an int, but the new class allows
+   * overloading of << with a special definition that prints the int
+   * as that many spaces.
+   ******************************************************************/
+  class Spacer {
+  public:
+    int _spaces;
+    Spacer(int spaces) 
+    { 
+      _spaces = spaces; 
+    }
+    friend ostream& operator<<(ostream& os, const Spacer &ind);
+  }; //End of class spacer
+
+  inline Spacer spaces(int width) {
+    Spacer sp(width);
+    return sp;
+  }
+
+  struct eqstr {
+    bool operator()(const char* s1, const char* s2) const {
+      return strcmp(s1, s2) == 0;
+    }
+  };
+
+  // function_counters: Table for storing function count stats.
+#ifdef TR1_UNORDERED_MAP
+  typedef tr1::unordered_map<
+    const char*,
+    int,
+    tr1::hash<const char *>,
+    eqstr> function_counters;
+#else
+  typedef HASHMAP<const char*,
+    int,
+    hash<char *>,
+    eqstr> function_counters;
+#endif
+
+  // Function that computes various kinds of statistics for the phases
+  // of STP
+  void CountersAndStats(const char * functionname);
 }; //end of namespace
 
 #endif