// Terms
Term three_y = slv.mkTerm(MULT, three, y);
- Term diff = slv.mkTerm(MINUS, y, x);
+ Term diff = slv.mkTerm(SUB, y, x);
// Formulas
Term x_geq_3y = slv.mkTerm(GEQ, x, three_y);
// It is also possible to get values for compound terms,
// even if those did not appear in the original formula.
- Term xMinusY = solver.mkTerm(MINUS, x, y);
+ Term xMinusY = solver.mkTerm(SUB, x, y);
Term xMinusYVal = solver.getValue(xMinusY);
// We can now obtain the string representations of the values.
Term one = slv.mkInteger(1);
Term plus = slv.mkTerm(PLUS, start, start);
- Term minus = slv.mkTerm(MINUS, start, start);
+ Term minus = slv.mkTerm(SUB, start, start);
Term ite = slv.mkTerm(ITE, start_bool, start, start);
Term And = slv.mkTerm(AND, start_bool, start_bool);
// define the rules
Term zero = slv.mkInteger(0);
- Term neg_x = slv.mkTerm(UMINUS, x);
+ Term neg_x = slv.mkTerm(NEG, x);
Term plus = slv.mkTerm(PLUS, x, start);
// create the grammar object
// Terms
Term three_y = slv.mkTerm(Kind.MULT, three, y);
- Term diff = slv.mkTerm(Kind.MINUS, y, x);
+ Term diff = slv.mkTerm(Kind.SUB, y, x);
// Formulas
Term x_geq_3y = slv.mkTerm(Kind.GEQ, x, three_y);
// It is also possible to get values for compound terms,
// even if those did not appear in the original formula.
- Term xMinusY = solver.mkTerm(Kind.MINUS, x, y);
+ Term xMinusY = solver.mkTerm(Kind.SUB, x, y);
Term xMinusYVal = solver.getValue(xMinusY);
// Further, we can convert the values to java types
Term one = slv.mkInteger(1);
Term plus = slv.mkTerm(PLUS, start, start);
- Term minus = slv.mkTerm(MINUS, start, start);
+ Term minus = slv.mkTerm(SUB, start, start);
Term ite = slv.mkTerm(ITE, start_bool, start, start);
Term And = slv.mkTerm(AND, start_bool, start_bool);
// define the rules
Term zero = slv.mkInteger(0);
- Term neg_x = slv.mkTerm(UMINUS, x);
+ Term neg_x = slv.mkTerm(NEG, x);
Term plus = slv.mkTerm(PLUS, x, start);
// create the grammar object
# Terms
three_y = slv.mkTerm(Kind.Mult, three, y)
- diff = slv.mkTerm(Kind.Minus, y, x)
+ diff = slv.mkTerm(Kind.Sub, y, x)
# Formulas
x_geq_3y = slv.mkTerm(Kind.Geq, x, three_y)
# It is also possible to get values for compound terms,
# even if those did not appear in the original formula.
- xMinusY = solver.mkTerm(Kind.Minus, x, y);
+ xMinusY = solver.mkTerm(Kind.Sub, x, y);
xMinusYVal = solver.getValue(xMinusY);
# We can now obtain the values as python values
one = slv.mkInteger(1)
plus = slv.mkTerm(Kind.Plus, start, start)
- minus = slv.mkTerm(Kind.Minus, start, start)
+ minus = slv.mkTerm(Kind.Sub, start, start)
ite = slv.mkTerm(Kind.Ite, start_bool, start, start)
And = slv.mkTerm(Kind.And, start_bool, start_bool)
# define the rules
zero = slv.mkInteger(0)
- neg_x = slv.mkTerm(Kind.Uminus, x)
+ neg_x = slv.mkTerm(Kind.Neg, x)
plus = slv.mkTerm(Kind.Plus, x, start)
# create the grammar object
{MULT, cvc5::Kind::MULT},
{IAND, cvc5::Kind::IAND},
{POW2, cvc5::Kind::POW2},
- {MINUS, cvc5::Kind::SUB},
- {UMINUS, cvc5::Kind::NEG},
+ {SUB, cvc5::Kind::SUB},
+ {NEG, cvc5::Kind::NEG},
{DIVISION, cvc5::Kind::DIVISION},
{INTS_DIVISION, cvc5::Kind::INTS_DIVISION},
{INTS_MODULUS, cvc5::Kind::INTS_MODULUS},
{cvc5::Kind::MULT, MULT},
{cvc5::Kind::IAND, IAND},
{cvc5::Kind::POW2, POW2},
- {cvc5::Kind::SUB, MINUS},
- {cvc5::Kind::NEG, UMINUS},
+ {cvc5::Kind::SUB, SUB},
+ {cvc5::Kind::NEG, NEG},
{cvc5::Kind::DIVISION, DIVISION},
{cvc5::Kind::DIVISION_TOTAL, INTERNAL_KIND},
{cvc5::Kind::INTS_DIVISION, INTS_DIVISION},
Node res;
if (echildren.size() > 2)
{
- if (kind == INTS_DIVISION || kind == XOR || kind == MINUS
- || kind == DIVISION || kind == HO_APPLY || kind == REGEXP_DIFF)
+ if (kind == INTS_DIVISION || kind == XOR || kind == SUB || kind == DIVISION
+ || kind == HO_APPLY || kind == REGEXP_DIFF)
{
// left-associative, but cvc5 internally only supports 2 args
res = d_nodeMgr->mkLeftAssociative(k, echildren);
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
*/
- MINUS,
+ SUB,
/**
* Arithmetic negation.
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
- UMINUS,
+ NEG,
/**
* Real division, division by 0 undefined, left associative.
*
void Smt2::addArithmeticOperators() {
addOperator(api::PLUS, "+");
- addOperator(api::MINUS, "-");
- // api::MINUS is converted to api::UMINUS if there is only a single operand
- Parser::addOperator(api::UMINUS);
+ addOperator(api::SUB, "-");
+ // api::SUB is converted to api::NEG if there is only a single operand
+ Parser::addOperator(api::NEG);
addOperator(api::MULT, "*");
addOperator(api::LT, "<");
addOperator(api::LEQ, "<=");
Debug("parser") << "applyParseOp: return unary " << args[0] << std::endl;
return args[0];
}
- else if (kind == api::MINUS && args.size() == 1)
+ else if (kind == api::SUB && args.size() == 1)
{
if (isConstInt(args[0]) && args[0].getRealOrIntegerValueSign() > 0)
{
<< std::endl;
return ret;
}
- api::Term ret = d_solver->mkTerm(api::UMINUS, args[0]);
+ api::Term ret = d_solver->mkTerm(api::NEG, args[0]);
Debug("parser") << "applyParseOp: return uminus " << ret << std::endl;
return ret;
}
* selector expression based on the type of args[0].
* - If the overall kind of the expression is chainable, we may convert it
* to a left- or right-associative chain.
- * - If the overall kind is MINUS and args has size 1, then we return an
- * application of UMINUS.
+ * - If the overall kind is SUB and args has size 1, then we return an
+ * application of NEG.
* - If the overall expression is a partial application, then we process this
* as a chain of HO_APPLY terms.
*/
}
: '$uminus'
{
- p.d_kind = api::UMINUS;
+ p.d_kind = api::NEG;
}
| '$sum'
{
}
| '$difference'
{
- p.d_kind = api::MINUS;
+ p.d_kind = api::SUB;
}
| '$product'
{
expr = MK_TERM(api::ITE,
MK_TERM(api::GEQ, d, SOLVER->mkReal(0)),
MK_TERM(api::TO_INTEGER, expr),
- MK_TERM(api::UMINUS,
+ MK_TERM(api::NEG,
MK_TERM(api::TO_INTEGER,
- MK_TERM(api::UMINUS, expr))));
+ MK_TERM(api::NEG, expr))));
if (remainder)
{
expr = MK_TERM(
api::TO_INTEGER,
- MK_TERM(api::MINUS, n, MK_TERM(api::MULT, expr, d)));
+ MK_TERM(api::SUB, n, MK_TERM(api::MULT, expr, d)));
}
p.d_kind = api::LAMBDA;
p.d_expr = MK_TERM(api::LAMBDA, formals, expr);
expr = MK_TERM(api::ITE,
MK_TERM(api::GEQ, expr, SOLVER->mkReal(0)),
MK_TERM(api::TO_INTEGER, expr),
- MK_TERM(api::UMINUS,
+ MK_TERM(api::NEG,
MK_TERM(api::TO_INTEGER,
- MK_TERM(api::UMINUS, expr))));
+ MK_TERM(api::NEG, expr))));
if (remainder)
{
expr = MK_TERM(
api::TO_INTEGER,
- MK_TERM(api::MINUS, n, MK_TERM(api::MULT, expr, d)));
+ MK_TERM(api::SUB, n, MK_TERM(api::MULT, expr, d)));
}
p.d_kind = api::LAMBDA;
p.d_expr = MK_TERM(api::LAMBDA, formals, expr);
if (remainder)
{
expr = MK_TERM(api::TO_INTEGER,
- MK_TERM(api::MINUS, n, MK_TERM(api::MULT, expr, d)));
+ MK_TERM(api::SUB, n, MK_TERM(api::MULT, expr, d)));
}
p.d_kind = api::LAMBDA;
p.d_expr = MK_TERM(api::LAMBDA, formals, expr);
{
api::Term n = SOLVER->mkVar(SOLVER->getRealSort(), "N");
api::Term formals = MK_TERM(api::VARIABLE_LIST, n);
- api::Term expr = MK_TERM(api::UMINUS,
- MK_TERM(api::TO_INTEGER, MK_TERM(api::UMINUS, n)));
+ api::Term expr = MK_TERM(api::NEG,
+ MK_TERM(api::TO_INTEGER, MK_TERM(api::NEG, n)));
p.d_kind = api::LAMBDA;
p.d_expr = MK_TERM(api::LAMBDA, formals, expr);
}
MK_TERM(api::ITE,
MK_TERM(api::GEQ, n, SOLVER->mkReal(0)),
MK_TERM(api::TO_INTEGER, n),
- MK_TERM(api::UMINUS,
- MK_TERM(api::TO_INTEGER, MK_TERM(api::UMINUS, n))));
+ MK_TERM(api::NEG,
+ MK_TERM(api::TO_INTEGER, MK_TERM(api::NEG, n))));
p.d_kind = api::LAMBDA;
p.d_expr = MK_TERM(api::LAMBDA, formals, expr);
}
{
api::Term n = SOLVER->mkVar(SOLVER->getRealSort(), "N");
api::Term formals = MK_TERM(api::VARIABLE_LIST, n);
- api::Term decPart = MK_TERM(api::MINUS, n, MK_TERM(api::TO_INTEGER, n));
+ api::Term decPart = MK_TERM(api::SUB, n, MK_TERM(api::TO_INTEGER, n));
api::Term expr = MK_TERM(
api::ITE,
MK_TERM(api::LT, decPart, SOLVER->mkReal(1, 2)),
// Unary AND/OR can be replaced with the argument.
return args[0];
}
- if (kind == api::MINUS && args.size() == 1)
+ if (kind == api::SUB && args.size() == 1)
{
- return d_solver->mkTerm(api::UMINUS, args[0]);
+ return d_solver->mkTerm(api::NEG, args[0]);
}
if (kind == api::TO_REAL)
{
ASSERT_NO_THROW(d_solver.mkTerm(INTS_DIVISION, {t_int, t_int, t_int}));
ASSERT_NO_THROW(
d_solver.mkTerm(d_solver.mkOp(INTS_DIVISION), {t_int, t_int, t_int}));
- ASSERT_NO_THROW(d_solver.mkTerm(MINUS, {t_int, t_int, t_int}));
- ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(MINUS), {t_int, t_int, t_int}));
+ ASSERT_NO_THROW(d_solver.mkTerm(SUB, {t_int, t_int, t_int}));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(SUB), {t_int, t_int, t_int}));
ASSERT_NO_THROW(d_solver.mkTerm(EQUAL, {t_int, t_int, t_int}));
ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(EQUAL), {t_int, t_int, t_int}));
ASSERT_NO_THROW(d_solver.mkTerm(LT, {t_int, t_int, t_int}));
Sort s2 = slv.getRealSort();
Term t1 = slv.mkConst(s2, "_x0");
Term t16 = slv.mkTerm(Kind::PI);
- Term t53 = slv.mkTerm(Kind::MINUS, {t1, t16});
+ Term t53 = slv.mkTerm(Kind::SUB, {t1, t16});
Term t54 = slv.mkTerm(Kind::SECANT, {t53});
ASSERT_NO_THROW(slv.simplify(t54));
}
solver.mkTerm(solver.mkOp(Kind.Division), [t_int, t_int, t_int])
solver.mkTerm(Kind.IntsDivision, [t_int, t_int, t_int])
solver.mkTerm(solver.mkOp(Kind.IntsDivision), [t_int, t_int, t_int])
- solver.mkTerm(Kind.Minus, [t_int, t_int, t_int])
- solver.mkTerm(solver.mkOp(Kind.Minus), [t_int, t_int, t_int])
+ solver.mkTerm(Kind.Sub, [t_int, t_int, t_int])
+ solver.mkTerm(solver.mkOp(Kind.Sub), [t_int, t_int, t_int])
solver.mkTerm(Kind.Equal, [t_int, t_int, t_int])
solver.mkTerm(solver.mkOp(Kind.Equal), [t_int, t_int, t_int])
solver.mkTerm(Kind.Lt, [t_int, t_int, t_int])