#ifndef _META_
#define _META_ 
#include "array.h"
#include "clause.h"
#include "memory.h"
#include "sharing.h"
#include "twfo.h"
#include "term.h"
#include "upqueue.h"
#include "state.h"
#include "hlmodgrow.h"
#include "hlcl.h"
typedef enum {
  META_NONE,
  META_LMODEL_GROW,
  META_LCL
} METAHEUR;
typedef struct METASTATE_HELP {
  SCLSTATE sclstate;
  TWFO twfo;
  MEMORY memory;
  SYMBSTATE symbstate;
  TERMSTATE termstate;
  FOLSTATE folstate;
  SUBSTSTATE sstate;
  UPQUEUE thetaupq;
  DISTRN thetaindex;
  DISTRN lambdaindex;
  ARRAY delta;
  unsigned size;
  METAHEUR actheur;
  HLMDGSTATE lmodgrow;
  HLCLSTATE hlcl;
} METASTATE_NODE,*METASTATE;
ARRAY meta_GetDelta(METASTATE);
void meta_SetDelta(METASTATE, ARRAY);
unsigned meta_GetSize(METASTATE);
void meta_SetSize(METASTATE, unsigned);
unsigned meta_GetNumberActiveAtoms(METASTATE);
void meta_AddClause(void);
METASTATE meta_Create(SCLSTATE, TWFO, METAHEUR);
void meta_Delete(METASTATE);
TERM meta_SelectNextTrailLiteral(SCLSTATE,METASTATE,TRAIL, TWFO);
BOOL meta_PerformReduction(SCLSTATE,METASTATE);
BOOL meta_PerformSATTest(SCLSTATE,METASTATE);
BOOL meta_PerformSATAbstraction(SCLSTATE,METASTATE);
BOOL meta_ExtendActiveLiterals(SCLSTATE,METASTATE,TRAIL,TWFO, BOOL*);
void meta_UpdateLearnedClause(SCLSTATE, METASTATE, TRAIL, CLAUSE, SUBST);
void meta_UpdateBacktrack(SCLSTATE, METASTATE, TRAIL, TWFO, unsigned);
void meta_UpdateNewResolution(SCLSTATE, METASTATE, TERM, CLAUSE, SUBST, ARRAY);
void meta_UpdateRestart(SCLSTATE, METASTATE, TRAIL, TWFO);
void meta_UpdateReduction(SCLSTATE, METASTATE, TRAIL, TWFO);
METAHEUR meta_PickHeuristic(SCLSTATE);
void meta_Print(METASTATE);
void meta_PrintStat(METASTATE);
#endif
