CostSimple cost function for an expression
max is the maximum allowed cost of e
raise Exit if the cost is greater than max
continuous operators (up/der) reduce the local cost
since calling a function with continuous state need extra copy code
val expression : Zelus.exp -> int -> bool