[ library(linearize) | Reference Manual | Alphabetic Index ]
quadnorm(?Expression, -Const, -Linear, -Quadratic, -PolyRes, -Residue)
Extracts constant, linear and quadratic part of an arithmetic expression
- Arithmetic expression with constants and variables
- Variable or number
- Variable or normalized linear polynomial
- Variable or normalized quadratic polynomial
- Variable or normalized superquadratic polynomial
- Residual nonpolynomial components in the form AuxVar=Expr
This predicate is a simplified interface to polynorm/3 for the case
where one is only interested in linear and quadratic components.
See polynorm/3 for details.
?- quadnorm(2*5 + 3*(X+5*Y+7)*Z, Const, Lin, Quad, Poly, Res).
X = X
Y = Y
Z = Z
Const = 10
Lin = [[21, Z]]
Quad = [[3, X, Z], [15, Y, Z]]
Poly = 
Res = 
polynorm / 3, linearize / 3