示例#1
0
        public static MjuFormula ExistTrans(MjuFormula formula)
        {
            if (formula == null)
                throw new ArgumentNullException ("formula");

            return new MjuFormula (formula, null, MjuOperator.MJU_EXISTS, null);
        }
示例#2
0
 private MjuFormula(MjuFormula left, MjuFormula right, MjuOperator op, string name)
 {
     this.Left = left;
     this.Right = right;
     this.Operator = op;
     this.Name = name;
 }
示例#3
0
        public static MjuFormula And(MjuFormula left, MjuFormula right)
        {
            if (left == null)
                throw new ArgumentNullException ("left");

            if (right == null)
                throw new ArgumentNullException ("right");

            return new MjuFormula (left, right, MjuOperator.LOGIC_AND, null);
        }
示例#4
0
        public static MjuFormula LeastFixedPoint(MjuFormula formula, string var)
        {
            if (formula == null)
                throw new ArgumentNullException ("formula");

            if (var == null)
                throw new ArgumentNullException ("var");

            return new MjuFormula (formula, Var (var), MjuOperator.MJU_LFP, null);
        }
示例#5
0
        public static MjuFormula Not(MjuFormula formula)
        {
            if (formula == null)
                throw new ArgumentNullException ("formula");

            switch (formula.Operator) {
                case MjuOperator.TRUE :
                    return FALSE;
                case MjuOperator.FALSE :
                    return TRUE;
                case MjuOperator.LOGIC_NOT :
                    return formula.Left;
                case MjuOperator.LOGIC_AND :
                    return new MjuFormula (Not (formula.Left), Not (formula.Right), MjuOperator.LOGIC_OR, null);
                case MjuOperator.LOGIC_OR :
                    return new MjuFormula (Not (formula.Left), Not (formula.Right), MjuOperator.LOGIC_AND, null);
                case MjuOperator.MJU_ALL :
                    return ExistTrans (Not (formula.Left));
                case MjuOperator.MJU_EXISTS :
                    return AllTrans (Not (formula.Left));
                case MjuOperator.MJU_LFP :
                    return GreatestFixedPoint (Not (formula.Left), formula.Right.Name);
                case MjuOperator.MJU_GFP :
                    return LeastFixedPoint (Not (formula.Left), formula.Right.Name);
                case MjuOperator.VARIABLE :
                    return formula;
                default :
                    return new MjuFormula (formula, null, MjuOperator.LOGIC_NOT, null);
            }
        }