Fix snapshot code
[model-checker.git] / scanalysis.h
index 047793045e63c954b03b775fd433738aaf8d08d7..23d127bf686748d8b36589149e44384045e4ea1e 100644 (file)
@@ -3,24 +3,38 @@
 #include "traceanalysis.h"
 #include "hashtable.h"
 
+struct sc_statistics {
+       unsigned long long elapsedtime;
+       unsigned int sccount;
+       unsigned int nonsccount;
+       unsigned long long actions;
+};
+
 class SCAnalysis : public TraceAnalysis {
  public:
-       SCAnalysis(const ModelExecution *execution);
+       SCAnalysis();
        ~SCAnalysis();
+       virtual void setExecution(ModelExecution * execution);
        virtual void analyze(action_list_t *);
+       virtual const char * name();
+       virtual bool option(char *);
+       virtual void finish();
+
 
        SNAPSHOTALLOC
  private:
+       void update_stats();
        void print_list(action_list_t *list);
-       void buildVectors(action_list_t *);
+       int buildVectors(action_list_t *);
        bool updateConstraints(ModelAction *act);
        void computeCV(action_list_t *);
        action_list_t * generateSC(action_list_t *);
        bool processRead(ModelAction *read, ClockVector *cv);
-       ModelAction * getNextAction();
+       int getNextActions(ModelAction **array);
        bool merge(ClockVector *cv, const ModelAction *act, const ModelAction *act2);
        void check_rf(action_list_t *list);
-
+       void reset(action_list_t *list);
+       ModelAction* pruneArray(ModelAction**, int);
 
        int maxthreads;
        HashTable<const ModelAction *, ClockVector *, uintptr_t, 4 > cvmap;
@@ -28,6 +42,11 @@ class SCAnalysis : public TraceAnalysis {
        HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4 > badrfset;
        HashTable<void *, const ModelAction *, uintptr_t, 4 > lastwrmap;
        SnapVector<action_list_t> threadlists;
-       const ModelExecution *execution;
+       ModelExecution *execution;
+       bool print_always;
+       bool print_buggy;
+       bool print_nonsc;
+       bool time;
+       struct sc_statistics *stats;
 };
 #endif