nm->mkNode(kind::SINE, nm->mkConstReal(-rat)));
return RewriteResponse(REWRITE_AGAIN_FULL, ret);
}
- }else{
+ }
+ else if ((t[0].getKind() == MULT || t[0].getKind() == NONLINEAR_MULT)
+ && t[0][0].isConst() && t[0][0].getConst<Rational>().sgn() == -1)
+ {
+ // sin(-n*x) ---> -sin(n*x)
+ std::vector<Node> mchildren(t[0].begin(), t[0].end());
+ mchildren[0] = nm->mkConstReal(-t[0][0].getConst<Rational>());
+ Node ret = nm->mkNode(
+ kind::NEG,
+ nm->mkNode(kind::SINE, nm->mkNode(t[0].getKind(), mchildren)));
+ return RewriteResponse(REWRITE_AGAIN_FULL, ret);
+ }
+ else
+ {
// get the factor of PI in the argument
Node pi_factor;
Node pi;
d_data->d_im.addPendingLemma(
lem, InferenceId::ARITH_NL_T_INIT_REFINE, proof);
}
- {
- // sine symmetry: sin(t) - sin(-t) = 0
- Node lem = nm->mkNode(Kind::ADD, t, symn).eqNode(d_data->d_zero);
- CDProof* proof = nullptr;
- if (d_data->isProofEnabled())
- {
- proof = d_data->getProof();
- Node tmplem =
- nm->mkNode(Kind::ADD,
- t,
- nm->mkNode(
- Kind::SINE,
- nm->mkNode(Kind::MULT, d_data->d_neg_one, t[0])))
- .eqNode(d_data->d_zero);
- proof->addStep(
- tmplem, PfRule::ARITH_TRANS_SINE_SYMMETRY, {}, {t[0]});
- proof->addStep(
- lem, PfRule::MACRO_SR_PRED_TRANSFORM, {tmplem}, {lem});
- }
- d_data->d_im.addPendingLemma(
- lem, InferenceId::ARITH_NL_T_INIT_REFINE, proof);
- }
{
// sine zero tangent:
// t > 0 => sin(t) < t