Skip to content

Feature request: sanitize DK identifiers that are illegal in Rocq #1391

@melanie-taprogge

Description

@melanie-taprogge

Summary

The DK-to-Rocq exporter can emit Rocq declarations whose names are not legal
Rocq identifiers.

In minimal-example.zip, DK accepts a name such as 1_p0, but Rocq cannot parse an identifier starting with a digit.

Steps to reproduce

cd minimal-example
./run.sh

The DK input is:

1_p0 : Type.

Expected behavior

The Rocq exporter should produce a legal fresh Rocq identifier, for example:

Axiom lp_1_p0 : Type.

The exact sanitization scheme is not important, but the generated file should
be accepted by Rocq and should avoid collisions.

Actual behavior

The generated Rocq is:

Axiom 1_p0 : Type.

coqc rejects this file with a syntax error.

Request

Please consider adding Rocq identifier sanitization to the DK-to-Rocq exporter
for names that are legal in Lambdapi/DK but illegal in Rocq.

Observed version

Observed with Lambdapi 3.0.0-72-g1e3b2ba.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions