I need a predicate elements(X,L) where X is an operation like neg X, X and Y and returns a list L with all the elements from the operation, like [X,Y].
I already have these:
elements(neg X, [X]).
elements(X and Y, [X,Y]).
elements(X or Y, [X,Y]).
elements(X imp Y, [X,Y]).
But I don´t know how to make it work with complex operations like X imp (Y or Z).