HELP! Exclusive-OR help needed

From: Mark (coconutpete_at_hotmail.com)
Date: 05/09/04


Date: 9 May 2004 13:42:14 -0700

Hi all, I need some help creating an exclusive-or rule in prolog. Im
trying to create a rule that attempts to parse a sentence, if it can
(i.e. true) then prints out the parsed sentence, otherwise ONLY print
out a brief statement saying that parsing was unsuccessful.

If it isnt true it works fine, but if the sentence is parsed it prints
out both of the rules. Could anyone tell me where i am going wrong
please?

(
  (sent(Parse,Input,[]),write(Parse),nl,match_rule(Input))
  ;
  (write('Sentence could not be parsed'),match_rule(Input))
).

Thanks in advance