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;
* @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
*/
return Expr(d_exprManager, new Node(d_node->getOperator()));
}
+bool Expr::isParameterized() const
+{
+ ExprManagerScope ems(*this);
+ Assert(d_node != NULL, "Unexpected NULL expression pointer!");
+ return d_node->getMetaKind() == kind::metakind::PARAMETERIZED;
+}
+
Type Expr::getType(bool check) const
{
ExprManagerScope ems(*this);
*/
Expr getOperator() const;
+ /**
+ * Check if this is an expression is parameterized.
+ *
+ * @return true if this expression is parameterized.
+ *
+ * In detail, an expression 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 an Expr e where its children a1, ..., an are
+ * replaced by b1 ... bn. Then there are two cases:
+ * (1) If e is parametric, call:
+ * ExprManager::mkExpr(e.getKind(), e.getOperator(), b1, ..., bn )
+ * (2) If e is not parametric, call:
+ * ExprManager::mkExpr(e.getKind(), b1, ..., bn )
+ */
+ bool isParameterized() const;
+
/**
* Get the type for this Expr and optionally do type checking.
*
}
std::vector<Expr> pchildren;
// To test whether the operator should be passed to mkExpr below, we check
- // whether this term has an operator which is not constant. This includes
- // APPLY_UF terms, but excludes applications of interpreted symbols.
- if (term.hasOperator() && !term.getOperator().isConst())
+ // whether this term is parameterized. This includes APPLY_UF terms and BV
+ // extraction terms, but excludes applications of most interpreted symbols
+ // like PLUS.
+ if (term.isParameterized())
{
pchildren.push_back(term.getOperator());
}
regress1/sygus/clock-inc-tuple.sy
regress1/sygus/commutative-stream.sy
regress1/sygus/commutative.sy
+ regress1/sygus/concat_extract_example.sy
regress1/sygus/constant-bool-si-all.sy
regress1/sygus/constant-dec-tree-bug.sy
regress1/sygus/constant-ite-bv.sy
--- /dev/null
+; EXPECT: unsat
+; COMMAND-LINE: --sygus-out=status --lang=sygus2
+(set-logic BV)
+(synth-fun f (( x (_ BitVec 32))) (_ BitVec 32)
+ ((BV32 (_ BitVec 32)) ( BV16 (_ BitVec 16)))
+ ((BV32 (_ BitVec 32) (#x00000000 #x00000001 #xFFFFFFFF
+ x
+ (bvand BV32 BV32)
+ (bvor BV32 BV32)
+ (bvnot BV32)
+ (concat BV16 BV16)
+ ))
+ (BV16 (_ BitVec 16) (#x0000 #x0001 #xFFFF
+ (bvand BV16 BV16)
+ (bvor BV16 BV16)
+ (bvnot BV16)
+ ((_ extract 31 16) BV32)
+ ((_ extract 15 0) BV32)))))
+( constraint (= ( f #x0782ECAD ) #xECAD0000))
+( constraint (= ( f #xFFFF008E ) #x008E0000))
+( constraint (= ( f #x00000000 ) #x00000000))
+( check-synth )