summaryrefslogtreecommitdiff
path: root/src/api/cpp/cvc5.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-09-30 10:38:44 -0500
committerGitHub <noreply@github.com>2021-09-30 15:38:44 +0000
commit46ad5bddc9bc0e03ea702f29c56c22e917aeb06b (patch)
treef5401a4a35643d25b6e3c43403018cf57ec5c0b4 /src/api/cpp/cvc5.cpp
parent0a15133a7de2289fdfb10ccf65e9b753f5064ba7 (diff)
Simplify the syntax and representation of the separation logic empty heap constraint (#7268)
Since ~1 year ago, we insist that the location and data types of the separation logic heap are set upfront, analogous to the set-logic command. This means that the separation logic empty heap constraint does not need to be annotated with its types. This makes SEP_EMP a nullary Boolean operator instead of binary predicate (taking dummy arguments whose types specify the heap type). It changes the smt2 extended syntax from (_ emp T1 T2) to sep.emp.
Diffstat (limited to 'src/api/cpp/cvc5.cpp')
-rw-r--r--src/api/cpp/cvc5.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/api/cpp/cvc5.cpp b/src/api/cpp/cvc5.cpp
index d33ef5b42..42690586a 100644
--- a/src/api/cpp/cvc5.cpp
+++ b/src/api/cpp/cvc5.cpp
@@ -5079,21 +5079,26 @@ Sort Solver::mkTupleSortHelper(const std::vector<Sort>& sorts) const
Term Solver::mkTermFromKind(Kind kind) const
{
- CVC5_API_KIND_CHECK_EXPECTED(
- kind == PI || kind == REGEXP_EMPTY || kind == REGEXP_SIGMA, kind)
+ CVC5_API_KIND_CHECK_EXPECTED(kind == PI || kind == REGEXP_EMPTY
+ || kind == REGEXP_SIGMA || kind == SEP_EMP,
+ kind)
<< "PI or REGEXP_EMPTY or REGEXP_SIGMA";
//////// all checks before this line
Node res;
+ cvc5::Kind k = extToIntKind(kind);
if (kind == REGEXP_EMPTY || kind == REGEXP_SIGMA)
{
- cvc5::Kind k = extToIntKind(kind);
Assert(isDefinedIntKind(k));
res = d_nodeMgr->mkNode(k, std::vector<Node>());
}
+ else if (kind == SEP_EMP)
+ {
+ res = d_nodeMgr->mkNullaryOperator(d_nodeMgr->booleanType(), k);
+ }
else
{
Assert(kind == PI);
- res = d_nodeMgr->mkNullaryOperator(d_nodeMgr->realType(), cvc5::kind::PI);
+ res = d_nodeMgr->mkNullaryOperator(d_nodeMgr->realType(), k);
}
(void)res.getType(true); /* kick off type checking */
increment_term_stats(kind);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback