Conversation
YaelDillies
commented
Feb 17, 2025
PR summary e2a5eb5f68
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Util.Qq | 21 | 2 | -19 (-90.48%) |
Import changes for all files
| Files | Import difference |
|---|---|
| There are 3056 files with changed transitive imports taking up over 135469 characters: this is too many to display! | |
You can run scripts/import_trans_difference.sh all locally to see the whole output. |
Declarations diff
+ intLitQq?
+ natLitQq?
+ rawIntLit!
+ rawIntLit?
+ rawNatLit!
+ rawNatLit!_lit_natVal
You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for script/declarations_diff.sh contains some details about this script.
No changes to technical debt.
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
|
|
||
| See `Qq.natLitQq?` for a Qq version of this that also handles non-raw literals. | ||
|
|
||
| Note this is equivalent to `Lean.Expr.natLit!`, which is misnamed. -/ |
There was a problem hiding this comment.
Can you just rename this? It's in Batteries not core.
| /-- Returns the integer from a raw integer literal expression, or `none` if the expression isn't | ||
| a raw integer literal. |
There was a problem hiding this comment.
I claim this is not something you ever need to do. "Raw integer literal expression" is a concept from only within norm_num, where you get handed the cases separately anyway.
There was a problem hiding this comment.
"this" = "using this function"? Then what should I replace it with in the Qq function?
There was a problem hiding this comment.
What do you need the Qq function for?
There was a problem hiding this comment.
Paul wanted it to extract10 from Int.divisorsAntidiag 10
There was a problem hiding this comment.
There you don't have a "raw integer literal" anyway, you can match on OfNat.ofNat (nat_lit n) and -OfNat.ofNat (nat_lit n)
| def natLitQq? : Q(Nat) → MetaM (Option Nat) | ||
| | ~q(OfNat.ofNat $n) => pure n.rawNatLit? | ||
| | e => pure e.rawNatLit? |
There was a problem hiding this comment.
While this seems like a nice enough thing to have, we already have a baffling number of these, and I don't see why your use case needs your new one when previous ones didn't.
There was a problem hiding this comment.
Uh that's terrible. They all look misnamed
There was a problem hiding this comment.
Do you agree that it would be worth unifying all these?
There was a problem hiding this comment.
I think they all do various amounts of post-processing (raw / non-raw, numeral / succ / zero, etc).
For the purpose of the first version your simproc, I think it's fine to support only positive numerals for now, where you can just copy the approach I used for the prime factors simproc.
|
Looks like I don't need this anymore |