reimplemented matchOutputAtom with only pattern compatibility check (including correct variable handling)