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

feat: GuessLex: avoid writing sizeOf in termination argument when not needed #3630

Merged
merged 4 commits into from
Mar 10, 2024

Conversation

nomeata
Copy link
Contributor

@nomeata nomeata commented Mar 7, 2024

this makes termination_by? even slicker.

The heuristics is agressive in the non-mutual case (will omit sizeOf
if the argument is non-dependent and the WellFoundedRelation relation
is via sizeOfWFRel.

In the mutual case we'd also have to check the arguments, as they line
up in the termination argument, have the same types. I did not bother at
this point; in the mutual case we omit sizeOf only if the argument
type is Nat.

As a drive-by fix, termination_by? now also works on functions that
have only one plausible measure.

@nomeata nomeata changed the title GuessLex: avoid writing sizeOf in termination argument when not needed feat: GuessLex: avoid writing sizeOf in termination argument when not needed Mar 7, 2024
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Mar 7, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Mar 7, 2024

Mathlib CI status (docs):

  • ❗ Std CI can not be attempted yet, as the nightly-testing-2024-03-07 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Std CI should run now. (2024-03-07 09:59:51)
  • 💥 Mathlib branch lean-pr-testing-3630 build failed against this PR. (2024-03-07 10:25:15) View Log
  • 🟡 Mathlib branch lean-pr-testing-3630 build this PR didn't complete normally. (2024-03-10 10:23:11) View Log
  • ✅ Mathlib branch lean-pr-testing-3630 has successfully built against this PR. (2024-03-10 22:18:07) View Log
  • ✅ Mathlib branch lean-pr-testing-3630 has successfully built against this PR. (2024-03-10 23:23:04) View Log

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc March 7, 2024 10:10 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 7, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 7, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan full-ci labels Mar 7, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc March 7, 2024 10:27 Inactive
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc March 8, 2024 10:25 Inactive
this makes `termination_by?` even slicker.

The heuristics is agressive in the non-mutual case (will omit `sizeOf`
if the argument is non-dependent and the `WellFoundedRelation` relation
is via `sizeOfWFRel`.

In the mutual case we'd also have to check the arguments, as they line
up in the termination argument, have the same types. I did not bother at
this point; in the mutual case we omit `sizeOf` only if the argument
type is `Nat`.

As a drive-by fix, `termination_by?` now also works on functions that
have only one plausible measure.
found a bug along the way, but that requires a larger refactoring to fix
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc March 10, 2024 08:49 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 10, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 10, 2024
nomeata added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 10, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Mar 10, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc March 10, 2024 22:20 Inactive
@nomeata nomeata enabled auto-merge March 10, 2024 22:24
@nomeata nomeata added this pull request to the merge queue Mar 10, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 10, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 10, 2024
Merged via the queue into master with commit 32dcc6e Mar 10, 2024
39 checks passed
@nomeata nomeata deleted the joachim/guesslex-nat branch March 11, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants