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
Add is_ind, is_constructor, is_proj #195
Conversation
Are those the only kind_of_term left that Ltac can't distinguish via syntax or existing predicates? I wonder if it would be better to have a Coq inductive that mirrors kind_of_term (maybe just with argless constructors?), and just have a "kind of" tactic (in the spirit of "type of") that returns one of those constructors. One could then write "match kind of x with" in Ltac. Of course, one does "match x with" now and picks out distinguishing syntactic structure - but some kinds don't have any. |
We have | Rel of int
| Var of Id.t
| Meta of metavariable
| Evar of 'constr pexistential
| Sort of sorts
| Cast of 'constr * cast_kind * 'types
| Prod of Name.t * 'types * 'types
| Lambda of Name.t * 'types * 'constr
| LetIn of Name.t * 'constr * 'types * 'constr
| App of 'constr * 'constr array
| Const of constant puniverses
| Ind of inductive puniverses
| Construct of constructor puniverses
| Case of case_info * 'constr * 'constr * 'constr array
| Fix of ('constr, 'types) pfixpoint
| CoFix of ('constr, 'types) pcofixpoint
| Proj of projection * 'constr We have Ltac is_sort x :=
lazymatch x with
| Type => idtac
| Set => idtac
| Prop => idtac
| _ => fail 0 "not a sort"
end. You can get You might be able to get Tactic Notation "is_const" ref(x) := idtac. in 8.6, but I'm not sure. This leaves the following
|
Yes - it seems like: |
It will not work for |
So would it make sense to provide is_constant, to avoid fragile implementations of it? |
Probably. I've added a commit to provide |
No description provided.