(* Signature for creating expressions in x and y. CS 131 Based on code by Kurt M. Dresner and Chris Stone *) signature EXPR = sig type expr (* type of expressions *) (* Expression creation *) (* All expressions should return values in the range [-1,1] when x and y also range over [-1,1]. *) val build_x : expr (* returns the expression for "x" *) val build_y : expr (* returns the expression for "y" *) val build_sinpi : expr -> expr (* creates sine (PI * given expr) *) val build_cospi : expr -> expr (* creates cosine (PI * given expr) *) val build_avg : expr * expr -> expr (* average of the two exprs. *) val build_times : expr * expr -> expr (* product of the two exprs. *) (* Expression evalation at the given (x,y) point *) val eval : expr -> real*real -> real (* Pretty-printer for expressions *) val ppexpr : expr -> unit (* A sample reasonably complicated expression *) val sampleExpr : expr end