:- module cse_detection_regression. :- interface. :- import_module bool. :- import_module maybe. :- type struct ---> struct( foo :: maybe(int), bar :: int ). :- func to_bool(struct) = bool. :- implementation. to_bool(Struct0) = Bool :- %Struct = Struct0 ^ bar := 1, Struct0 = struct(Foo, Bar), Struct = struct(Foo, Bar), ( Struct ^ foo = yes(_), Bool = yes ; Struct ^ foo = no, Bool = no ).