Essentially what the title says. I have the problem that the following returns a list with two indentical elements:
foo (Or [l, r]) = Or [foo r, foo l]
foo (Not f) = Not (foo f)
.....
bar (And [l, r]) = And [foo r, foo l]
bar (Not f) = Not (foo f)
....
combine fm = [fm, foo fm, bar fm]
I suspect that is because I am working "manipulating" the same ast. So I am wondering how/if I can deep copy fm, or if there is a more elegant way of going about this. In this case I want a list with 3 elements where the first one is the original formula, the second one is one where binary disjunctions are swapped and the third one where binary conj. are swapped.
Essentially what the title says. I have the problem that the following returns a list with two indentical elements:
foo (Or [l, r]) = Or [foo r, foo l] foo (Not f) = Not (foo f)
.....
bar (And [l, r]) = And [foo r, foo l] bar (Not f) = Not (foo f)
....
combine fm = [fm, foo fm, bar fm]
I suspect that is because I am working "manipulating" the same ast. So I am wondering how/if I can deep copy fm, or if there is a more elegant way of going about this. In this case I want a list with 3 elements where the first one is the original formula, the second one is one where binary disjunctions are swapped and the third one where binary conj. are swapped.