public BooleanFunction(int variableCount, int formulaDepth)
        {
            this.variableCount = variableCount;
            BooleanFormula formula = BooleanFormula.DepthBoundedRandomBooleanFormula(formulaDepth, variableCount);

            formulas = new BooleanFormulaSet();
            formulas.Add(formula);
            this.vector = formula.FormulaValues();
        }
 public BooleanFunction(int variableCount, bool keepsZero, bool keepsOne)
 {
     this.variableCount = variableCount;
     formulas           = new BooleanFormulaSet();
     do
     {
         this.vector = BooleanVector.RandomBooleanVector(1 << variableCount);
     }while ((!keepsZero && KeepsConstantZero()) || (keepsZero && !KeepsConstantZero()) ||
             (!keepsOne && KeepsConstantOne()) || (keepsOne && !KeepsConstantOne()));
 }
 public BooleanFunction(int variableCount, bool notSelfAdjoint, bool notLinear, bool notMonotone)
 {
     this.variableCount = variableCount;
     formulas           = new BooleanFormulaSet();
     do
     {
         this.vector = BooleanVector.RandomBooleanVector(1 << variableCount);
     }while ((notSelfAdjoint && IsSelfAdjoint()) || (notLinear && IsLinear()) ||
             (notMonotone && IsMonotone()));
 }
 public BooleanFunction(int variableCount, bool selfAdjoint, bool linear, bool monotone, bool balanced)
 {
     this.variableCount = variableCount;
     formulas           = new BooleanFormulaSet();
     do
     {
         this.vector = BooleanVector.RandomBooleanVector(1 << variableCount);
     }while ((selfAdjoint && !IsSelfAdjoint()) || (linear && !IsLinear()) ||
             (monotone && !IsMonotone()) || (balanced && !IsBalanced()));
 }
 public BooleanFunction(int variableCount)
 {
     this.variableCount = variableCount;
     formulas           = new BooleanFormulaSet();
     this.vector        = BooleanVector.RandomBooleanVector(1 << variableCount);
 }
        //public BooleanFunction(bool[] vector)
        //{
        //    this.variableCount = (int)Math.Log(vector.Length, 2);
        //    formulas = new BooleanFormulaSet();
        //    this.vector = (bool[])vector.Clone();
        //}

        public BooleanFunction(params bool[] vector)
        {
            this.variableCount = (int)Math.Log(vector.Length, 2);
            formulas           = new BooleanFormulaSet();
            this.vector        = (bool[])vector.Clone();
        }