Skip to content

Conversation

@FissoreD
Copy link
Collaborator

@FissoreD FissoreD commented Jul 2, 2024

If a subterm is a (primitive) projection, it is replaced with fresh elpi variable
This variable and the original subterm are related by the coq.unify-eq predicate, to ensure
that each subterm of a class call correctly unifies with the corresponding subterm in the instance.

Here the test for this PR

@FissoreD
Copy link
Collaborator Author

FissoreD commented Jul 2, 2024

Note that the compilation with uvar for projections in this PR only addresses instances compilation

@gares
Copy link
Contributor

gares commented Jul 3, 2024

I'm a bit lost, the test passes but I don't see how the new term constructor is compiled... miracle? 😀

@FissoreD
Copy link
Collaborator Author

FissoreD commented Jul 3, 2024

The precompilator transforms a term like app[X|T] (when X is a proj) into tc.canonical-projection (app [X|T]) S N (S is the list of free vars in app[X|T] and N the arg number of the record).
Here I recognize a proj and build the new subterm tc.canonical-projection. Note that I also output +1 for the number of uvar the rule I'm building needs (the last parameter of the clause head is: (s A)).


Here I decompile tc.canonical-projection (during the elpi's rule creation): I replace the sub-term with a fresh elpi-var V (that I have charge with pi earlier) and create the new premise coq.unify-eq (app[X|T]) V ok.


Am I clarifying your remark ?

@FissoreD FissoreD force-pushed the tc-compile-more-constructors branch 3 times, most recently from 3eceb49 to 78c7545 Compare July 12, 2024 12:14
@FissoreD FissoreD force-pushed the tc-compile-more-constructors branch from b1c455e to ad0b8dc Compare July 22, 2024 09:07
@FissoreD FissoreD force-pushed the tc-compile-more-constructors branch from dc047a6 to f348d07 Compare August 20, 2024 09:37
@FissoreD FissoreD force-pushed the tc-compile-more-constructors branch from a015aeb to 7a07b58 Compare September 2, 2024 09:20
@FissoreD FissoreD force-pushed the tc-compile-more-constructors branch 2 times, most recently from e140d15 to 25de1d1 Compare September 30, 2024 11:47
FissoreD and others added 12 commits October 2, 2024 13:21
@gares gares force-pushed the tc-compile-more-constructors branch from a9d89b5 to 7986110 Compare October 2, 2024 11:21
@gares
Copy link
Contributor

gares commented Oct 3, 2024

@CohenCyril this job https://github.com/LPCIC/coq-elpi/actions/runs/11143050022/job/30967371306?pr=648
indicated that I'm using elpi 1.19.2 but in the nix config i chose 1.19.5. What am I missing?

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

Successfully merging this pull request may close these issues.

2 participants