hierarchy-builder icon indicating copy to clipboard operation
hierarchy-builder copied to clipboard

`#[primitive_class]` makes `HB.structure` diverging

Open pi8027 opened this issue 4 years ago • 6 comments

Here is a minimal example, but I couldn't identify the reason:

From HB Require Import structures.

HB.mixin Record M A := {}.
#[primitive_class] HB.structure Definition S := { A of M A }.

pi8027 avatar Jun 24 '21 07:06 pi8027

See also #248

gares avatar Jun 24 '21 07:06 gares

I did not report it upstream. If you have the time, use #[log] to report a HB independent bug.

gares avatar Jun 24 '21 07:06 gares

Maybe it's not the same bug. The other one seems Coq related, this one may be in Coq-Elpi

gares avatar Jun 24 '21 12:06 gares

I agree that these two are not the same bug.

pi8027 avatar Jun 24 '21 17:06 pi8027

It's a loop in my code doing whd

rid:0 step:5029 gid:5514 user:curgoal = whd
(global (const «fix_loop_M_mixin»)) 
[app
  [global (const «eta»), 
   sort (typ «fix_loop.48»), 
   app
    [global (const «sort»), 
     global (const «A»)]], 
 global
  (const «HB_unnamed_factory_2»)] 
(global (indc _)) X24 


rid:0 step:5044 gid:5529 user:curgoal = whd
(global (const «fix_loop_M_mixin»)) 
[app
  [global (const «eta»), 
   sort (typ «fix_loop.48»), 
   app
    [global (const «sort»), 
     global (const «A»)]], 
 global
  (const «HB_unnamed_factory_2»)] 
(global (indc _)) X24 

gares avatar Jun 27 '21 15:06 gares

I found the culprit, I'll fix it but it will take a day or two.

The problem is that I translate to elpi in the same way both the primitive projection and the "compatibility constant". The latter mentions the former, so I build a "cyclic term". I will reuse the primitive term constructor I already have for primitive integers and floats to represent primitive projections.

gares avatar Jun 28 '21 12:06 gares

I don't see this issue anymore, although now I have another issue with #[primitive] or #[primitive_class]. Shall we close it?

pi8027 avatar Sep 14 '23 14:09 pi8027