Term member = solver.mkTerm(MEMBER, xxTuple, ancestor);
Term notMember = solver.mkTerm(NOT, member);
- Term quantifiedVariables = solver.mkTerm(BOUND_VAR_LIST, x);
+ Term quantifiedVariables = solver.mkTerm(VARIABLE_LIST, x);
Term noSelfAncestor = solver.mkTerm(FORALL, quantifiedVariables, notMember);
// formulas
Term member = solver.mkTerm(MEMBER, xxTuple, ancestor);
Term notMember = solver.mkTerm(NOT, member);
- Term quantifiedVariables = solver.mkTerm(BOUND_VAR_LIST, var);
+ Term quantifiedVariables = solver.mkTerm(VARIABLE_LIST, var);
Term noSelfAncestor = solver.mkTerm(FORALL, quantifiedVariables, notMember);
// formulas
Term x = slv.mkVar(integer, "x");
// make forall x. P( x )
- Term var_list = slv.mkTerm(Kind::BOUND_VAR_LIST, x);
+ Term var_list = slv.mkTerm(Kind::VARIABLE_LIST, x);
Term px = slv.mkTerm(Kind::APPLY_UF, p, x);
Term quantpospx = slv.mkTerm(Kind::FORALL, var_list, px);
std::cout << "Made expression : " << quantpospx << std::endl;
/* Quantifiers --------------------------------------------------------- */
{FORALL, cvc5::Kind::FORALL},
{EXISTS, cvc5::Kind::EXISTS},
- {BOUND_VAR_LIST, cvc5::Kind::BOUND_VAR_LIST},
+ {VARIABLE_LIST, cvc5::Kind::BOUND_VAR_LIST},
{INST_PATTERN, cvc5::Kind::INST_PATTERN},
{INST_NO_PATTERN, cvc5::Kind::INST_NO_PATTERN},
{INST_POOL, cvc5::Kind::INST_POOL},
/* Quantifiers ----------------------------------------------------- */
{cvc5::Kind::FORALL, FORALL},
{cvc5::Kind::EXISTS, EXISTS},
- {cvc5::Kind::BOUND_VAR_LIST, BOUND_VAR_LIST},
+ {cvc5::Kind::BOUND_VAR_LIST, VARIABLE_LIST},
{cvc5::Kind::INST_PATTERN, INST_PATTERN},
{cvc5::Kind::INST_NO_PATTERN, INST_NO_PATTERN},
{cvc5::Kind::INST_POOL, INST_POOL},
* Lambda expression.
*
* Parameters:
- * - 1: BOUND_VAR_LIST
+ * - 1: VARIABLE_LIST
* - 2: Lambda body
*
* Create with:
LAMBDA,
/**
* The syntax of a witness term is similar to a quantified formula except that
- * only one bound variable is allowed.
+ * only one variable is allowed.
* The term `(witness ((x T)) F)` returns an element `x` of type `T`
* and asserts `F`.
*
* whereas notice that `(or (= z 0) (not (= z 0)))` is true for any `z`.
*
* Parameters:
- * - 1: BOUND_VAR_LIST
+ * - 1: VARIABLE_LIST
* - 2: Witness body
*
* Create with:
* is represented by the AST
*
* (MATCH l
- * (MATCH_BIND_CASE (BOUND_VAR_LIST h t) (cons h t) h)
+ * (MATCH_BIND_CASE (VARIABLE_LIST h t) (cons h t) h)
* (MATCH_CASE nil 0))
*
* The type of the last argument of each case term could be equal.
* A (non-constant) case expression to be used within a match expression.
*
* Parameters:
- * - 1: a BOUND_VAR_LIST Term containing the free variables of the case
+ * - 1: a VARIABLE_LIST Term containing the free variables of the case
* - 2: Term denoting the pattern expression
* - 3: Term denoting the return value
*
SET_UNIVERSE,
/**
* Set comprehension
- * A set comprehension is specified by a bound variable list x1 ... xn,
+ * A set comprehension is specified by a variable list x1 ... xn,
* a predicate P[x1...xn], and a term t[x1...xn]. A comprehension C with the
* above form has members given by the following semantics:
* @f[
* y in the above formula.
*
* Parameters:
- * - 1: Term BOUND_VAR_LIST
+ * - 1: Term VARIABLE_LIST
* - 2: Term denoting the predicate of the comprehension
* - 3: (optional) a Term denoting the generator for the comprehension
*
* Universally quantified formula.
*
* Parameters:
- * - 1: BOUND_VAR_LIST Term
+ * - 1: VARIABLE_LIST Term
* - 2: Quantifier body
* - 3: (optional) INST_PATTERN_LIST Term
*
* Existentially quantified formula.
*
* Parameters:
- * - 1: BOUND_VAR_LIST Term
+ * - 1: VARIABLE_LIST Term
* - 2: Quantifier body
* - 3: (optional) INST_PATTERN_LIST Term
*
*/
EXISTS,
/**
- * A list of bound variables (used to bind variables under a quantifier)
+ * A list of variables (used to bind variables under a quantifier)
*
* Parameters: n > 1
- * - 1..n: Terms with kind BOUND_VARIABLE
+ * - 1..n: Terms with kind VARIABLE
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
*/
- BOUND_VAR_LIST,
+ VARIABLE_LIST,
/**
* An instantiation pattern.
* Specifies a (list of) terms to be used as a pattern for quantifier
* instantiation.
*
* Parameters: n > 1
- * - 1..n: Terms with kind BOUND_VARIABLE
+ * - 1..n: Terms of any sort
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* quantifier instantiation.
*
* Parameters: n > 1
- * - 1..n: Terms with kind BOUND_VARIABLE
+ * - 1..n: Terms of any sort
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
cargs.push_back(f);
cargs.insert(cargs.end(),args.begin(),args.end());
api::Term c = MK_TERM(api::APPLY_CONSTRUCTOR,cargs);
- api::Term bvla = MK_TERM(api::BOUND_VAR_LIST,args);
+ api::Term bvla = MK_TERM(api::VARIABLE_LIST,args);
api::Term mc = MK_TERM(api::MATCH_BIND_CASE, bvla, c, f3);
matchcases.push_back(mc);
// now, pop the scope
api::Term mc;
if (f.getKind() == api::VARIABLE)
{
- api::Term bvlf = MK_TERM(api::BOUND_VAR_LIST, f);
+ api::Term bvlf = MK_TERM(api::VARIABLE_LIST, f);
mc = MK_TERM(api::MATCH_BIND_CASE, bvlf, f, f3);
}
else
{
std::vector<cvc5::api::Term> args =
PARSER_STATE->bindBoundVars(sortedVarNames);
- expr = MK_TERM(api::BOUND_VAR_LIST, args);
+ expr = MK_TERM(api::VARIABLE_LIST, args);
}
;
{ PARSER_STATE->popScope();
std::vector<api::Term> bvl = PARSER_STATE->getFreeVar();
if(!bvl.empty()) {
- expr = MK_TERM(api::FORALL,MK_TERM(api::BOUND_VAR_LIST,bvl),expr);
+ expr = MK_TERM(api::FORALL,MK_TERM(api::VARIABLE_LIST,bvl),expr);
};
}
(COMMA_TOK anything*)? RPAREN_TOK DOT_TOK
MK_TERM(api::NOT,
MK_TERM(api::EQUAL, r, SOLVER->mkInteger(0))),
MK_TERM(api::EQUAL, qr, MK_TERM(api::MULT, n, rr)));
- api::Term bvl = MK_TERM(api::BOUND_VAR_LIST, q, r);
+ api::Term bvl = MK_TERM(api::VARIABLE_LIST, q, r);
body = MK_TERM(api::EXISTS, bvl, body);
- api::Term lbvl = MK_TERM(api::BOUND_VAR_LIST, n);
+ api::Term lbvl = MK_TERM(api::VARIABLE_LIST, n);
p.d_kind = api::LAMBDA;
p.d_expr = MK_TERM(api::LAMBDA, lbvl, body);
}
MK_TERM(api::NOT,
MK_TERM(api::EQUAL, r, SOLVER->mkInteger(0))),
MK_TERM(api::EQUAL, qr, MK_TERM(api::MULT, n, rr)));
- api::Term bvl = MK_TERM(api::BOUND_VAR_LIST, q, r);
+ api::Term bvl = MK_TERM(api::VARIABLE_LIST, q, r);
body = MK_TERM(api::EXISTS, bvl, body);
- api::Term lbvl = MK_TERM(api::BOUND_VAR_LIST, n);
+ api::Term lbvl = MK_TERM(api::VARIABLE_LIST, n);
p.d_kind = api::LAMBDA;
p.d_expr = MK_TERM(api::LAMBDA, lbvl, body);
}
{
api::Term n = SOLVER->mkVar(SOLVER->getRealSort(), "N");
api::Term d = SOLVER->mkVar(SOLVER->getRealSort(), "D");
- api::Term formals = MK_TERM(api::BOUND_VAR_LIST, n, d);
+ api::Term formals = MK_TERM(api::VARIABLE_LIST, n, d);
api::Term expr = MK_TERM(api::DIVISION, n, d);
expr = MK_TERM(api::ITE,
MK_TERM(api::GEQ, d, SOLVER->mkReal(0)),
{
api::Term n = SOLVER->mkVar(SOLVER->getRealSort(), "N");
api::Term d = SOLVER->mkVar(SOLVER->getRealSort(), "D");
- api::Term formals = MK_TERM(api::BOUND_VAR_LIST, n, d);
+ api::Term formals = MK_TERM(api::VARIABLE_LIST, n, d);
api::Term expr = MK_TERM(api::DIVISION, n, d);
expr = MK_TERM(api::ITE,
MK_TERM(api::GEQ, expr, SOLVER->mkReal(0)),
{
api::Term n = SOLVER->mkVar(SOLVER->getRealSort(), "N");
api::Term d = SOLVER->mkVar(SOLVER->getRealSort(), "D");
- api::Term formals = MK_TERM(api::BOUND_VAR_LIST, n, d);
+ api::Term formals = MK_TERM(api::VARIABLE_LIST, n, d);
api::Term expr = MK_TERM(api::DIVISION, n, d);
expr = MK_TERM(api::TO_INTEGER, expr);
if (remainder)
| '$ceiling'
{
api::Term n = SOLVER->mkVar(SOLVER->getRealSort(), "N");
- api::Term formals = MK_TERM(api::BOUND_VAR_LIST, 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)));
p.d_kind = api::LAMBDA;
| '$truncate'
{
api::Term n = SOLVER->mkVar(SOLVER->getRealSort(), "N");
- api::Term formals = MK_TERM(api::BOUND_VAR_LIST, n);
+ api::Term formals = MK_TERM(api::VARIABLE_LIST, n);
api::Term expr =
MK_TERM(api::ITE,
MK_TERM(api::GEQ, n, SOLVER->mkReal(0)),
| '$round'
{
api::Term n = SOLVER->mkVar(SOLVER->getRealSort(), "N");
- api::Term formals = MK_TERM(api::BOUND_VAR_LIST, 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 expr = MK_TERM(
api::ITE,
( COMMA_TOK bindvariable[expr] { bv.push_back(expr); } )* ) RBRACK_TOK
COLON_TOK fofUnitaryFormula[expr]
{ PARSER_STATE->popScope();
- expr = MK_TERM(kind, MK_TERM(api::BOUND_VAR_LIST, bv), expr);
+ expr = MK_TERM(kind, MK_TERM(api::VARIABLE_LIST, bv), expr);
}
;
{
// apply body of lambda to flatten vars
expr = PARSER_STATE->mkHoApply(expr, flattenVars);
- // add variables to BOUND_VAR_LIST
+ // add variables to VARIABLE_LIST
bv.insert(bv.end(), flattenVars.begin(), flattenVars.end());
}
- p.d_expr = MK_TERM(p.d_kind, MK_TERM(api::BOUND_VAR_LIST, bv), expr);
+ p.d_expr = MK_TERM(p.d_kind, MK_TERM(api::VARIABLE_LIST, bv), expr);
}
;
( COMMA_TOK tffbindvariable[expr] { bv.push_back(expr); } )* ) RBRACK_TOK
COLON_TOK tffUnitaryFormula[expr]
{ PARSER_STATE->popScope();
- expr = MK_TERM(kind, MK_TERM(api::BOUND_VAR_LIST, bv), expr);
+ expr = MK_TERM(kind, MK_TERM(api::VARIABLE_LIST, bv), expr);
}
| '$ite_f' LPAREN_TOK tffLogicFormula[expr] COMMA_TOK tffLogicFormula[lhs] COMMA_TOK tffLogicFormula[rhs] RPAREN_TOK
{ expr = MK_TERM(api::ITE, expr, lhs, rhs); }
{
PARSER_STATE->checkLetBinding(bvlist, lhs, rhs, false);
std::vector<api::Term> lchildren(++lhs.begin(), lhs.end());
- rhs = MK_TERM(api::LAMBDA, MK_TERM(api::BOUND_VAR_LIST, lchildren), rhs);
+ rhs = MK_TERM(api::LAMBDA, MK_TERM(api::VARIABLE_LIST, lchildren), rhs);
// since lhs is always APPLY_UF (otherwise we'd have had a parser error in
// checkLetBinding) the function to be replaced is always the first
// argument. Note that the way in which lchildren is built above is also
{
PARSER_STATE->checkLetBinding(bvlist, lhs, rhs, true);
std::vector<api::Term> lchildren(++lhs.begin(), lhs.end());
- rhs = MK_TERM(api::LAMBDA, MK_TERM(api::BOUND_VAR_LIST, lchildren), rhs);
+ rhs = MK_TERM(api::LAMBDA, MK_TERM(api::VARIABLE_LIST, lchildren), rhs);
// since lhs is always APPLY_UF (otherwise we'd have had a parser error in
// checkLetBinding) the function to be replaced is always the first
// argument. Note that the way in which lchildren is built above is also
// apply body of lambda to variables
api::Term wrapper =
d_solver->mkTerm(api::LAMBDA,
- d_solver->mkTerm(api::BOUND_VAR_LIST, lvars),
+ d_solver->mkTerm(api::VARIABLE_LIST, lvars),
d_solver->mkTerm(k, lvars));
return wrapper;
Term x = d_solver.mkVar(uSort, "x");
Term y = d_solver.mkVar(uSort, "y");
Term eq = d_solver.mkTerm(EQUAL, x, y);
- Term bvl = d_solver.mkTerm(BOUND_VAR_LIST, x, y);
+ Term bvl = d_solver.mkTerm(VARIABLE_LIST, x, y);
Term f = d_solver.mkTerm(FORALL, bvl, eq);
d_solver.assertFormula(f);
d_solver.checkSat();
Term x = d_solver.mkVar(d_solver.getBooleanSort(), "x");
Term forall =
d_solver.mkTerm(FORALL,
- d_solver.mkTerm(BOUND_VAR_LIST, x),
+ d_solver.mkTerm(VARIABLE_LIST, x),
d_solver.mkTerm(OR, x, d_solver.mkTerm(NOT, x)));
ASSERT_THROW(d_solver.getQuantifierElimination(Term()), CVC5ApiException);
ASSERT_THROW(d_solver.getQuantifierElimination(Solver().mkBoolean(false)),
Term x = d_solver.mkVar(d_solver.getBooleanSort(), "x");
Term forall =
d_solver.mkTerm(FORALL,
- d_solver.mkTerm(BOUND_VAR_LIST, x),
+ d_solver.mkTerm(VARIABLE_LIST, x),
d_solver.mkTerm(OR, x, d_solver.mkTerm(NOT, x)));
ASSERT_THROW(d_solver.getQuantifierEliminationDisjunct(Term()),
CVC5ApiException);
Term x = d_solver.mkVar(uSort, "x");
Term y = d_solver.mkVar(uSort, "y");
Term eq = d_solver.mkTerm(EQUAL, x, y);
- Term bvl = d_solver.mkTerm(BOUND_VAR_LIST, x, y);
+ Term bvl = d_solver.mkTerm(VARIABLE_LIST, x, y);
Term f = d_solver.mkTerm(FORALL, bvl, eq);
d_solver.assertFormula(f);
d_solver.checkSat();
@Test void getQuantifierElimination()
{
Term x = d_solver.mkVar(d_solver.getBooleanSort(), "x");
- Term forall = d_solver.mkTerm(FORALL,
- d_solver.mkTerm(BOUND_VAR_LIST, x),
- d_solver.mkTerm(OR, x, d_solver.mkTerm(NOT, x)));
+ Term forall = d_solver.mkTerm(
+ FORALL, d_solver.mkTerm(VARIABLE_LIST, x), d_solver.mkTerm(OR, x, d_solver.mkTerm(NOT, x)));
assertThrows(
CVC5ApiException.class, () -> d_solver.getQuantifierElimination(d_solver.getNullTerm()));
Solver slv = new Solver();
@Test void getQuantifierEliminationDisjunct()
{
Term x = d_solver.mkVar(d_solver.getBooleanSort(), "x");
- Term forall = d_solver.mkTerm(FORALL,
- d_solver.mkTerm(BOUND_VAR_LIST, x),
- d_solver.mkTerm(OR, x, d_solver.mkTerm(NOT, x)));
+ Term forall = d_solver.mkTerm(
+ FORALL, d_solver.mkTerm(VARIABLE_LIST, x), d_solver.mkTerm(OR, x, d_solver.mkTerm(NOT, x)));
assertThrows(CVC5ApiException.class,
() -> d_solver.getQuantifierEliminationDisjunct(d_solver.getNullTerm()));