Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreynol committed Feb 24, 2025
1 parent a577f28 commit d0e049d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/theory/builtin/generic_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "theory/datatypes/project_op.h"
#include "theory/datatypes/theory_datatypes_utils.h"
#include "util/bitvector.h"
#include "util/divisible.h"
#include "util/floatingpoint.h"
#include "util/iand.h"
#include "util/rational.h"
Expand Down Expand Up @@ -55,7 +56,7 @@ bool GenericOp::operator==(const GenericOp& op) const

bool GenericOp::isNumeralIndexedOperatorKind(Kind k)
{
return k == Kind::REGEXP_LOOP || k == Kind::BITVECTOR_EXTRACT
return k == Kind::DIVISIBLE || k == Kind::REGEXP_LOOP || k == Kind::BITVECTOR_EXTRACT
|| k == Kind::BITVECTOR_REPEAT || k == Kind::BITVECTOR_ZERO_EXTEND
|| k == Kind::BITVECTOR_SIGN_EXTEND || k == Kind::BITVECTOR_ROTATE_LEFT
|| k == Kind::BITVECTOR_ROTATE_RIGHT || k == Kind::INT_TO_BITVECTOR
Expand Down Expand Up @@ -86,6 +87,12 @@ std::vector<Node> GenericOp::getIndicesForOperator(Kind k, Node n)
std::vector<Node> indices;
switch (k)
{
case Kind::DIVISIBLE:
{
const Divisible& op = n.getConst<Divisible>();
indices.push_back(nm->mkConstInt(Rational(op.k)));
break;
}
case Kind::REGEXP_LOOP:
{
const RegExpLoop& op = n.getConst<RegExpLoop>();
Expand Down Expand Up @@ -283,6 +290,9 @@ Node GenericOp::getOperatorForIndices(NodeManager* nm,
}
switch (k)
{
case Kind::DIVISIBLE:
Assert(numerals.size() == 1);
return nm->mkConst(Divisible(numerals[0]));
case Kind::REGEXP_LOOP:
Assert(numerals.size() == 2);
return nm->mkConst(RegExpLoop(numerals[0], numerals[1]));
Expand Down

0 comments on commit d0e049d

Please sign in to comment.