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

inhabited_value doesn't really work well #762

Open
andrew-appel opened this issue Mar 22, 2024 · 0 comments
Open

inhabited_value doesn't really work well #762

andrew-appel opened this issue Mar 22, 2024 · 0 comments

Comments

@andrew-appel
Copy link
Collaborator

Ltac inhabited_value, in floyd/deadvars.v, does not work well.

  1. The failure message doesn't work, because Ltac does not allow mixing of failure messages with returning constr results, in some cases. The behavior is that instead of the failure message, we get Expression does not evaluate to a tactic (got a constr).
    This can be fixed by replacing
let t := eval unfold T in T in
         tryif constr_eq t T 
         then fail 3 "cannot prove that type" T "is inhabited... "
         else inhabited_value t

with simply fail 3 "cannot prove.." , but then the extra functionality of unfolding definitions is lost. It's probably worth making the change, though, because otherwise the error message from deadvars is inscrutable.

  1. The tactic really should look up type T to see whether there is anything of type Inhabitant T in the typeclass_instances database, but I don't know how to do that in Ltac. Perhaps it's possible in Ltac2 ?
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