Skip to content

convenience methods for division expressions #6806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/util/std_expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,30 @@ class mod_exprt:public binary_exprt
: binary_exprt(std::move(_lhs), ID_mod, std::move(_rhs))
{
}

/// The dividend of a division is the number that is being divided
exprt &dividend()
{
return op0();
}

/// The dividend of a division is the number that is being divided
const exprt &dividend() const
{
return op0();
}

/// The divisor of a division is the number the dividend is being divided by
exprt &divisor()
{
return op1();
}

/// The divisor of a division is the number the dividend is being divided by
const exprt &divisor() const
{
return op1();
}
};

template <>
Expand Down Expand Up @@ -1215,6 +1239,30 @@ class euclidean_mod_exprt : public binary_exprt
: binary_exprt(std::move(_lhs), ID_euclidean_mod, std::move(_rhs))
{
}

/// The dividend of a division is the number that is being divided
exprt &dividend()
{
return op0();
}

/// The dividend of a division is the number that is being divided
const exprt &dividend() const
{
return op0();
}

/// The divisor of a division is the number the dividend is being divided by
exprt &divisor()
{
return op1();
}

/// The divisor of a division is the number the dividend is being divided by
const exprt &divisor() const
{
return op1();
}
};

template <>
Expand Down