From: Aina Niemetz Date: Wed, 7 Feb 2018 07:20:20 +0000 (-0800) Subject: Renamed bv::utils::isBVGroundTerm to isBvConstTerm. (#1568) X-Git-Tag: cvc5-1.0.0~5319 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d21740e08eb7ff05485ec2faca019adde8e57a99;p=cvc5.git Renamed bv::utils::isBVGroundTerm to isBvConstTerm. (#1568) --- diff --git a/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h b/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h index b53f7bb08..503fe5157 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h +++ b/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h @@ -31,7 +31,7 @@ bool RewriteRule::applies(TNode node) { Unreachable(); return (node.getKind() == kind::BITVECTOR_AND && node.getNumChildren() == 2 && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -50,7 +50,7 @@ bool RewriteRule::applies(TNode node) { Unreachable(); return (node.getKind() == kind::BITVECTOR_OR && node.getNumChildren() == 2 && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -69,7 +69,7 @@ bool RewriteRule::applies(TNode node) { Unreachable(); return (node.getKind() == kind::BITVECTOR_XOR && node.getNumChildren() == 2 && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -86,7 +86,7 @@ Node RewriteRule::apply(TNode node) { // template<> inline // bool RewriteRule::applies(TNode node) { // return (node.getKind() == kind::BITVECTOR_XNOR && -// utils::isBVGroundTerm(node)); +// utils::isBvConstTerm(node)); // } // template<> inline @@ -101,7 +101,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_NOT && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -115,7 +115,7 @@ Node RewriteRule::apply(TNode node) { // template<> inline // bool RewriteRule::applies(TNode node) { // return (node.getKind() == kind::BITVECTOR_COMP && -// utils::isBVGroundTerm(node)); +// utils::isBvConstTerm(node)); // } // template<> inline @@ -136,7 +136,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_MULT && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -153,7 +153,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_PLUS && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -170,7 +170,7 @@ Node RewriteRule::apply(TNode node) { // template<> inline // bool RewriteRule::applies(TNode node) { // return (node.getKind() == kind::BITVECTOR_SUB && -// utils::isBVGroundTerm(node)); +// utils::isBvConstTerm(node)); // } // template<> inline @@ -185,7 +185,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_NEG && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -198,7 +198,7 @@ Node RewriteRule::apply(TNode node) { } template<> inline bool RewriteRule::applies(TNode node) { - return (utils::isBVGroundTerm(node) && + return (utils::isBvConstTerm(node) && (node.getKind() == kind::BITVECTOR_UDIV_TOTAL || (node.getKind() == kind::BITVECTOR_UDIV && node[1].isConst()))); } @@ -214,7 +214,7 @@ Node RewriteRule::apply(TNode node) { } template<> inline bool RewriteRule::applies(TNode node) { - return (utils::isBVGroundTerm(node) && + return (utils::isBvConstTerm(node) && (node.getKind() == kind::BITVECTOR_UREM_TOTAL || (node.getKind() == kind::BITVECTOR_UREM && node[1].isConst()))); } @@ -231,7 +231,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_SHL && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -247,7 +247,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_LSHR && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -263,7 +263,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_ASHR && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -279,7 +279,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_ULT && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -297,7 +297,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_ULTBV && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -315,7 +315,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_SLT && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -334,7 +334,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_SLTBV && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -354,7 +354,7 @@ template<> inline bool RewriteRule::applies(TNode node) { Debug("bv-rewrite") << "RewriteRule::applies(" << node << ")" << std::endl; return (node.getKind() == kind::BITVECTOR_ITE && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -373,7 +373,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_ULE && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -391,7 +391,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_SLE && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -409,7 +409,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_EXTRACT && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -427,7 +427,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_CONCAT && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -445,7 +445,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_SIGN_EXTEND && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -461,7 +461,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::EQUAL && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline @@ -479,7 +479,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { return (node.getKind() == kind::BITVECTOR_COMP && - utils::isBVGroundTerm(node)); + utils::isBvConstTerm(node)); } template<> inline diff --git a/src/theory/bv/theory_bv_utils.cpp b/src/theory/bv/theory_bv_utils.cpp index c514a2538..da3822aa6 100644 --- a/src/theory/bv/theory_bv_utils.cpp +++ b/src/theory/bv/theory_bv_utils.cpp @@ -117,7 +117,7 @@ unsigned isPow2Const(TNode node, bool& isNeg) return false; } -bool isBVGroundTerm(TNode node) +bool isBvConstTerm(TNode node) { if (node.getNumChildren() == 0) { diff --git a/src/theory/bv/theory_bv_utils.h b/src/theory/bv/theory_bv_utils.h index 4554d371c..6115a7e96 100644 --- a/src/theory/bv/theory_bv_utils.h +++ b/src/theory/bv/theory_bv_utils.h @@ -81,9 +81,8 @@ bool isZero(TNode node); * c+1. Otherwise, this function returns 0. The flag isNeg is updated to * indicate whether node is negative. */ unsigned isPow2Const(TNode node, bool& isNeg); -// TODO: need a better name, this is not technically a ground term /* Returns true if node or all of its children is const. */ -bool isBVGroundTerm(TNode node); +bool isBvConstTerm(TNode node); /* Returns true if node is a predicate over bit-vector nodes. */ bool isBVPredicate(TNode node); /* Returns true if given term is a THEORY_BV term. */