CS421 Bag functions trap

In the bag functions exercise, be careful about using natlist functions which you do not define.

Since your BagFunction.v file defines its own natlist, you cannot just use the natlist functions from the book like app — you would need to copy them into your BagFunction.v, in between the Inductive for natlist and your bag functions.

If you getting strange type error messages (usually involving something about a type list X), it is a sign of forgetting to bring in these definitions to your BagFunction.v. Since you did not define your app on natlist, Coq assumes you mean a different function app, from one of its standard libraries, which uses a different implementation of list (and we will discuss this version of linked lists tomorrow).

See also: CS421 homepage