Add #to_ast to restriction and all predicate objects