#ifdef STATISTICS
#include "Behavioural/include/Stat_binary_tree.h"

namespace morpheo {
namespace behavioural {
  bool Stat_binary_tree::valid (void)
  {
    if ((_data_type == VARIABLE) or
	(_data_type == CONSTANT))
      return ((_left  == NULL) and
	      (_right == NULL) );

    if (_data_type == OPERATOR_UNARY)
      return ((_right == NULL) and
	      (_left  != NULL) and
	      (_left->valid()));

    if (_data_type == OPERATOR_BINARY)
      return ((_left  != NULL ) and
	      (_left ->valid()) and
	      (_right != NULL ) and
	      (_right->valid()));

    return false;
  }
};
};
#endif
