예제 #1
0
        /// <summary>
        /// Contructor of formula that corresponds the double value
        /// </summary>
        /// <param name="level">the level</param>
        /// <param name="sizes">the array of different level symbols' sizes</param>
        /// <param name="a">the value</param>
        public MathFormula(byte level, int[] sizes, bool a)
            : this(level, sizes)
        {
            MathSymbol s = new SimpleSymbol('?', (byte)FormulaConstants.Number, false);

            s.Append(this);
            First.BoolValue = a;
        }
예제 #2
0
        /// <summary>
        /// Creates formula
        /// </summary>
        /// <param name="tree">Operation tree</param>
        /// <param name="level">Formula level</param>
        /// <param name="sizes">Sizes of symbols</param>
        /// <returns>The formula</returns>
        public MathFormula CreateFormula(ObjectFormulaTree tree, byte level, int[] sizes)
        {
            MathFormula form = new MathFormula(level, sizes);
            MathFormula f    = new MathFormula(level, sizes);
            MathSymbol  sym  = new SimpleSymbol('¬', (byte)FormulaConstants.Unary, false, "¬");

            sym.Append(form);
            sym = new BracketsSymbol();
            sym.Append(form);
            form.Last[0] = FormulaCreator.CreateFormula(tree[0], level, sizes);
            return(form);
        }