}
}
-Term Solver::mkTerm(Kind kind, Sort sort) const
-{
- try
- {
- CVC4_API_KIND_CHECK_EXPECTED(kind == SEP_NIL, kind) << "SEP_NIL";
- Term res = d_exprMgr->mkNullaryOperator(*sort.d_type, extToIntKind(kind));
- (void)res.d_expr->getType(true); /* kick off type checking */
- return res;
- }
- catch (const CVC4::TypeCheckingException& e)
- {
- throw CVC4ApiException(e.getMessage());
- }
-}
-
Term Solver::mkTerm(Kind kind, Term child) const
{
try
*/
Term mkTerm(Kind kind) const;
- /**
- * Create 0-ary term of given kind and sort.
- * @param kind the kind of the term
- * @param sort the sort argument to this kind
- * @return the Term
- */
- Term mkTerm(Kind kind, Sort sort) const;
-
/**
* Create a unary term of given kind.
* @param kind the kind of the term
* Parameters: 0
* Create with:
* mkSepNil(Sort sort)
- * mkTerm(Kind kind, Sort sort)
*/
SEP_NIL,
/**
TS_ASSERT_THROWS_NOTHING(d_solver->mkTerm(REGEXP_SIGMA));
TS_ASSERT_THROWS(d_solver->mkTerm(CONST_BITVECTOR), CVC4ApiException&);
- // mkTerm(Kind kind, Sort sort) const
- TS_ASSERT_THROWS_NOTHING(
- d_solver->mkTerm(SEP_NIL, d_solver->getBooleanSort()));
- TS_ASSERT_THROWS_NOTHING(d_solver->mkTerm(SEP_NIL, Sort()));
-
// mkTerm(Kind kind, Term child) const
TS_ASSERT_THROWS_NOTHING(d_solver->mkTerm(NOT, d_solver->mkTrue()));
TS_ASSERT_THROWS(d_solver->mkTerm(NOT, Term()), CVC4ApiException&);