Check out the CLP(ℤ) library by Markus Triska, who is also the author of Scryer Prolog. It defines new comparison predicates that lets you use bidirectional logical programming on standard integers with standard math operations.
https://github.com/triska/clpz
Markus is not the author of Scryer Prolog, Mark Thom is.
Markus is not the author of Scryer Prolog, Mark Thom is.