// Requires : de.uni-mannheim.rz.krum#jas;2.7.10

import edu.jas.poly.TermOrderByName
import scas.base.
import scas.polynomial.tree.mutable.Polynomial
import jas.PowerProduct
import .given

val r = Polynomial(using , PowerProduct("x", "y", "z")(TermOrderByName.INVLEX))
val List(x, y, z) = r.generators
import r.given

val p = 1 + x + y + z
// val p = 1 + x \ 2147483647 + y \ 2147483647 + z \ 2147483647
// val p = 10000000001l + 10000000001l * x + 10000000001l * y + 10000000001l * z
println("p: " + p.show)
val q = p \ 20
println("q: " + q.size)
val q1 = q + 1
println("q1: " + q1.size)
var t = System.currentTimeMillis();
val q2 = q * q1
t = System.currentTimeMillis() - t;
println("q2: " + q2.size)
println("t: " + t)