Using polymorphic functions in definitions
1
Following my question here, I have several functions with different types of arguments which I defined the Inductive type formula on them. Is there anyway to use Inductive formula in compute_formula . I am doing this to make proving easier by decreasing the number of constructors that I have to handle in proofs. Thank you. Fixpoint add (n:type1) (m:type2): type3 := match n with (*body for add*) end. Fixpoint mul (n:type1) (m:type4): type5 := match n with (*body for mul*) end. Inductive formula : Type := | Formula {A B}: type1-> A -> (type1->A->B) -> formula. (* How should I write this *) Definition compute_formula {A B} (f: formula) (extraArg:A) : B := match f with |Formula {A B} part1 part2 part3=> if (A isof type2 && B isof type3) then ...