let rec fold f a e =
match d_interp a with
| Some(Sym.Const(_), []) -> e
| Some(Sym.Sub(_,_,_), [x]) -> fold f x e
| Some(Sym.Conc(_,_), [x;y]) -> fold f x (fold f y e)
| Some(Sym.Bitwise(_), [x;y;z]) -> fold f x (fold f y (fold f z e))
| _ -> f a e