Return-Path: <John.Harrison-request@cl.cam.ac.uk>
Delivery-Date: 
Received: from leopard.cs.byu.edu (no rfc931) by swan.cl.cam.ac.uk 
          with SMTP (PP-6.5) outside ac.uk; Mon, 13 Jun 1994 17:39:08 +0100
Received: by leopard.cs.byu.edu (1.37.109.8/16.2) id AA22390;
          Mon, 13 Jun 1994 10:34:13 -0600
Sender: hol2000-request@lal.cs.byu.edu
Errors-To: hol2000-request@lal.cs.byu.edu
Precedence: bulk
Received: from irafs1.ira.uka.de by leopard.cs.byu.edu 
          with SMTP (1.37.109.8/16.2) id AA22386;
          Mon, 13 Jun 1994 10:33:01 -0600
Received: from i80fs2.ira.uka.de (actually i80fs2) by irafs1 with SMTP (PP);
          Mon, 13 Jun 1994 16:44:36 +0200
Received: from ira.uka.de by i80fs2.ira.uka.de id <24798-0@i80fs2.ira.uka.de>;
          Mon, 13 Jun 1994 16:51:16 +0200
Date: Mon, 13 Jun 94 16:51:15 EDT
From: reetz <reetz@ira.uka.de>
To: hol2000@leopard.cs.byu.edu
Subject: Improved error messages
Message-Id: <"i80fs2.ira.801:13.05.94.14.51.22"@ira.uka.de>

One might consider improved error messages.
Take e.g. mk_cond. It fails with


Exception raised at Dsyntax.mk_cond:

val it = () : unit

That's it. 

[Frankly, this has already caused me
searching and searching around a lot :-( You
might argue, that if such a ``basic'' error
occurs within your own code, your own code
needs more error checking. However, if you
are still developing your own code, these
``basic'' errors are pretty much normal.]

But there are different reasons for failure,
e.g. #cond might not be of type boolean,
#larm and #rarm might not have the same types.
HOL_ERR might report that.
It would be helpful if HOL_ERR would output 
the terms causing the failure, too. Otherwise,
beside #origin_function and #origin_structure in HOL_ERR,
it might still be hard to localize the error,
because the same routine raising this particular
HOL_ERR might be called a dozens of time and
fail only on one of these cases.
Ideally, the user would see e.g. his terms #cond,
#larm and #rarm and the fitting error message and
- jop! - see the error immediately.
Sometimes, the error message might even give a
hint what to correct...
