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

#ifndef CD_searchH
#define CD_searchH
//---------------------------------------------------------------------------


class CD_Search {
    private:
        PLA *source;                 // source PLA. Must not be modified
        //list<CubeList::iterator> u_F;                    // uncovered on-set. contains iterators to terms
        //list<CubeList::iterator> r_F;                    // reduced on-set. contains iterators to terms
        PLA *implpool;              // implicant pool. Here CD-Search feeds the result

        // CD-Search parameters

        unsigned int mutations;     // mutation rate. 0-100
        bool implcheck;             // candidate variables are restricted by implicant check
		bool all_PIs;				// put all the found PIs in the pool

        void Create_u_F( const unsigned int ov );          // creates uncovered on-set

		TermQueue * tq_cds_ie, * tq_ie_gom;
		int iterations;
		bool useIE;

    public:
		CD_Search( PLA *_pla, PLA *_implpool, int iterations, TermQueue * tq, TermQueue * tq2, bool useIE );		// source and implpool must be initiated
        //~CD_Search(void);

		void SetMutations( const unsigned int m ) { mutations = m; };
        void Run(void);

};


#endif
