jniComputeBVConst(Object ValidityChecker, Object Expr) throws Cvc3Exception;
private static native Object
jniTupleExpr(Object ValidityChecker, Object[] Exprs) throws Cvc3Exception;
- private static native Object
- jniTupleSelectExpr(Object ValidityChecker, Object ExprTuple, int index) throws Cvc3Exception;
private static native Object
jniTupleUpdateExpr(Object ValidityChecker, Object ExprTuple, int index,
Object ExprNewValue) throws Cvc3Exception;
embeddedManager());
}
- public ExprMut tupleSelectExpr(Expr tuple, int index) throws Cvc3Exception {
- return new ExprMut(
- jniTupleSelectExpr(embedded(), tuple.embedded(), index),
- embeddedManager());
- }
-
public ExprMut tupleUpdateExpr(Expr tuple, int index, Expr newValue) throws Cvc3Exception {
return new ExprMut(
jniTupleUpdateExpr(embedded(), tuple.embedded(), index, newValue.embedded()),
jobject m ValidityChecker vc cv Expr exprs
return embed_copy(env, vc->tupleExpr(exprs));
-DEFINITION: Java_cvc3_ValidityChecker_jniTupleSelectExpr
-jobject m ValidityChecker vc c Expr tuple n int index
-return embed_copy(env, vc->tupleSelectExpr(*tuple, index));
-
DEFINITION: Java_cvc3_ValidityChecker_jniTupleUpdateExpr
jobject m ValidityChecker vc c Expr tuple n int index c Expr value
return embed_copy(env, vc->tupleUpdateExpr(*tuple, index, *value));
// These cases have trouble too. Remove them for now.
//%template(mkConst) CVC4::ExprManager::mkConst<CVC4::TypeConstant>;
-//%template(mkConst) CVC4::ExprManager::mkConst<CVC4::TupleSelect>;
-//%template(mkConst) CVC4::ExprManager::mkConst<CVC4::Record>;
-//%template(mkConst) CVC4::ExprManager::mkConst<CVC4::RecordSelect>;
-
#else
%template(mkConst) CVC4::ExprManager::mkConst<CVC4::TypeConstant>;
-%template(mkConst) CVC4::ExprManager::mkConst<CVC4::TupleSelect>;
-%template(mkConst) CVC4::ExprManager::mkConst<CVC4::Record>;
-%template(mkConst) CVC4::ExprManager::mkConst<CVC4::RecordSelect>;
%template(mkConst) CVC4::ExprManager::mkConst<bool>;
#endif
return n;
}
-std::ostream& operator<<(std::ostream& out, const RecordSelect& t) {
- return out << "[" << t.getField() << "]";
-}
-
std::ostream& operator<<(std::ostream& out, const RecordUpdate& t) {
return out << "[" << t.getField() << "]";
}
namespace CVC4 {
-// operators for record select and update
-
-class CVC4_PUBLIC RecordSelect {
- std::string d_field;
-public:
- RecordSelect(const std::string& field) throw() : d_field(field) { }
- std::string getField() const throw() { return d_field; }
- bool operator==(const RecordSelect& t) const throw() { return d_field == t.d_field; }
- bool operator!=(const RecordSelect& t) const throw() { return d_field != t.d_field; }
-};/* class RecordSelect */
-
+// operators for record update
class CVC4_PUBLIC RecordUpdate {
std::string d_field;
public:
bool operator!=(const RecordUpdate& t) const throw() { return d_field != t.d_field; }
};/* class RecordUpdate */
-struct CVC4_PUBLIC RecordSelectHashFunction {
- inline size_t operator()(const RecordSelect& t) const {
- return std::hash<std::string>()(t.getField());
- }
-};/* struct RecordSelectHashFunction */
-
struct CVC4_PUBLIC RecordUpdateHashFunction {
inline size_t operator()(const RecordUpdate& t) const {
return std::hash<std::string>()(t.getField());
}
};/* struct RecordUpdateHashFunction */
-std::ostream& operator<<(std::ostream& out, const RecordSelect& t) CVC4_PUBLIC;
std::ostream& operator<<(std::ostream& out, const RecordUpdate& t) CVC4_PUBLIC;
// now an actual record definition
#endif /* SWIGJAVA */
%}
-%rename(equals) CVC4::RecordSelect::operator==(const RecordSelect&) const;
-%ignore CVC4::RecordSelect::operator!=(const RecordSelect&) const;
-
%rename(equals) CVC4::RecordUpdate::operator==(const RecordUpdate&) const;
%ignore CVC4::RecordUpdate::operator!=(const RecordUpdate&) const;
%rename(getField) CVC4::Record::operator[](size_t) const;
%rename(apply) CVC4::RecordHashFunction::operator()(const Record&) const;
-%rename(apply) CVC4::RecordSelectHashFunction::operator()(const RecordSelect&) const;
%rename(apply) CVC4::RecordUpdateHashFunction::operator()(const RecordUpdate&) const;
%ignore CVC4::operator<<(std::ostream&, const Record&);
-%ignore CVC4::operator<<(std::ostream&, const RecordSelect&);
%ignore CVC4::operator<<(std::ostream&, const RecordUpdate&);
#ifdef SWIGJAVA
namespace CVC4 {
-class CVC4_PUBLIC TupleSelect {
- unsigned d_index;
-public:
- TupleSelect(unsigned index) throw() : d_index(index) { }
- unsigned getIndex() const throw() { return d_index; }
- bool operator==(const TupleSelect& t) const throw() { return d_index == t.d_index; }
- bool operator!=(const TupleSelect& t) const throw() { return d_index != t.d_index; }
-};/* class TupleSelect */
-
class CVC4_PUBLIC TupleUpdate {
unsigned d_index;
public:
bool operator!=(const TupleUpdate& t) const throw() { return d_index != t.d_index; }
};/* class TupleUpdate */
-struct CVC4_PUBLIC TupleSelectHashFunction {
- inline size_t operator()(const TupleSelect& t) const {
- return t.getIndex();
- }
-};/* struct TupleSelectHashFunction */
-
struct CVC4_PUBLIC TupleUpdateHashFunction {
inline size_t operator()(const TupleUpdate& t) const {
return t.getIndex();
}
};/* struct TupleUpdateHashFunction */
-std::ostream& operator<<(std::ostream& out, const TupleSelect& t) CVC4_PUBLIC;
std::ostream& operator<<(std::ostream& out, const TupleUpdate& t) CVC4_PUBLIC;
-inline std::ostream& operator<<(std::ostream& out, const TupleSelect& t) {
- return out << "[" << t.getIndex() << "]";
-}
-
inline std::ostream& operator<<(std::ostream& out, const TupleUpdate& t) {
return out << "[" << t.getIndex() << "]";
}
#include "util/tuple.h"
%}
-%rename(equals) CVC4::TupleSelect::operator==(const TupleSelect&) const;
-%ignore CVC4::TupleSelect::operator!=(const TupleSelect&) const;
-
%rename(equals) CVC4::TupleUpdate::operator==(const TupleUpdate&) const;
%ignore CVC4::TupleUpdate::operator!=(const TupleUpdate&) const;
-%rename(apply) CVC4::TupleSelectHashFunction::operator()(const TupleSelect&) const;
%rename(apply) CVC4::TupleUpdateHashFunction::operator()(const TupleUpdate&) const;
-%ignore CVC4::operator<<(std::ostream&, const TupleSelect&);
%ignore CVC4::operator<<(std::ostream&, const TupleUpdate&);
%include "util/tuple.h"