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

Inconsistent sorting in Name.cmp #4944

Closed
3 tasks done
joneugster opened this issue Aug 7, 2024 · 3 comments
Closed
3 tasks done

Inconsistent sorting in Name.cmp #4944

joneugster opened this issue Aug 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@joneugster
Copy link
Contributor

joneugster commented Aug 7, 2024

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

The sorting of Names (i.e. in Name.cmp) is unexpected.

Context

From PR leanprover-community/import-graph#18

[Zulip]

Steps to Reproduce

import Lean
open Lean

#reduce Name.cmp `M.A `M.B   -- M.A   < M.B (✓)
#reduce Name.cmp `M.A.B `M.B -- M.A.B > M.B (⨯)

Expected behavior: In the second example, I expect M.A.B < M.B

I expected the following comparison:

  • Compare first part of the name (M == M)
  • Compare second part (A < B) ==> return lt
  • ( ... )

Actual behavior:

  • Compare length of name (3 > 2) ==> returns gt
  • (Compare first part of the name)
  • (Compare second part ...)
  • ( ... )

Versions

4.11.0-rc1

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@mo271
Copy link

mo271 commented Aug 7, 2024

@Kha
Copy link
Member

Kha commented Aug 9, 2024

Triage team agreed on this not being a bug, the function is undocumented and as everything in Lean written for the purposes of Lean. You should create your own ordering function.

@Kha Kha closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2024
@joneugster
Copy link
Contributor Author

ok, thanks for looking at it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants