Skip to content

[TC] CS projections replaced with uvar - #648

Closed
FissoreD wants to merge 32 commits into
LPCIC:masterfrom
FissoreD:tc-compile-more-constructors
Closed

[TC] CS projections replaced with uvar#648
FissoreD wants to merge 32 commits into
LPCIC:masterfrom
FissoreD:tc-compile-more-constructors

Conversation

@FissoreD

@FissoreD FissoreD commented Jul 2, 2024

Copy link
Copy Markdown
Collaborator

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

FissoreD commented Jul 2, 2024

Copy link
Copy Markdown
Collaborator Author

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

@gares

gares commented Jul 3, 2024

Copy link
Copy Markdown
Contributor

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

@FissoreD

FissoreD commented Jul 3, 2024

Copy link
Copy Markdown
Collaborator Author

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

gares commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

@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?

@FissoreD

Copy link
Copy Markdown
Collaborator Author

I think this can be closed in favour of #1045

@FissoreD FissoreD closed this Jun 19, 2026
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