//---------------------------------------------------------------------------
#ifndef tpfnctH
  #define tpfnctH
//---------------------------------------------------------------------------
struct TCovs;
class TBoolFnct;
//---------------------------------------------------------------------------
class TPfnct
{
public:
  char * iv;       // input vector. '0', '1', '-'. Zero terminated string.
  char * ov;       // output vector. '0', '1', '-', '~'. Zero terminated string.
  int dim;         // dimension ( = # of DCs in iv). May not be always valid. -1 = unknown
  TPfnct * next;   // next term
  int valid;       // 1,0. Temporary!
  TCovs * cov;     // which parent on-terms are covered by this term
  int covlen;      // # of cov entries
  int * covfield;  // field of encoded covered parent on-terms
  int dvar;
  int essential;
  int tmp;
  int tmp2;
  int cvd;
  int prime;       // 1 = prime, 0 = non-prime, 2 = not decided
  int origin;      // bit 0 - generated by CD-S, bit 1 - generated by FC-min
  int index;       // index in TBoolFnct->index
public:
  TPfnct();
  TPfnct& operator=(TPfnct&);
  TPfnct(TBoolFnct *_parent, char *_iv, char *_ov, int _tdim);
  ~TPfnct();
  void DeleteCovs();
  int CountPrimes();
  int CountFCs();
  int CountCommons();
  int CountUnknowns();
  void CountDim(int inpvars);
};
//---------------------------------------------------------------------------
TCovs * DuplCov( TCovs * c );
char * JoinCubes( char * c1, char * c2, int len );
int Contains( char * c1, char * c2, int len );
int Intersects( char * c1, char * c2, int len );
int CountHamming( char * c1, char * c2, int len );
int CountPrimes( TPfnct * ff );
int CountFCs( TPfnct * ff );
int CountCommons( TPfnct * ff );

//---------------------------------------------------------------------------
#endif
