Skip to content

Refactor fake-aterms - #1

Open
lweqx wants to merge 5 commits into
MysaaJava:annotated-termfrom
lweqx:fake-aterm-refactor
Open

lweqx wants to merge 5 commits into
MysaaJava:annotated-termfrom
lweqx:fake-aterm-refactor

Conversation

@lweqx

@lweqx lweqx commented Oct 18, 2026

Copy link
Copy Markdown

This PR refactors fake annotated terms (fake-aterms):

  • by renaming fake-term to fake-aterm
  • into their own file, elpi/fake-aterm.elpi
  • adding code to convert an aterm into a fake-aterm. This is useful for debugging as we can reuse Rocq's pretty printing for terms (fake-aterms are terms) to pretty-print aterms.
  • as well as other miscellaneous improvements

lweqx added 5 commits October 18, 2026 17:47
This utility is called `uvar-to-evar`. Given a unification variable,
it returns a Rocq evar (represented as an ELPI unification variable)
uniquely associated to the unification: if called again on the same
uvar, the same evar will be returned.

`uvar-to-evar` declares no constraints between the uvar or the Rocq
evar, so for instance assigning to the uvar will not result in the
evar being instanciated. Code that make use of this utility can however
declare a constraint.

This utility is mostly useful in code that produce Rocq terms for
debugging purposes: using this utility, uvars can also be represented as
Rocq evars. Unfortunately, Rocq-ELPI cannot create named evars, which
would allow to give the same name to the Rocq evar and the uvar. For
debugging purposes, a mapping between uvars and evars is printed to
Trocq's tracing output.
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.

1 participant