%mathpiper,def="VerifyDiv"

VerifyDiv(_u,_v) <--
[
  Local(q,r);
  q:=Quotient(u,v);
  r:=Rem(u,v);

  Verify(Expand(u),Expand(q*v+r));
];

%/mathpiper




%mathpiper_docs,name="VerifyDiv",categories="Programmer Functions;Testing"
*CMD VerifyDiv --- Special purpose arithmetic verifiers
*STD
*CALL
	VerifyDiv(u,v)

*PARMS

{u}, {v} -- integer arguments

*DESC

{VerifyDiv(u,v)} checks that
$$ u = v*Quotient(u,v) + Modulo(u,v) $$.


*E.G.

In> VerifyDiv(x^2+2*x+3,x+1)
Result: True;
In> VerifyDiv(3,2)
Result: True;

*SEE Verify, VerifyArithmetic, RandVerifyArithmetic, VerifyDiv, CanProve, KnownFailure, TestMathPiper, LogicVerify, LogicTest

%/mathpiper_docs