#ifndef _CFGC_API_H
#define _CFGC_API_H

#include <ilsolver/ilosolverint.h>

#include "grammar_api.h"

class cfgc_api
{
	public:
		
		// Constructor
		explicit cfgc_api(const grammar_api*cfg, IloSolver solver, IloIntVarArray varArray, const int numVar, const bool incremental, const int id);
		
		// Destructor
		~cfgc_api();

		// Create a restore point
		void setMarker();
		
		// Call constraint propagation
		bool propagate();
		
		// Store the affected variables
		void variableAffected(int i);
		
		// Go back to the last restore point
		void backtrack();
		
		// Return the variables array
		IloIntVarArray getVarArray();
			
	private:
		
		// Context-free grammar constraint
		void* cfgc;
};

#endif
