diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2019-09-25 12:09:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-25 12:09:42 -0500 |
commit | 91565cda11ad42082a11055514e12ddeee459460 (patch) | |
tree | 56df21e0a0c5d0734cd40b3ce93ced2c2beac54d /src/api | |
parent | 4f384b6fadd999324d83b4c4ea900de2a0e13dd7 (diff) |
Add isParameterized function to Expr (#3303)
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/cvc4cpp.cpp | 6 | ||||
-rw-r--r-- | src/api/cvc4cpp.h | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/api/cvc4cpp.cpp b/src/api/cvc4cpp.cpp index 6a6088007..b40a58e37 100644 --- a/src/api/cvc4cpp.cpp +++ b/src/api/cvc4cpp.cpp @@ -1050,6 +1050,12 @@ Kind Term::getKind() const return intToExtKind(d_expr->getKind()); } +bool Term::isParameterized() const +{ + CVC4_API_CHECK_NOT_NULL; + return d_expr->isParameterized(); +} + Sort Term::getSort() const { CVC4_API_CHECK_NOT_NULL; diff --git a/src/api/cvc4cpp.h b/src/api/cvc4cpp.h index 7fee35afd..bb7b48f97 100644 --- a/src/api/cvc4cpp.h +++ b/src/api/cvc4cpp.h @@ -579,7 +579,24 @@ class CVC4_PUBLIC Term * @return the kind of this term */ Kind getKind() const; - + + /** + * @return true if this expression is parameterized. + * + * !!! The below documentation is not accurate until we have a way of getting + * operators from terms. + * + * In detail, a term that is parameterized is one that has an operator that + * must be provided in addition to its kind to construct it. For example, + * say we want to re-construct a Term t where its children a1, ..., an are + * replaced by b1 ... bn. Then there are two cases: + * (1) If t is parametric, call: + * mkTerm(t.getKind(), t.getOperator(), b1, ..., bn ) + * (2) If t is not parametric, call: + * mkTerm(t.getKind(), b1, ..., bn ) + */ + bool isParameterized() const; + /** * @return the sort of this term */ |