6 (defun $charsets_polylength
(x)
8 (+ (cp1 (cadr y
)) ;numerator
9 (cp1 (cddr y
))))) ;denominator
12 ;; sum up the sizes of the terms in the rational form polynomial p
13 (if (pcoefp p
) (flatsize p
) ; a constant's length in
16 (do ((i (cdr p
)(cddr i
)))
17 ((null i
) (1+ count
)) ; one more for the variable name
18 (incf count
(flatsize (car i
))) ; length of exponent
19 (incf count
(cp1 (cadr i
))) ; length of coefficient, recursively
25 pl
(x):=charsets_polylength
(x) ;
26 pl
( (2*x^
3*y^
5+3*y
*z^
2)/5) ; 12
31 ;; This is NOT the same as Maple, but I am guessing that it is
32 ;; a satisfactory ranking of complexity for the
33 ;; characteristic set method. RJF