datatype formula = constant of int | variable of string | sum of formula * formula | product of formula * formula;