// We have this enum.
enum Formula {
case proposition(String)
indirect case negation(Formula)
indirect case operation(op: String, lhs: Formula, rhs: Formula)
var nnf: Formula { /* ... */ }
}
// And now ...
switch formula.nnf {
case .proposition(_):
return formula.nnf
case .negation(_):
return formula.nnf
case .operation(_, _, _):
return formula.nnf
}