linux3.gl.umbc.edu> sml Standard ML of New Jersey, Version 110.0.7, September 28, 2000 val use = fn : string -> unit - use "poly.sml"; [opening poly.sml] datatype termType = pair of real * int val termAdd = fn : termType * termType -> termType val termPlusPoly = fn : termType * termType list -> termType list GC #0.0.0.0.1.16: (0 ms) val polyPlusPoly = fn : termType list * termType list -> termType list val isZero = fn : termType list -> bool val printTerm = fn : termType -> unit val printPoly = fn : termType list -> unit val poly1 = [pair (3.0,4),pair (5.0,3),pair (1.0,2),pair (4.0,0)] : termType list 3.0X^4+5.0X^3+1.0X^2+4.0 val it = () : unit val poly2 = [pair (4.0,5),pair (2.0,1)] : termType list 4.0X^5+2.0X val it = () : unit val poly3 = [pair (~2.0,2),pair (3.0,1),pair (6.0,0)] : termType list ~2.0X^2+3.0X+6.0 val it = () : unit val poly4 = [pair (0.0,0)] : termType list 0.0 val it = () : unit p1+p2 isval it = () : unit 4.0X^5+3.0X^4+5.0X^3+1.0X^2+2.0X+4.0 val it = () : unit GC #0.0.0.1.2.70: (0 ms) p3+p4 isval it = () : unit ~2.0X^2+3.0X+6.0 val it = () : unit p2+p3 isval it = () : unit 4.0X^5~2.0X^2+5.0X+6.0 val it = () : unit is poly1 zero?val it = () : unit val it = false : bool is poly2 zero?val it = () : unit val it = false : bool is poly3 zero?val it = () : unit val it = false : bool is poly4 zero?val it = () : unit val it = true : bool val it = () : unit - Suspended linux3.gl.umbc.edu>