expr/datatype.h
expr/emptyset.h
expr/expr_iomanip.h
- expr/expr_sequence.h
expr/record.h
expr/symbol_table.h
expr/type.h
CVC4_API_CHECK(d_expr->getKind() == CVC4::Kind::CONST_SEQUENCE)
<< "Expecting a CONST_SEQUENCE Term when calling "
"getConstSequenceElements()";
- const std::vector<Node>& elems =
- d_expr->getConst<ExprSequence>().getSequence().getVec();
+ const std::vector<Node>& elems = d_expr->getConst<Sequence>().getVec();
std::vector<Term> terms;
for (const Node& t : elems)
{
CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null sort";
CVC4_API_SOLVER_CHECK_SORT(sort);
- std::vector<Expr> seq;
- Expr res = d_exprMgr->mkConst(ExprSequence(*sort.d_type, seq));
+ std::vector<Node> seq;
+ Expr res =
+ d_exprMgr->mkConst(Sequence(TypeNode::fromType(*sort.d_type), seq));
return Term(this, res);
CVC4_API_SOLVER_TRY_CATCH_END;
expr_iomanip.cpp
expr_iomanip.h
expr_manager_scope.h
- expr_sequence.cpp
- expr_sequence.h
kind_map.h
lazy_proof.cpp
lazy_proof.h
+++ /dev/null
-/********************* */
-/*! \file expr_sequence.cpp
- ** \verbatim
- ** Top contributors (to current version):
- ** Andrew Reynolds
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Implementation of the sequence data type.
- **/
-
-#include "expr/expr_sequence.h"
-
-#include "expr/expr.h"
-#include "expr/node.h"
-#include "expr/sequence.h"
-#include "expr/type.h"
-#include "expr/type_node.h"
-
-namespace CVC4 {
-
-ExprSequence::ExprSequence(const Type& t, const std::vector<Expr>& seq)
-{
- d_type.reset(new Type(t));
- std::vector<Node> nseq;
- for (const Expr& e : seq)
- {
- nseq.push_back(Node::fromExpr(e));
- }
- d_sequence.reset(new Sequence(TypeNode::fromType(t), nseq));
-}
-ExprSequence::~ExprSequence() {}
-
-ExprSequence::ExprSequence(const ExprSequence& other)
- : d_type(new Type(other.getType())),
- d_sequence(new Sequence(other.getSequence()))
-{
-}
-
-ExprSequence& ExprSequence::operator=(const ExprSequence& other)
-{
- (*d_type) = other.getType();
- (*d_sequence) = other.getSequence();
- return *this;
-}
-
-const Type& ExprSequence::getType() const { return *d_type; }
-
-const Sequence& ExprSequence::getSequence() const { return *d_sequence; }
-
-bool ExprSequence::operator==(const ExprSequence& es) const
-{
- return getType() == es.getType() && getSequence() == es.getSequence();
-}
-
-bool ExprSequence::operator!=(const ExprSequence& es) const
-{
- return !(*this == es);
-}
-
-bool ExprSequence::operator<(const ExprSequence& es) const
-{
- return (getType() < es.getType())
- || (getType() == es.getType() && getSequence() < es.getSequence());
-}
-
-bool ExprSequence::operator<=(const ExprSequence& es) const
-{
- return (getType() < es.getType())
- || (getType() == es.getType() && getSequence() <= es.getSequence());
-}
-
-bool ExprSequence::operator>(const ExprSequence& es) const
-{
- return !(*this <= es);
-}
-
-bool ExprSequence::operator>=(const ExprSequence& es) const
-{
- return !(*this < es);
-}
-
-std::ostream& operator<<(std::ostream& os, const ExprSequence& s)
-{
- return os << "__expr_sequence__(" << s.getType() << ", " << s.getSequence()
- << ")";
-}
-
-size_t ExprSequenceHashFunction::operator()(const ExprSequence& es) const
-{
- uint64_t hash = fnv1a::fnv1a_64(TypeHashFunction()(es.getType()));
- return static_cast<size_t>(SequenceHashFunction()(es.getSequence()), hash);
-}
-
-} // namespace CVC4
+++ /dev/null
-/********************* */
-/*! \file expr_sequence.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andrew Reynolds
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief The sequence data type.
- **/
-
-#include "cvc4_public.h"
-
-#ifndef CVC4__EXPR__EXPR_SEQUENCE_H
-#define CVC4__EXPR__EXPR_SEQUENCE_H
-
-#include <iosfwd>
-#include <memory>
-#include <vector>
-
-namespace CVC4 {
-
-// messy; Expr needs ExprSequence (because it's the payload of a
-// CONSTANT-kinded expression), and ExprSequence needs Expr.
-class Type;
-class Expr;
-class Sequence;
-
-/** The CVC4 sequence class
- *
- * This data structure is the domain of values for the sequence type.
- */
-class CVC4_PUBLIC ExprSequence
-{
- public:
- /** constructors for ExprSequence
- *
- * Internally, a CVC4::ExprSequence is represented by a vector of Nodes
- * (d_seq), where each Node in this vector must be a constant.
- */
- ExprSequence(const Type& type, const std::vector<Expr>& seq);
- ~ExprSequence();
-
- ExprSequence(const ExprSequence& other);
- ExprSequence& operator=(const ExprSequence& other);
-
- bool operator==(const ExprSequence& es) const;
- bool operator!=(const ExprSequence& es) const;
- bool operator<(const ExprSequence& es) const;
- bool operator<=(const ExprSequence& es) const;
- bool operator>(const ExprSequence& es) const;
- bool operator>=(const ExprSequence& es) const;
-
- /** Get the element type of the sequence */
- const Type& getType() const;
- /** Get the underlying sequence */
- const Sequence& getSequence() const;
-
- private:
- /** The element type of the sequence */
- std::unique_ptr<Type> d_type;
- /** The data of the sequence */
- std::unique_ptr<Sequence> d_sequence;
-}; /* class ExprSequence */
-
-struct CVC4_PUBLIC ExprSequenceHashFunction
-{
- size_t operator()(const ::CVC4::ExprSequence& s) const;
-}; /* struct ExprSequenceHashFunction */
-
-std::ostream& operator<<(std::ostream& os, const ExprSequence& s) CVC4_PUBLIC;
-
-} // namespace CVC4
-
-#endif /* CVC4__EXPR__SEQUENCE_H */
#include "expr/sequence.h"
-#include "expr/expr_sequence.h"
+#include <vector>
+
+#include "expr/node.h"
+#include "expr/type_node.h"
using namespace std;
namespace CVC4 {
-Sequence::Sequence(TypeNode t, const std::vector<Node>& s) : d_type(t), d_seq(s)
+Sequence::Sequence(const TypeNode& t, const std::vector<Node>& s)
+ : d_type(new TypeNode(t)), d_seq(s)
+{
+}
+
+Sequence::Sequence(const Sequence& seq)
+ : d_type(new TypeNode(seq.getType())), d_seq(seq.getVec())
{
}
+Sequence::~Sequence() {}
+
Sequence& Sequence::operator=(const Sequence& y)
{
if (this != &y)
{
- d_type = y.d_type;
- d_seq = y.d_seq;
+ d_type.reset(new TypeNode(y.getType()));
+ d_seq = y.getVec();
}
return *this;
}
int Sequence::cmp(const Sequence& y) const
{
- Assert(d_type == y.d_type);
+ if (getType() != y.getType())
+ {
+ return getType() < y.getType() ? -1 : 1;
+ }
if (size() != y.size())
{
return size() < y.size() ? -1 : 1;
}
for (size_t i = 0, sz = size(); i < sz; ++i)
{
- if (d_seq[i] != y.d_seq[i])
+ if (nth(i) != y.nth(i))
{
- return d_seq[i] < y.d_seq[i] ? -1 : 1;
+ return nth(i) < y.nth(i) ? -1 : 1;
}
}
return 0;
Sequence Sequence::concat(const Sequence& other) const
{
- Assert(d_type == other.d_type);
+ Assert(getType() == other.getType());
std::vector<Node> ret_vec(d_seq);
ret_vec.insert(ret_vec.end(), other.d_seq.begin(), other.d_seq.end());
- return Sequence(d_type, ret_vec);
+ return Sequence(getType(), ret_vec);
}
bool Sequence::strncmp(const Sequence& y, size_t n) const
{
- Assert(d_type == y.d_type);
+ Assert(getType() == y.getType());
size_t b = (size() >= y.size()) ? size() : y.size();
size_t s = (size() <= y.size()) ? size() : y.size();
if (n > s)
}
for (size_t i = 0; i < n; ++i)
{
- if (d_seq[i] != y.d_seq[i])
+ if (nth(i) != y.nth(i))
{
return false;
}
}
for (size_t i = 0; i < n; ++i)
{
- if (d_seq[size() - i - 1] != y.d_seq[y.size() - i - 1])
+ if (nth(size() - i - 1) != y.nth(y.size() - i - 1))
{
return false;
}
return true;
}
-Node Sequence::front() const
+bool Sequence::empty() const { return d_seq.empty(); }
+
+size_t Sequence::size() const { return d_seq.size(); }
+
+const Node& Sequence::front() const
{
Assert(!d_seq.empty());
return d_seq.front();
}
-Node Sequence::back() const
+const Node& Sequence::back() const
{
Assert(!d_seq.empty());
return d_seq.back();
}
+const Node& Sequence::nth(size_t i) const
+{
+ Assert(i < size());
+ return d_seq[i];
+}
+
size_t Sequence::overlap(const Sequence& y) const
{
- Assert(d_type == y.d_type);
+ Assert(getType() == y.getType());
size_t i = size() < y.size() ? size() : y.size();
for (; i > 0; i--)
{
size_t Sequence::roverlap(const Sequence& y) const
{
- Assert(d_type == y.d_type);
+ Assert(getType() == y.getType());
size_t i = size() < y.size() ? size() : y.size();
for (; i > 0; i--)
{
return i;
}
+const TypeNode& Sequence::getType() const { return *d_type; }
+
+const std::vector<Node>& Sequence::getVec() const { return d_seq; }
+
bool Sequence::isRepeated() const
{
if (size() > 1)
{
- Node f = d_seq[0];
+ Node f = nth(0);
for (unsigned i = 1, sz = size(); i < sz; ++i)
{
- if (f != d_seq[i])
+ if (f != nth(i))
{
return false;
}
size_t Sequence::find(const Sequence& y, size_t start) const
{
- Assert(d_type == y.d_type);
+ Assert(getType() == y.getType());
if (size() < y.size() + start)
{
return std::string::npos;
size_t Sequence::rfind(const Sequence& y, size_t start) const
{
- Assert(d_type == y.d_type);
+ Assert(getType() == y.getType());
if (size() < y.size() + start)
{
return std::string::npos;
bool Sequence::hasPrefix(const Sequence& y) const
{
- Assert(d_type == y.d_type);
+ Assert(getType() == y.getType());
size_t s = size();
size_t ys = y.size();
if (ys > s)
}
for (size_t i = 0; i < ys; i++)
{
- if (d_seq[i] != y.d_seq[i])
+ if (nth(i) != y.nth(i))
{
return false;
}
bool Sequence::hasSuffix(const Sequence& y) const
{
- Assert(d_type == y.d_type);
+ Assert(getType() == y.getType());
size_t s = size();
size_t ys = y.size();
if (ys > s)
size_t idiff = s - ys;
for (size_t i = 0; i < ys; i++)
{
- if (d_seq[i + idiff] != y.d_seq[i])
+ if (nth(i + idiff) != y.nth(i))
{
return false;
}
Sequence Sequence::replace(const Sequence& s, const Sequence& t) const
{
- Assert(d_type == s.d_type);
- Assert(d_type == t.d_type);
+ Assert(getType() == s.getType());
+ Assert(getType() == t.getType());
size_t ret = find(s);
if (ret != std::string::npos)
{
vec.insert(vec.begin(), d_seq.begin(), d_seq.begin() + ret);
vec.insert(vec.end(), t.d_seq.begin(), t.d_seq.end());
vec.insert(vec.end(), d_seq.begin() + ret + s.size(), d_seq.end());
- return Sequence(d_type, vec);
+ return Sequence(getType(), vec);
}
return *this;
}
{
Assert(i >= 0);
Assert(i <= size());
- std::vector<Node> ret_vec;
- std::vector<Node>::const_iterator itr = d_seq.begin() + i;
- ret_vec.insert(ret_vec.end(), itr, d_seq.end());
- return Sequence(d_type, ret_vec);
+ std::vector<Node> retVec(d_seq.begin() + i, d_seq.end());
+ return Sequence(getType(), retVec);
}
Sequence Sequence::substr(size_t i, size_t j) const
Assert(i >= 0);
Assert(j >= 0);
Assert(i + j <= size());
- std::vector<Node> ret_vec;
std::vector<Node>::const_iterator itr = d_seq.begin() + i;
- ret_vec.insert(ret_vec.end(), itr, itr + j);
- return Sequence(d_type, ret_vec);
+ std::vector<Node> retVec(itr, itr + j);
+ return Sequence(getType(), retVec);
}
bool Sequence::noOverlapWith(const Sequence& y) const
{
- Assert(d_type == y.d_type);
+ Assert(getType() == y.getType());
return y.find(*this) == std::string::npos
&& this->find(y) == std::string::npos && this->overlap(y) == 0
&& y.overlap(*this) == 0;
size_t Sequence::maxSize() { return std::numeric_limits<uint32_t>::max(); }
-ExprSequence Sequence::toExprSequence()
-{
- std::vector<Expr> seq;
- for (const Node& n : d_seq)
- {
- seq.push_back(n.toExpr());
- }
- return ExprSequence(d_type.toType(), seq);
-}
-
std::ostream& operator<<(std::ostream& os, const Sequence& s)
{
const std::vector<Node>& vec = s.getVec();
** \brief The sequence data type.
**/
-#include "cvc4_private.h"
+#include "cvc4_public.h"
#ifndef CVC4__EXPR__SEQUENCE_H
#define CVC4__EXPR__SEQUENCE_H
+#include <memory>
#include <vector>
-#include "expr/node.h"
namespace CVC4 {
-class ExprSequence;
+template <bool ref_count>
+class NodeTemplate;
+typedef NodeTemplate<true> Node;
+class TypeNode;
/** The CVC4 sequence class
*
* where each Node in this vector must be a constant.
*/
Sequence() = default;
- explicit Sequence(TypeNode t, const std::vector<Node>& s);
+ explicit Sequence(const TypeNode& t, const std::vector<Node>& s);
+ Sequence(const Sequence& seq);
+
+ ~Sequence();
Sequence& operator=(const Sequence& y);
bool rstrncmp(const Sequence& y, size_t n) const;
/** is this the empty sequence? */
- bool empty() const { return d_seq.empty(); }
+ bool empty() const;
/** is less than or equal to sequence y */
bool isLeq(const Sequence& y) const;
/** Return the length of the sequence */
- size_t size() const { return d_seq.size(); }
+ size_t size() const;
/** Return true if this sequence is a repetition of the same element */
bool isRepeated() const;
size_t roverlap(const Sequence& y) const;
/** get the element type of the sequence */
- TypeNode getType() const { return d_type; }
+ const TypeNode& getType() const;
/** get the internal Node representation of this sequence */
- const std::vector<Node>& getVec() const { return d_seq; }
+ const std::vector<Node>& getVec() const;
/** get the internal node value of the first element in this sequence */
- Node front() const;
+ const Node& front() const;
/** get the internal node value of the last element in this sequence */
- Node back() const;
+ const Node& back() const;
+ /** @return The element at the i-th position */
+ const Node& nth(size_t i) const;
/**
* Returns the maximum sequence length representable by this class.
* Corresponds to the maximum size of d_seq.
*/
static size_t maxSize();
- //!!!!!!!!!!!!!!! temporary
- ExprSequence toExprSequence();
- //!!!!!!!!!!!!!!! end temporary
-
private:
/**
* Returns a negative number if *this < y, 0 if *this and y are equal and a
*/
int cmp(const Sequence& y) const;
/** The element type of the sequence */
- TypeNode d_type;
+ std::unique_ptr<TypeNode> d_type;
/** The data of the sequence */
std::vector<Node> d_seq;
};
#include "expr/dtype.h"
#include "expr/expr.h" // for ExprSetDepth etc..
-#include "expr/expr_sequence.h"
#include "expr/node_manager_attributes.h" // for VarNameAttr
#include "expr/node_visitor.h"
#include "expr/sequence.h"
}
case kind::CONST_SEQUENCE:
{
- const Sequence& sn = n.getConst<ExprSequence>().getSequence();
+ const Sequence& sn = n.getConst<Sequence>();
const std::vector<Node>& snvec = sn.getVec();
if (snvec.size() > 1)
{
#include "api/cvc4cpp.h"
#include "expr/dtype.h"
-#include "expr/expr_sequence.h"
#include "expr/node_manager_attributes.h"
#include "expr/node_visitor.h"
#include "expr/sequence.h"
}
case kind::CONST_SEQUENCE:
{
- const Sequence& sn = n.getConst<ExprSequence>().getSequence();
+ const Sequence& sn = n.getConst<Sequence>();
const std::vector<Node>& snvec = sn.getVec();
if (snvec.empty())
{
Node oval = prev.isConst() ? n : prev;
Assert(oval.getKind() == SEQ_UNIT);
s = oval[0];
- t = cchars[0]
- .getConst<ExprSequence>()
- .getSequence()
- .getVec()[0];
+ t = cchars[0].getConst<Sequence>().getVec()[0];
// oval is congruent (ignored) in this context
d_congruent.insert(oval);
}
"theory/strings/type_enumerator.h"
constant CONST_SEQUENCE \
- ::CVC4::ExprSequence \
- ::CVC4::ExprSequenceHashFunction \
- "expr/expr_sequence.h" \
+ ::CVC4::Sequence \
+ ::CVC4::SequenceHashFunction \
+ "expr/sequence.h" \
"a sequence of characters"
operator SEQ_UNIT 1 "a sequence of length one"
NodeManager* nm = NodeManager::currentNM();
if (node[0].isConst())
{
- std::vector<Expr> seq;
- seq.push_back(node[0].toExpr());
+ std::vector<Node> seq;
+ seq.push_back(node[0]);
TypeNode stype = node[0].getType();
- Node ret = nm->mkConst(ExprSequence(stype.toType(), seq));
+ Node ret = nm->mkConst(Sequence(stype, seq));
return returnRewrite(node, ret, Rewrite::SEQ_UNIT_EVAL);
}
return node;
#ifndef CVC4__THEORY__STRINGS__THEORY_STRINGS_TYPE_RULES_H
#define CVC4__THEORY__STRINGS__THEORY_STRINGS_TYPE_RULES_H
-#include "expr/expr_sequence.h"
#include "expr/sequence.h"
namespace CVC4 {
bool check)
{
Assert(n.getKind() == kind::CONST_SEQUENCE);
- return nodeManager->mkSequenceType(
- n.getConst<ExprSequence>().getSequence().getType());
+ return nodeManager->mkSequenceType(n.getConst<Sequence>().getType());
}
};
{
Assert(type.isSequence());
// empty sequence
- std::vector<Expr> seq;
- return NodeManager::currentNM()->mkConst(ExprSequence(
- SequenceType(type.getSequenceElementType().toType()), seq));
+ std::vector<Node> seq;
+ return NodeManager::currentNM()->mkConst(
+ Sequence(type.getSequenceElementType(), seq));
}
}; /* struct SequenceProperties */
void SeqEnumLen::mkCurr()
{
- std::vector<Expr> seq;
+ std::vector<Node> seq;
const std::vector<unsigned>& data = d_witer->getData();
for (unsigned i : data)
{
}
// make sequence from seq
d_curr = NodeManager::currentNM()->mkConst(
- ExprSequence(d_type.getSequenceElementType().toType(), seq));
+ Sequence(d_type.getSequenceElementType(), seq));
}
StringEnumerator::StringEnumerator(TypeNode type, TypeEnumeratorProperties* tep)
}
else if (tn.isSequence())
{
- std::vector<Expr> seq;
+ std::vector<Node> seq;
return NodeManager::currentNM()->mkConst(
- ExprSequence(tn.getSequenceElementType().toType(), seq));
+ Sequence(tn.getSequenceElementType(), seq));
}
Unimplemented();
return Node::null();
}
else if (k == CONST_SEQUENCE)
{
- std::vector<Expr> seq;
+ std::vector<Node> seq;
TypeNode tn = xs[0].getType();
for (TNode x : xs)
{
Assert(x.getType() == tn);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
const std::vector<Node>& vecc = sx.getVec();
- for (const Node& c : vecc)
- {
- seq.push_back(c.toExpr());
- }
+ seq.insert(seq.end(), vecc.begin(), vecc.end());
}
return NodeManager::currentNM()->mkConst(
- ExprSequence(tn.getSequenceElementType().toType(), seq));
+ Sequence(tn.getSequenceElementType(), seq));
}
Unimplemented();
return Node::null();
}
else if (k == CONST_SEQUENCE)
{
- return x.getConst<ExprSequence>().getSequence().size();
+ return x.getConst<Sequence>().size();
}
Unimplemented() << "Word::getLength on " << x;
return 0;
}
else if (k == CONST_SEQUENCE)
{
- Type t = x.getConst<ExprSequence>().getType();
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
+ TypeNode t = x.getConst<Sequence>().getType();
+ const Sequence& sx = x.getConst<Sequence>();
const std::vector<Node>& vec = sx.getVec();
for (const Node& v : vec)
{
- ret.push_back(nm->mkConst(ExprSequence(t, {v.toExpr()})));
+ ret.push_back(nm->mkConst(Sequence(t, {v})));
}
return ret;
}
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.strncmp(sy, n);
}
Unimplemented();
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.rstrncmp(sy, n);
}
Unimplemented();
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.find(sy, start);
}
Unimplemented();
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.rfind(sy, start);
}
Unimplemented();
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.hasPrefix(sy);
}
Unimplemented();
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.hasSuffix(sy);
}
Unimplemented();
{
Assert(y.getKind() == CONST_SEQUENCE);
Assert(t.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
- const Sequence& st = t.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
+ const Sequence& st = t.getConst<Sequence>();
Sequence res = sx.replace(sy, st);
- return nm->mkConst(res.toExprSequence());
+ return nm->mkConst(res);
}
Unimplemented();
return Node::null();
}
else if (k == CONST_SEQUENCE)
{
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
Sequence res = sx.substr(i);
- return nm->mkConst(res.toExprSequence());
+ return nm->mkConst(res);
}
Unimplemented();
return Node::null();
}
else if (k == CONST_SEQUENCE)
{
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
Sequence res = sx.substr(i, j);
- return nm->mkConst(res.toExprSequence());
+ return nm->mkConst(res);
}
Unimplemented();
return Node::null();
}
else if (k == CONST_SEQUENCE)
{
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
Sequence res = sx.suffix(i);
- return nm->mkConst(res.toExprSequence());
+ return nm->mkConst(res);
}
Unimplemented();
return Node::null();
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.noOverlapWith(sy);
}
Unimplemented();
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.overlap(sy);
}
Unimplemented();
else if (k == CONST_SEQUENCE)
{
Assert(y.getKind() == CONST_SEQUENCE);
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
- const Sequence& sy = y.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
+ const Sequence& sy = y.getConst<Sequence>();
return sx.roverlap(sy);
}
Unimplemented();
}
else if (k == CONST_SEQUENCE)
{
- return x.getConst<ExprSequence>().getSequence().isRepeated();
+ return x.getConst<Sequence>().isRepeated();
}
Unimplemented();
return false;
}
else if (k == CONST_SEQUENCE)
{
- const Sequence& sx = x.getConst<ExprSequence>().getSequence();
+ const Sequence& sx = x.getConst<Sequence>();
const std::vector<Node>& vecc = sx.getVec();
std::vector<Node> vecr(vecc.begin(), vecc.end());
std::reverse(vecr.begin(), vecr.end());
Sequence res(sx.getType(), vecr);
- return nm->mkConst(res.toExprSequence());
+ return nm->mkConst(res);
}
Unimplemented();
return Node::null();