I'm working on this problem, where the propositional logic formula is represented by:
datatype fmla =
F_Var of string
| F_Not of fmla
| F_And of fmla * fmla
| F_Or of fmla * fmla
Im trying to write a function that returns the size of a propositional-logic formula. A propositional variable has size 1; logical negation has size 1 plus the size of its sub-formula; logical conjunction and disjunction have size 1 plus the sizes of their sub-formulas.
How would I go about trying to solve this problem?