let rec map f = function | And l -> And(List.map (map f) l) | Or l -> Or(List.map (map f) l) | Not x -> Not(map f x) | Atom a -> Atom(f a) | (True|False) as b -> b