コード例 #1
0
ファイル: FddKernel.cs プロジェクト: sorenjuul/bddsharp
        /// <summary>
        /// restricts an FDD out of an expression, by giving it an integer value.
        /// </summary>
        /// <param name="root">the root of the tree the Fdd is a part of</param>
        /// <param name="fdd">the Fdd to restrict</param>
        /// <param name="restrictValue">the given ristrict value, must be between 0 and maxvalue of the Fdd.</param>
        /// <returns>the restricted Bdd</returns>
        public static Bdd Restrict(Bdd root, Fdd fdd, int restrictValue)
        {
            bool[] B = ToBitPattern(restrictValue);

            for (int i = 0; i < B.Length; i++)
            {
                root = Kernel.Restrict(root, fdd.Var + i, B[i]);
            }

            RestrictDictionary.Add(fdd.Var, restrictValue);

            return(root);
        }