mattam82 / Coq-Equations

A function definition package for Coq
http://mattam82.github.io/Coq-Equations
GNU Lesser General Public License v2.1
223 stars 44 forks source link

Derive DependentElimination produces an anomaly #200

Open eponier opened 5 years ago

eponier commented 5 years ago

On Coq 8.9, with coq-equations version 1.2 beta2,

From Equations Require Import Equations.
Require Import Vector.

Derive DependentElimination for t.

Anomaly "Uncaught exception Reduction.NotArity."

This seems to occur when the inductive type has parameters. It does not happen where there is no parameter:

Inductive t : nat -> Type :=
  | nil  : t 0
  | cons : forall n, nat -> t n -> t (S n).

Derive DependentElimination for t.

or when the parameter is added as a section variable:

Section test.

Variable A : Type.

Inductive t : nat -> Type :=
  | nil  : t 0
  | cons : forall n, A -> t n -> t (S n).

Derive DependentElimination for t.

End test.
eponier commented 5 years ago

By the way, strangely, the opam package version "1.2 beta2" is considered older than the version "1.2 beta", but no sure that it can be modified now it has been released.

mattam82 commented 4 years ago

Indeed, that's a bug in the Derive code, still to investigate. However, for vectors you shouldn't need that instance, the default dependent eliminator of vectors produced by Coq is enough.