예제 #1
0
        public override void ToSMTConstraints(Context z3Context, Solver z3Solver, int maxNumVars, VariableCache variableGenerator)
        {
            this.constraintVariable = variableGenerator.GetFreshVariableName();
            ArithExpr myVariable = z3Context.MkIntConst(this.constraintVariable);

            z3Solver.Assert(z3Context.MkLe(z3Context.MkInt(0), myVariable));
            z3Solver.Assert(z3Context.MkLe(myVariable, z3Context.MkInt(1)));
            this.condition.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
        }
예제 #2
0
        public override void ToSMTConstraints(Context z3Context, Solver z3Solver, int maxNumVars, VariableCache variableGenerator)
        {
            /* constraint variable in { 0, 1 }
             * 0 -> increment
             * 1 -> decrement
             */
            this.constraintVariable = variableGenerator.GetFreshVariableName();
            ArithExpr myVariable = z3Context.MkIntConst(this.constraintVariable);

            z3Solver.Assert(z3Context.MkLe(z3Context.MkInt(0), myVariable));
            z3Solver.Assert(z3Context.MkLe(myVariable, z3Context.MkInt(1)));
            this.arg.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
        }
예제 #3
0
        public override void ToSMTConstraints(Context z3Context, Solver z3Solver, int maxNumVars, VariableCache variableGenerator)
        {
            /* constraint variable in { 0, 1 }
             * 0 -> and
             * 1 -> or
             */
            this.constraintVariable = variableGenerator.GetFreshVariableName();
            ArithExpr myVariable = z3Context.MkIntConst(this.constraintVariable);

            z3Solver.Assert(z3Context.MkLe(z3Context.MkInt(0), myVariable));
            z3Solver.Assert(z3Context.MkLe(myVariable, z3Context.MkInt(Enum.GetNames(typeof(WCCompound.Logic)).Length - 1)));
            this.cond1.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
            this.cond2.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
        }
예제 #4
0
        public override void ToSMTConstraints(Context z3Context, Solver z3Solver, int maxNumVars, VariableCache variableGenerator)
        {
            /* constraint variable in { 0, ..., 5 }
             * -> eq, l, leq, neq, g, geq
             */

            this.constraintVariable = variableGenerator.GetFreshVariableName();
            ArithExpr myVariable = z3Context.MkIntConst(this.constraintVariable);

            z3Solver.Assert(z3Context.MkLe(z3Context.MkInt(0), myVariable));
            z3Solver.Assert(z3Context.MkLe(myVariable, z3Context.MkInt(Enum.GetNames(typeof(WCComparison.CompareType)).Length - 1)));
            this.arg1.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
            //Currently, arg2 may be concretized to a 0 constant, possibly resulting in an '== 0' or '!= 0' condition, which is a simple condition.
            this.arg2.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
        }
예제 #5
0
        public override void ToSMTConstraints(Context z3Context, Solver z3Solver, int maxNumVars, VariableCache variableGenerator)
        {
            /* constraint variable in { 0, 1 }
             * 0 -> plus
             * 1 -> minus
             */
            this.constraintVariable = variableGenerator.GetFreshVariableName();
            ArithExpr myVariable = z3Context.MkIntConst(this.constraintVariable);

            z3Solver.Assert(z3Context.MkLe(z3Context.MkInt(0), myVariable));
            z3Solver.Assert(z3Context.MkLe(myVariable, z3Context.MkInt(Enum.GetNames(typeof(WEArith.ArithOp)).Length - 1)));
            this.lhs.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
            this.arg1.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
            this.arg2.ToSMTConstraints(z3Context, z3Solver, maxNumVars, variableGenerator);
        }