Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction rules for builtins #13

Merged
merged 24 commits into from
Nov 12, 2024
Merged

Introduction rules for builtins #13

merged 24 commits into from
Nov 12, 2024

Conversation

utkn
Copy link
Contributor

@utkn utkn commented Nov 9, 2024

This PR adds the introduction rules for builtins. These reside in Lampe/Hoare/Builtins.lean.

Noteworthy changes:

  • Generic STHoarePureBuiltin abbreviation added. Builtins that are defined with newPureBuiltin or newGenericPureBuiltin can use this to simplify the definition of the rule.
  • Equality, addition, subtraction, multiplication and modulus builtins are converted to manual proofs. This is done because they are special cases that newPureBuiltin constructors do not work with. As a result, the references to these builtins in Syntax.lean are now correct and work with all possible types.
  • Added EqTp and ArithTp types. Those types define the Tps that can be compared with == and can accommodate the infix arithmetic operations +, -, /, * respectively.
  • Arithmetic rules are added to the steps tactic. Note that now we may need to show that ArithTp tp and EqTp tp hold (see Lampe.lean).
  • Documentation to STHoare.lean added that explains our interpretation of the Hoare triplets.

In the proofs, I took care to not use non-terminal simp or simp_all without an only directive.

@utkn utkn added the enhancement New feature or request label Nov 9, 2024
@utkn utkn self-assigned this Nov 9, 2024
@utkn utkn requested a review from kustosz November 9, 2024 12:31
@utkn utkn marked this pull request as ready for review November 9, 2024 12:31
@utkn
Copy link
Contributor Author

utkn commented Nov 11, 2024

The equality and arithmetic builtins were converted back to typed automatic proofs (i.e., using newGenericPureBuiltin and newGenericBuiltin style). Accordingly, the intro rules are now typed, e.g., instead of eq_intro we have fEq_intro, uEq_intro, ... etc.

Copy link
Contributor

@kustosz kustosz left a comment

Choose a reason for hiding this comment

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

Some changes needed but I don't need to re-review

Lampe/Lampe/Builtin/BigInt.lean Show resolved Hide resolved
Lampe/Lampe/Hoare/SepTotal.lean Outdated Show resolved Hide resolved
Lampe/Lampe/Hoare/SepTotal.lean Outdated Show resolved Hide resolved
Lampe/Lampe/Hoare/SepTotal.lean Outdated Show resolved Hide resolved
Lampe/Lampe/Hoare/SepTotal.lean Outdated Show resolved Hide resolved
Lampe/Lampe/Hoare/SepTotal.lean Outdated Show resolved Hide resolved
Lampe/Lampe/Hoare/Total.lean Outdated Show resolved Hide resolved
Lampe/Lampe/Hoare/Total.lean Outdated Show resolved Hide resolved
@utkn utkn merged commit d5c96f2 into main Nov 12, 2024
6 checks passed
@utkn utkn deleted the us/builtin-triplets branch November 12, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants