Skip to content

Changed reduction to mirror behaviour of native Rocq encodings#64

Merged
fblanqui merged 6 commits into
Deducteam:masterfrom
melanie-taprogge:rocq-compatible-version
Jul 8, 2026
Merged

Changed reduction to mirror behaviour of native Rocq encodings#64
fblanqui merged 6 commits into
Deducteam:masterfrom
melanie-taprogge:rocq-compatible-version

Conversation

@melanie-taprogge

Copy link
Copy Markdown
Contributor

This PR adapts the Lambdapi standard library to make its definitions more directly compatible with Rocq’s native reduction behavior during export.

Main changes:

  • Adjusted selected rewrite rules in Bool, Nat, List, Pos, and Z so they match the symbolic computation performed by the corresponding Rocq primitives.
  • Updated affected Lambdapi proofs so the stdlib still checks with the revised reduction behavior.
  • Collected the removed compatibility reductions in Reduction.lp; these correspond to equalities proved in the relevant stdlib files and can be required explicitly by Lambdapi developments that need the former computational behavior.

- removed Rocq incompatible rewrite rules
- fixed proofs
- moved the rules to dedicated file Reduction.lp

@fblanqui fblanqui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Melanie. Just a few details to change.

Comment thread Z.lp Outdated
Comment thread Z.lp Outdated
Comment thread ExtraRules.lp
@melanie-taprogge

Copy link
Copy Markdown
Contributor Author

Thank you Melanie. Just a few details to change.

Good catches, thank you! I made the changes.

Comment thread CHANGES.md Outdated
### Changed

- Removed/ changed rewrite rules to match the native Rocq encodings
- Reintroduced the original rules in Reduction.lp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Melanie. I propose to have only one line: moved the rewrite rules that do not derive from the Rocq Stdlib definition to the file ExtraRules.lp.

Comment thread ExtraRules.lp
The rules given here all correspond to proved equalities in their corresponding file.
They were removed to increase the compatibility with native Rocq encodings.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to rename the file to ExtraRules.lp and move the require commands as follows:

// rules from Bool

require Stdlib.Bool as B;

rule _ B.or B.true  ↪ B.true
with $b B.or B.false ↪ $b;

// rules from Nat

require Stdlib.Nat as N;

...

@fblanqui

fblanqui commented Jul 8, 2026

Copy link
Copy Markdown
Member

There are warnings related to Deducteam/lambdapi#1433.

@fblanqui fblanqui merged commit e8a9310 into Deducteam:master Jul 8, 2026
2 checks passed
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