3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Add more PDD utilities (div, pow) (#5180)

* Expose 'inv' on rationals to get reciprocal value

* Align parameter names with implementation

* Add cached operation that divides PDD by a constant

* Fix display for constant PDDs

* operator^ should probably call ^ instead of + (mk_xor instead of add)

* Add helper function 'pow' on PDDs
This commit is contained in:
Jakob Rath 2021-04-14 13:48:42 +02:00 committed by GitHub
parent 2f7069a8b7
commit 324d9ed461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 146 additions and 20 deletions

View file

@ -157,6 +157,12 @@ public:
friend inline rational numerator(rational const & r) { rational result; m().get_numerator(r.m_val, result.m_val); return result; }
friend inline rational denominator(rational const & r) { rational result; m().get_denominator(r.m_val, result.m_val); return result; }
friend inline rational inv(rational const & r) {
rational result;
m().inv(r.m_val, result.m_val);
return result;
}
rational & operator+=(rational const & r) {
m().add(m_val, r.m_val, m_val);