I try to use the delete list function in the Coq standard library , but it asks for a strange typing, and I don't know how to solve it.
The function I am implementing is to create a list of free variables in lambda terms as follows:
Fixpoint fv (t : trm) : vars :=
match t with
| Var v => [v]
| App t1 t2 => (fv t1) ++ (fv t2)
| Abs x t' => remove x (fv t')
end.
And this gives me the following error:
Error: In environment
fv : trm -> vars
t : trm
x : nat
t' : trm
The term "x" has type "nat" while it is expected to have type
"forall x0 y : ?171, {x0 = y} + {x0 <> y}".
I am sure there is something related to this hypothesis function in the definition of the remove function. I have no idea how to deal with this, but it helps?
source
share