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

Enhance trivial proof tactic #1567

Closed
brianhuffman opened this issue Feb 7, 2022 · 8 comments
Closed

Enhance trivial proof tactic #1567

brianhuffman opened this issue Feb 7, 2022 · 8 comments

Comments

@brianhuffman
Copy link
Contributor

Currently the trivial proof tactic can only discharge proof states with goals of the form EqTrue True (possibly surrounded by some number of Pi quantifiers). It would be good to generalize this a bit. In particular, we should enable it to solve any goal of the form Eq t x x by reflexivity. Note that EqTrue True is definitionally equal to Eq Bit True True, so it is also an instance of reflexivity.

Even better would be to have an extensible set of theorems that could be resolved with proof goals to solve them, of which reflexivity could be one.

@robdockins
Copy link
Contributor

Agreed, I think it would be very nice generalization to enhance trivial to solve instances of reflexivity. It would be even better, I think, to have it solve reflexivity up to conversion (i.e., try to unify the two sides). This would reduce the need for finding exactly which simplification rules will make them look identical.

However, I'm a little more skeptical about adding extensible theorems. That sounds to me like it would be better as a separate tactic.

@brianhuffman
Copy link
Contributor Author

Yeah, maybe the extensibility is a bit overkill for trivial. (The idea was inspired by the . tactic in Isabelle/Isar proofs, which is similarly extensible.) I like the reflexivity-up-to-conversion idea.

@robdockins
Copy link
Contributor

Does scConvertible do the job we want?

@brianhuffman
Copy link
Contributor Author

Not quite. We really want to check whether a term unifies with the pattern Eq ?t ?x ?x modulo convertibility, but scConvertible requires two complete terms, not a term and a pattern.

Unless we want to implement a generic matching- or unification-modulo-convertibility operation, we might need to do something a bit ad-hoc. Probably what we need is to evaluate the goal to whnf (with scWhnf), then check that it's of the form Eq ?t ?x ?y, and finally call scConvertible on the terms that matched ?x and ?y.

@robdockins
Copy link
Contributor

Your second paragraph there was basically what I had in mind, modulo questions about handling free variables from going under Pi binders.

@robdockins
Copy link
Contributor

I guess we could just try to actually build the corresponding proof term and type-check it? That might be easier.

@robdockins
Copy link
Contributor

Some local testing indicates that building a candidate proof term from Refl and checking that it is convertible with the goal will work. I think this should be pretty easy to implement.

@robdockins
Copy link
Contributor

Fixed via #1568

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

2 participants