{
// Note: Kind and children are checked in the caller to avoid double checks
//////// all checks before this line
-
+ if (children.size() == 0)
+ {
+ return mkTermFromKind(kind);
+ }
std::vector<Node> echildren = Term::termVectorToNodes(children);
cvc5::Kind k = extToIntKind(kind);
Node res;
{
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_OP(op);
- checkMkTerm(op.d_kind, 0);
- //////// all checks before this line
-
if (!op.isIndexedHelper())
{
return mkTermFromKind(op.d_kind);
}
-
+ checkMkTerm(op.d_kind, 0);
+ //////// all checks before this line
const cvc5::Kind int_kind = extToIntKind(op.d_kind);
Term res = Term(this, getNodeManager()->mkNode(int_kind, *op.d_node));
// mkTerm(Kind kind) const
ASSERT_NO_THROW(d_solver.mkTerm(PI));
+ ASSERT_NO_THROW(d_solver.mkTerm(PI, v6));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(PI)));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(PI), v6));
ASSERT_NO_THROW(d_solver.mkTerm(REGEXP_NONE));
+ ASSERT_NO_THROW(d_solver.mkTerm(REGEXP_NONE, v6));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(REGEXP_NONE)));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(REGEXP_NONE), v6));
ASSERT_NO_THROW(d_solver.mkTerm(REGEXP_ALLCHAR));
+ ASSERT_NO_THROW(d_solver.mkTerm(REGEXP_ALLCHAR, v6));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(REGEXP_ALLCHAR)));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(REGEXP_ALLCHAR), v6));
+ ASSERT_NO_THROW(d_solver.mkTerm(SEP_EMP));
+ ASSERT_NO_THROW(d_solver.mkTerm(SEP_EMP, v6));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(SEP_EMP)));
+ ASSERT_NO_THROW(d_solver.mkTerm(d_solver.mkOp(SEP_EMP), v6));
ASSERT_THROW(d_solver.mkTerm(CONST_BITVECTOR), CVC5ApiException);
// mkTerm(Kind kind, Term child) const
# mkTerm(Kind kind) const
solver.mkPi()
+ solver.mkTerm(kinds.Pi)
+ solver.mkTerm(kinds.Pi, v6)
+ solver.mkTerm(solver.mkOp(kinds.Pi))
+ solver.mkTerm(solver.mkOp(kinds.Pi), v6)
solver.mkTerm(kinds.RegexpNone)
+ solver.mkTerm(kinds.RegexpNone, v6)
+ solver.mkTerm(solver.mkOp(kinds.RegexpNone))
+ solver.mkTerm(solver.mkOp(kinds.RegexpNone), v6)
solver.mkTerm(kinds.RegexpAllchar)
+ solver.mkTerm(kinds.RegexpAllchar, v6)
+ solver.mkTerm(solver.mkOp(kinds.RegexpAllchar))
+ solver.mkTerm(solver.mkOp(kinds.RegexpAllchar), v6)
+ solver.mkTerm(kinds.SepEmp)
+ solver.mkTerm(kinds.SepEmp, v6)
+ solver.mkTerm(solver.mkOp(kinds.SepEmp))
+ solver.mkTerm(solver.mkOp(kinds.SepEmp), v6)
with pytest.raises(RuntimeError):
solver.mkTerm(kinds.ConstBV)