I want to write a predicate that takes these arguments: predicate(X, Y). predicate(X, (Y, Z)). (Second parameter can be an atom or a pair). Is it possible to do this only by pattern matching?
You cannot specify that a parameter is atomic using just pattern matching; you'd need a predicate to test for this.