Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] trivial ltac question

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] trivial ltac question


chronological Thread 
  • From: S�bastien Hinderer <Sebastien.Hinderer AT loria.fr>
  • To: Dan Synek <synek AT cs.ru.nl>
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] trivial ltac question
  • Date: Tue, 21 Sep 2004 12:02:02 +0200
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hi Dan,

> How do I rewrite this code so that the error message gets returned?
> Lemma F:False.
> match goal with
>   | _ => fail "error message"
> end.
> (It prints the following error message:
> User error: No matching clauses for match goal
> )
> thanks

To print an error message, you can use
idtac "Error!"
It is not very elegant but it's the only solution I know.
If I recall correctly, the problem with fail is that it makes the matching
fail, too. Then, due to Coq's backtracking features, the system looks for a
new pattern to match the goal. Since none is found, the message you gave is
displayed.
Using idtac should solve all this.

Hope this helps,
Sébastien.




Archive powered by MhonArc 2.6.16.

Top of Page