[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

recognizing an addition expression.



Hi.  

I'd like a predicate, call it add?, which when given a numeric expression 
determines if the top-level operation in that expression is addition.

here's some examples: 

add?(1 + 1) = T 
add?((1 + 1) - 2) = F 
add?((1 + 1) + 2) = T 

I am stuck.  Can it be done?  how? 

thanks,
mike jones
mjones@cs.utah.edu