//---------------------------------------------------------------------------
#ifndef decompH
  #define decompH
//---------------------------------------------------------------------------
struct DecompAss
{
  char * * inps; // input wires assignment [block][input] = N, 1, F, R
  int * outs; // outputs assignment [output] = block no.
  int * icnt; // number of assigned inputs in [block]
  int * ocnt; // number of assigned outputs in [block]
  char * outforced; // forced output to block [output] = N, F
  int blocks; // # of block defined (should be equal to MinOpts)
};
//---------------------------------------------------------------------------
struct DecompositionOptions
{
  int blocks;
  int * inps;
  int * outs;
};
//---------------------------------------------------------------------------
class TBoolFnct;
//---------------------------------------------------------------------------
int SaveBDF( char * fn, DecompositionOptions * dopts );
int LoadBDF( char * fn, DecompositionOptions * dopts );
void InitDecompAss( TBoolFnct * fn, int blocks );
void DestroyDecompAss( TBoolFnct * fn );
void UpdateDecompAss( TBoolFnct * fn, DecompositionOptions * dopts );
int CountAssignment( TBoolFnct * fn );
void CleanInpAssignment( TBoolFnct * fn );
void CleanOutAssignment( TBoolFnct * fn );
void CleanAssignment( TBoolFnct * fn );
void CountInpOuts( TBoolFnct * fn );
void SaveDecompAss( TBoolFnct * fn, char * filn );
int LoadDecompAss( TBoolFnct * fn, char * filn, DecompositionOptions * dopts );
int AssignValidOutputs( TBoolFnct * fn, DecompositionOptions * dopts );
int RandomAssignValidOutputs( TBoolFnct * fn, DecompositionOptions * dopts );
DecompAss * DuplicateDecompAss( TBoolFnct * fn, DecompositionOptions * dopts );
TBoolFnct * ExtractBlock( TBoolFnct * srcf, int b );
PartInfo GetPartinfo( TBoolFnct * fn, DecompositionOptions * dopts );
//---------------------------------------------------------------------------
#endif
