coq-elpi icon indicating copy to clipboard operation
coq-elpi copied to clipboard

Modes ignored on recursive typeclass search

Open Tragicus opened this issue 8 months ago • 2 comments

The modes of a class are ignored during a typeclass search when the solver does a recursive call.

From elpi Require Import elpi tc.

#[mode(i)] TC.Declare Class C (n : nat) := {}.
#[mode(o)] TC.Declare Class D (n : nat) := {c : C n}.

Instance C0 : C 0 := Build_C 0.
Instance DC (n : nat) `{c : C n} : D n := Build_D n c.

Goal exists n, D n.
eexists.
Succeed elpi TC.Solver.

Tragicus avatar Apr 28 '25 13:04 Tragicus