Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe HOL_ERR should have lazy strings, (unit -> string) list #928

Open
talsewell opened this issue Jul 5, 2021 · 0 comments
Open

Maybe HOL_ERR should have lazy strings, (unit -> string) list #928

talsewell opened this issue Jul 5, 2021 · 0 comments

Comments

@talsewell
Copy link
Contributor

Something I thought of a while ago.

HOL4 error messages tend to be very terse, for instance, if MATCH_MP fails, you might get an error message like "different constructors" with no further details. The Isabelle equivalent would be a TERM exception with the un-matcheable terms attached (TERM has type (string * term list -> exn)). To add that info in HOL4's HOL_ERR, however, the terms would have to be formatted into strings, which is an upfront cost for an exception that will probably be handled and dropped rather than displayed to a user.

I'm not recommending a move to the Isabelle style, there are plenty of advantages to having a single exception, but I'm noting one of the key disadvantages.

However, suppose that HOL_ERR also took a list of additional diagnostic values whose formatting is deferred lazily, i.e. (unit -> string) list. This would allow various failure points to add diagnostic details, with very little upfront cost.

The existing mk_HOL_ERR interface would be left unchanged for compatibility, I assume, and a standard helper for using the pretty-printer to add in terms would be added as another interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant