#ifndef __ASSIGNMENT_H__ #define __ASSIGNMENT_H__ //----------------------------------------------------------------------------- // class Assignment // Encapsulates the assignments to a CNF formula and the operations // one might want to perform on such an assignment //----------------------------------------------------------------------------- class Assignment { protected: int iNumVariables; // Number of variables in the assignment bool* pAssignment; // The assignment bool bValid; // True if the assignment is a valid one public: // Constructor/Destructor Assignment( int numVariables ); ~Assignment(); // Returns the number of variables in the assignment int NumVariables() { return this->iNumVariables; } // Get/Set Valid Bit for the assignment void SetValid( bool value ) { this->bValid = value; } bool GetValid(void) { return this->bValid; } // Get/Set a Value for a variable void SetValue( int varNum, bool value ); bool GetValue( int varNum ); // Prints this assignment out void Print(); }; #endif