solver/UnsatCoreFinder.h
00001 /*
00002  * UnsatCoreFinder.h
00003  *
00004  *  Created on: Jun 24, 2009
00005  *      Author: isil
00006  */
00007 
00008 #ifndef UNSATCOREFINDER_H_
00009 #define UNSATCOREFINDER_H_
00010 
00011 class CNode;
00012 
00013 #include <set>
00014 using namespace std;
00015 
00016 class UnsatCoreFinder {
00017 private:
00018         CNode* orig_node;
00019         CNode* unsat_core;
00020 
00021         int num_queries;
00022         CNode* most_difficult_clause;
00023         int diff_clause_time;
00024         int total_time;
00025 
00026         int start_time;
00027 
00028         /*
00029          * The set of literals whose truth assignments
00030          * are already fixed. We keep track of these because
00031          * we don't want to take these into account when minimizing.
00032          * For example, suppose we have the clause whose
00033          * boolean abstraction is B1 & !B2 & B3
00034          * If B1 *must* be assigned to true,
00035          * then we want to minimize !B2 & B3, taking B1
00036          * into account when making the clause_sat query.
00037          */
00038         const set<CNode*>& must_assignments;
00039 
00040 public:
00041         UnsatCoreFinder(CNode* c, set<CNode*>& must_assignments);
00042         CNode* get_unsat_core();
00043         virtual ~UnsatCoreFinder();
00044 private:
00045         CNode* find_unsat_core(CNode* assumption, CNode* c);
00046         void begin_query();
00047         void end_query(CNode* clause);
00048 };
00049 
00050 #endif /* UNSATCOREFINDER_H_ */