Reputation: 951
I'd like to have an axiom which accepts either a nat
or a bool
and returns a nat
. Something like
Axiom poly_axiom {A : Set}: A -> nat.
But Coq refused to accept such a 'polymorphic' axiom. Is there any way to do that?
Irrelevant note: the purpose of defining such a weird axiom is to use poly_axiom to calculate the number of axioms used in term t, where t is of type A and t is 'wrapped' inside poly_axiom. There is another axiom defining how to reduce t inside axiom poly_axiom. It's also welcome to see a better solution to this problem.
Upvotes: 2
Views: 114
Reputation: 12093
Unlike with Definition
s (and Theorem
s, etc.), you cannot write variable names on the left hand side of the colon when declaring Axiom
s. You have to use a forall
like so:
Axiom poly_axiom : forall {A : Set}, A -> nat.
Upvotes: 4