#ifndef _KBO_
#define _KBO_ 
#include "term.h"
#include "folsubst.h"
#include "fol.h"
#include "sorting.h"
typedef enum { kbo_UNCOMPARABLE,
        kbo_SMALLER_THAN,
        kbo_EQUAL,
        kbo_GREATER_THAN } kbo_RESULT;
typedef struct KBOSTATE_HELP {
  unsigned *varcount;
  unsigned minweight;
  TERMSTATE termstate;
  SYMBOL minconst;
} KBOSTATE_NODE,*KBOSTATE;
KBOSTATE kbo_Init(TERMSTATE, SYMBOL, unsigned, unsigned);
void kbo_Free(KBOSTATE);
void kbo_AdjustMaxVars(KBOSTATE, unsigned);
TERMSTATE kbo_GetTermstate(KBOSTATE);
SYMBOL kbo_GetMinConstant(KBOSTATE);
void kbo_SetMinConstant(KBOSTATE, SYMBOL);
void kbo_SetSimpleKBO(KBOSTATE);
kbo_RESULT kbo_Compare(KBOSTATE, TERM, TERM);
BOOL kbo_Smaller(KBOSTATE, TERM, TERM);
BOOL kbo_SmallerSubstContextGround(KBOSTATE, SUBSTSTATE, SUBST, TERM, TERM);
BOOL kbo_SmallerSubstGround(KBOSTATE, SUBSTSTATE, SUBST, TERM, TERM);
ARRAY kbo_SmallerTerms(KBOSTATE, ARRAY, TERM);
kbo_RESULT kbo_SymbolCountCompareShared(TERM, TERM);
BOOL kbo_SymbolCountSmallerEqualShared(TERM, TERM);
BOOL kbo_SymbolCountSmallerEqual(TERMSTATE, TERM, TERM);
#endif
