Exemple #1
0
 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()));
 }
Exemple #2
0
 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()));
 }
Exemple #3
0
 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()));
 }
Exemple #4
0
 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();
 }
Exemple #5
0
 public BooleanFunction(int variableCount)
 {
     this.variableCount = variableCount;
     formulas = new BooleanFormulaSet();
     this.vector = BooleanVector.RandomBooleanVector(1 << variableCount);
 }
Exemple #6
0
        //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();
        }
 public void SetNewBooleanFormula(BooleanFormula formula)
 {
     formulas = new BooleanFormulaSet();
     formulas.Add(formula);
     this.vector = formula.FormulaValues();
 }