//---------------------------------------------------------------------------

#ifndef CoverH
#define CoverH
//---------------------------------------------------------------------------

#include "CovMatrix.h"

typedef enum {LCMC, Aura, Lag, BBLag} CP_method;


class Cover {
    private:
        PLA *source;                 // source PLA. Must not be modified
        PLA *implpool;              // implicant pool. Here Cover processes the pool
		CP_method method;

		list<unsigned int> *Solve( CovMatrix *CM );		// select the solver by the method
		TermQueue * tq_ie_gom, * tq_gom_ra, * tq_ir_rabc;
		vector<Term *> implptrs;
		

    public:
        Cover( PLA *_source, PLA *_implpool, TermQueue * tq_ie_gom, TermQueue * tq_gom_ra, TermQueue * tq_ir_rabc);
        //~Cover(void) {};
        void GenerateOM(void);			// Generates OM values in the implicant pool (only from void "~" values)
		void RemoveAbsorbedByCover(void);					// removes absorbed terms by comparing their covers
		void GenerateCoverVector( Term &t );
		void GenerateCoverVectors(void);
		void GenerateCoverVectors(PLA &pla);

		PLA *Run(void);							// Runs the CP. Returns new PLA as a solution
		void Sparse_output( PLA *pla );		// Removes unnecessary 1's from the output matrix

		void SetMethod( const CP_method m ) { method = m; };
};
#endif
