#ifndef _TPTP_PARSER_
#define _TPTP_PARSER_ 
#include "array.h"
#include "clause.h"
#include "ohash.h"
#include "memory.h"
#include "misc.h"
#include <stdint.h>
#include "tptp.h"
typedef struct TPTP_PARSERSTATE_HELP {
  MEMORY memory;
  ARRAY tokens;
  ARRAY deadTokens;
  unsigned pos;
  SYMBSTATE symbstate;
  TERMSTATE termstate;
  FOLSTATE folstate;
  SUBSTSTATE sstate;
  OHASH namehash;
  SYMBOL foltype;
  ARRAY predicates;
  ARRAY folconstants;
  ARRAY folfunctions;
  ARRAY ariconstants;
  ARRAY vartypes;
  ARRAY distinctobjects;
  unsigned id;
  unsigned inputlits;
  ARRAY gclauses;
  ARRAY tpatterns;
  ARRAY cpatterns;
  BOOL has_equality;
} TPTP_PARSESTATE_NODE, *TPTP_PARSESTATE;
typedef struct TPTP_FOF_PARSED {
  ARRAY conjectures;
  ARRAY otherterms;
  ARRAY distinctobjects;
} TPTP_FOF_PARSED_NODE, *TPTP_FOF_PARSED;
void tptparse_StateSetNamehash(TPTP_PARSESTATE, OHASH);
OHASH tptparse_StateGetNamehash(TPTP_PARSESTATE);
unsigned tptparse_StateGetId(TPTP_PARSESTATE);
unsigned tptparse_StateGetNextIncrementId(TPTP_PARSESTATE);
unsigned tptparse_StateGetNumberInputLits(TPTP_PARSESTATE);
ARRAY tptparse_StateGetPredicates(TPTP_PARSESTATE);
void tptparse_StateSetPredicates(TPTP_PARSESTATE, ARRAY);
ARRAY tptparse_StateGetFolConstants(TPTP_PARSESTATE);
void tptparse_StateSetFolConstants(TPTP_PARSESTATE, ARRAY);
void tptparse_StateSetFolFunctions(TPTP_PARSESTATE, ARRAY);
ARRAY tptparse_StateGetFolFunctions(TPTP_PARSESTATE);
TPTP_PARSESTATE tptparse_Init(FOLSTATE, SUBSTSTATE, SYMBOL, OHASH);
MEMORY tptparse_StateGetMemory(TPTP_PARSESTATE);
void tptparse_Delete(TPTP_PARSESTATE);
void tptparse_FreeFofParsed(MEMORY mem, TPTP_FOF_PARSED);
void tptparse_DeleteFofParsed(MEMORY mem, TERMSTATE, TPTP_FOF_PARSED);
ARRAY tptparse_ReadF(FILE*, TPTP_PARSESTATE, char*);
TPTP_FOF_PARSED tptparse_ReadFoFormula(FILE* Pfile, TPTP_PARSESTATE Parsstate, char* file_path);
ARRAY tptparse_ParseFile(TPTP_PARSESTATE Parsstate, FILE* FilePtr, char* FilePath);
#endif
