Skip to content

Comments

Fix syntax error on Rocq output by using a better printing system#59

Open
jrosain wants to merge 15 commits intoGoelandProver:masterfrom
jrosain:fix-rocq-output
Open

Fix syntax error on Rocq output by using a better printing system#59
jrosain wants to merge 15 commits intoGoelandProver:masterfrom
jrosain:fix-rocq-output

Conversation

@jrosain
Copy link
Member

@jrosain jrosain commented Jul 29, 2025

Bug fix

Closes: #52

Description

In this PR, I got rid of the non-understandable gibberish that was MappableString (and besides, that was not mappable) and replaced it with a modular & composable Printer system.

A Printer takes a PrinterConnectives (that specify how to print all possible connectives) that always has a fallback on a specified PrinterConnective (or, if unspecified, the default one). It means that a PrinterConnective can avoid defining all the connectives, and only the ones that are relevant to it.

A Printer is also composed of a PrinterAction, that defines a bunch of functions, one that is always called for every string it returns, one that is called for IDs, for bound variables, for meta variables and for types. In particular, it makes it possible to define general-purpose PrinterAction and compose it through others actions. I've added the PrinterAction that gets rid of irrelevant parentheses. I've also gotten rid of the printing of ids by default (because a PrinterAction is additive and not subtractive: it's difficult to undo something already done like printing unique indices of ids). I've still left the option with -print-id. Anyway, I think it's better this way. I've also defined the PrettyPrinter and the printer action that quotes functional names if needed.

I've also reworked Rocq's printer so that it gets rid of unwanted characters (like the @ in skolem symbols) and replaces defined constants with $... to the value we want them to have in Rocq. I've integrated Rocq compilation inside the test-suite workflow: an eligible problem gets its proof compiled in Rocq. By eligible, I mean every problem that returns valid and doesn't already outputs something. Some problems got in the no_chk folder (/ bugs_no_chk) because the proof wasn't compiling (see #56).

Typed proofs are not available through GS3, so I've designed a test but put it in the bugs_no_chk for now but it should be moved later.

I'm also pretty sure I've broken Lambdapi's output but this is work for another PR.

PR dependencies

Test-suite update

I've also updated the run-test-suite file to rocq compile the proofs and to make its output clearer, and updated the CI script that runs the test suite to install Rocq.

@github-actions github-actions bot added the needs:ci Needs a CI run before merging label Jul 29, 2025
@jrosain jrosain added kind:enhancement New feature or upgrade of a previous one kind:cleanup Refactoring or improvement of existing code kind:fix The PR fixes a bug has:other-pr-dependency This PR cannot be merged before another PR (the maintainer should specify the dependency(ies)) part:rocq-output About the certified output in Rocq request:ci Requests a CI run from the workflow labels Jul 29, 2025
@github-actions github-actions bot removed the request:ci Requests a CI run from the workflow label Jul 29, 2025
@jrosain jrosain added this to the 1.2 milestone Jul 29, 2025
@jrosain jrosain changed the title Fix rocq output Fix syntax error on Rocq output by using a better printing system Jul 29, 2025
@github-actions github-actions bot removed the needs:ci Needs a CI run before merging label Jul 29, 2025
@jrosain jrosain requested a review from jcailler August 25, 2025 11:07
@jrosain jrosain added the needs:rebase When the PR needs to get rebased in order to get merged label Sep 1, 2025
@github-actions github-actions bot added the needs:ci Needs a CI run before merging label Oct 5, 2025
@jrosain jrosain added request:ci Requests a CI run from the workflow and removed needs:rebase When the PR needs to get rebased in order to get merged labels Oct 5, 2025
@github-actions github-actions bot removed needs:ci Needs a CI run before merging request:ci Requests a CI run from the workflow labels Oct 5, 2025
@github-actions github-actions bot added the needs:ci Needs a CI run before merging label Oct 5, 2025
@jrosain jrosain added the request:ci Requests a CI run from the workflow label Oct 5, 2025
@github-actions github-actions bot removed needs:ci Needs a CI run before merging request:ci Requests a CI run from the workflow labels Oct 5, 2025
@github-actions github-actions bot added the needs:ci Needs a CI run before merging label Oct 5, 2025
@jrosain jrosain added the request:ci Requests a CI run from the workflow label Oct 5, 2025
@github-actions github-actions bot removed the request:ci Requests a CI run from the workflow label Oct 5, 2025
@github-actions github-actions bot added the needs:ci Needs a CI run before merging label Oct 5, 2025
@jrosain jrosain added the request:ci Requests a CI run from the workflow label Oct 5, 2025
@github-actions github-actions bot removed request:ci Requests a CI run from the workflow needs:ci Needs a CI run before merging labels Oct 5, 2025
@github-actions github-actions bot added the needs:ci Needs a CI run before merging label Oct 8, 2025
@jrosain jrosain added the request:ci Requests a CI run from the workflow label Oct 8, 2025
@github-actions github-actions bot removed request:ci Requests a CI run from the workflow needs:ci Needs a CI run before merging labels Oct 8, 2025
@jcailler
Copy link
Member

jcailler commented Jan 25, 2026

The following problems produces an error when trying to export the Rocq proof in inner skolemization:

  • SYN325
  • SYN340
  • SYN341
  • SYN369
  • SYN947

@jrosain
Copy link
Member Author

jrosain commented Feb 7, 2026

The following problems produces an error when trying to export the Rocq proof in inner skolemization:

* `SYN325`
* `SYN340`
* `SYN341`
* `SYN369`
* `SYN947`

This is actually a bug introduced by #46, but nice catch!

@github-actions github-actions bot added the needs:ci Needs a CI run before merging label Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has:other-pr-dependency This PR cannot be merged before another PR (the maintainer should specify the dependency(ies)) kind:cleanup Refactoring or improvement of existing code kind:enhancement New feature or upgrade of a previous one kind:fix The PR fixes a bug needs:ci Needs a CI run before merging part:rocq-output About the certified output in Rocq

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Syntax error in Rocq output due to illegal character in skolem symbols / types

2 participants