Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[primitive_class] makes HB.structure diverging #254

Closed
pi8027 opened this issue Jun 24, 2021 · 7 comments
Closed

#[primitive_class] makes HB.structure diverging #254

pi8027 opened this issue Jun 24, 2021 · 7 comments

Comments

@pi8027
Copy link
Member

pi8027 commented Jun 24, 2021

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 }.
@gares
Copy link
Member

gares commented Jun 24, 2021

See also #248

@gares
Copy link
Member

gares commented Jun 24, 2021

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

@gares
Copy link
Member

gares commented Jun 24, 2021

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

@pi8027
Copy link
Member Author

pi8027 commented Jun 24, 2021

I agree that these two are not the same bug.

@gares
Copy link
Member

gares commented Jun 27, 2021

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
Copy link
Member

gares commented Jun 28, 2021

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.

@pi8027
Copy link
Member Author

pi8027 commented Sep 14, 2023

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

@pi8027 pi8027 closed this as completed Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants