Open FissoreD opened 1 week ago
A possible solution:
Note however, in the example below, not adding the premise, would produce a sealed goal:
Structure ofe := Ofe { ofe_car : Type; }.
Class D (I : ofe).
Class C (X : ofe) (I : D X).
Definition ofe_nat : ofe := Ofe nat.
Instance c : forall (H : D (Ofe nat)), C ofe_nat H := {}.
Goal forall (H : D ofe_nat), True -> exists H, C (ofe_nat) H.
intros.
notypeclasses refine (ex_intro _ _ _ ).
apply _.
Unshelve. (* Here the shelved goal `D ofe_nat` *)
auto.
Abort.
Another way to see it could be: if I'm solving a rule and the rule has a rigid solution, then I succeed immediately without looking at the premises
In the following example, The class
C
has a parameter of type class. The instancec
would produce the premiseD (Ofe nat)
, however, as shown in the goal (activate the elpi tracer to see it), the unification ofC (ofe_nat) H
would produce the recursive callD (Ofe nat) H
whereH
is a ground term: here we have 2 potential problems:as in the example, this may cause further unification problems (elpi can't unify
D ofe_nat
withD (Ofe nat)
)End CS7.