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

refactor: move registration of namespaces on kernel add into elaborator #6214

Open
wants to merge 36 commits into
base: kernel-env-base
Choose a base branch
from

Conversation

Kha
Copy link
Member

@Kha Kha commented Nov 25, 2024

Kernel checking will be moved to a different thread but namespace registration should stay on the elaboration thread

Stacked on #5145

@Kha Kha requested review from leodemoura and tydeu as code owners November 25, 2024 17:13
@Kha Kha changed the base branch from master to kernel-env-base November 28, 2024 13:59
@Kha Kha force-pushed the push-vwrqzpymymss branch 2 times, most recently from 05ab0d9 to d52dfc2 Compare December 3, 2024 13:08
@Kha Kha force-pushed the push-vwrqzpymymss branch 2 times, most recently from d3312a6 to 2a59a24 Compare December 11, 2024 22:33
@Kha Kha force-pushed the push-vwrqzpymymss branch 4 times, most recently from cd7e0a1 to 4aaed4c Compare December 12, 2024 16:07
@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 Dec 12, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Dec 12, 2024

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b862e2d25163584322bcca54e5e56d671da1f258 --onto 48be424eaa2ae06972e9cfec4d355906b532204d. (2024-12-12 16:33:10)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 48eb3084a0e0e15d6c22287d1c17072cbe9f1541 --onto dd6445515ddc71826c76b8020fe9e030579b432b. (2025-01-09 17:13:29)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase c7939cfb03c78820b069ba9c931900d44b11f58e --onto d2c4471cfa4611977bf4927b5cd849df1a4272b7. (2025-01-12 21:50:37)

Kha and others added 10 commits January 8, 2025 12:56
This PR actually prevents Lake from accidentally picking up other
toolchains installed on the machine.

Fixes regression introduced in leanprover#6176
This PR ensures tactics are evaluated incrementally in the body of
`classical`.
This PR fixes and improves the propagator for forall-expressions in the
`grind` tactic.

---------

Co-authored-by: Kim Morrison <[email protected]>
…anprover#6581)

This PR adds the following configuration options to `Grind.Config`:
`splitIte`, `splitMatch`, and `splitIndPred`.
This PR adds support for creating local E-matching theorems for
universal propositions known to be true. It allows `grind` to
automatically solve examples such as:

```lean
example (b : List α) (p : α → Prop) (h₁ : ∀ a ∈ b, p a) (h₂ : ∃ a ∈ b, ¬p a) : False := by
  grind
```
…#6584)

This PR adds helper theorems to implement offset constraints in grind.
This PR fixes a bug in the `grind` canonicalizer.
This PR continues aligning `List/Array/Vector` lemmas, finishing up
lemmas about `map`.
This PR continues aligning `List/Array` lemmas, finishing `filter` and
`filterMap`.
This PR improves the `grind` canonicalizer diagnostics.

---------

Co-authored-by: Kim Morrison <[email protected]>
This PR implements `Std.Net.Addr` which contains structures around IP
and socket addresses.

While we could implement our own parser instead of going through the
`addr_in`/`addr_in6` route we will need to implement these conversions
to make proper system calls anyway. Hence this is likely the approach
with the least amount of non trivial code overall. The only thing I am
uncertain about is whether `ofString` should return `Option` or
`Except`, unfortunately `libuv` doesn't hand out error messages on IP
parsing.
@Kha Kha force-pushed the push-vwrqzpymymss branch from 4aaed4c to c23d6e9 Compare January 9, 2025 16:38
@Kha Kha requested a review from Vtec234 as a code owner January 9, 2025 16:38
@Kha Kha force-pushed the push-vwrqzpymymss branch from c23d6e9 to a384124 Compare January 9, 2025 16:47
…ver#6595)

This PR improves the theorems used to justify the steps performed by the
inequality offset module. See new test for examples of how they are
going to be used.
@Kha Kha force-pushed the push-vwrqzpymymss branch from a384124 to 9f41c1e Compare January 9, 2025 21:15
jrr6 and others added 23 commits January 10, 2025 01:42
This PR adds support for the `simp?` and `dsimp?` tactics in conversion
mode.

Closes leanprover#6164
This PR adds a `toFin` and `msb` lemma for unsigned bitvector division.
We *don't* have `toInt_udiv`, since the only truly general statement we
can make does no better than unfolding the definition, and it's not
uncontroversially clear how to unfold `toInt` (see
`toInt_eq_msb_cond`/`toInt_eq_toNat_cond`/`toInt_eq_toNat_bmod` for a
few options currently provided). Instead, we do have `toInt_udiv_of_msb`
that's able to provide a more meaningful rewrite given an extra
side-condition (that `x.msb = false`).

This PR also upstreams a minor `Nat` theorem (`Nat.div_le_div_left`)
needed for the above from Mathlib.

---------

Co-authored-by: Kim Morrison <[email protected]>
… types (leanprover#6587)

This PR adds decidable instances for the `LE` and `LT` instances for the
`Offset` types defined in `Std.Time`.
…nprover#6347)

This PR adds `BitVec.toNat_rotateLeft` and `BitVec.toNat_rotateLeft`.

---------

Co-authored-by: Kim Morrison <[email protected]>
This PR adds a `toFin` and `msb` lemma for unsigned bitvector modulus.
Similar to leanprover#6402, we don't provide a general `toInt_umod` lemmas, but
instead choose to provide more specialized rewrites, with extra
side-conditions.

---------

Co-authored-by: Kim Morrison <[email protected]>
…prover#6599)

The FFI description didn't mention Int or signed integers.

This PR adds `Int` and signed integers to the FFI document.
Users have requested toolchain tags on `lean4-cli`, so let's add it to
the release checklist to make sure these get added regularly.

Previously, `lean4-cli` has used more complicated tags, but going
forward we're going to just use the simple `v4.16.0` style tags, with no
repository-specific versioning.

---------

Co-authored-by: Markus Himmel <[email protected]>
This PR fixes a bug in the pattern selection in the `grind`.
This PR adds support for case-splitting on `<->` (and `@Eq Prop`) in the
`grind` tactic.
This PR fixes a bug in the `simp_arith` tactic. See new test.
This PR improves the case-split heuristic used in grind, prioritizing
case-splits with fewer cases.
This PR fixes a bug in the `grind` core module responsible for merging
equivalence classes and propagating constraints.
This PR fixes one of the sanity check tests used in `grind`.
This PR adds lemmas about `Array.append`, improving alignment with the
`List` API.
This PR improves the case split heuristic used in the `grind` tactic,
ensuring it now avoids unnecessary case-splits on `Iff`.
This PR improves the usability of the `[grind =]` attribute by
automatically handling
forbidden pattern symbols. For example, consider the following theorem
tagged with this attribute:
```
getLast?_eq_some_iff {xs : List α} {a : α} : xs.getLast? = some a ↔ ∃ ys, xs = ys ++ [a]
```
Here, the selected pattern is `xs.getLast? = some a`, but `Eq` is a
forbidden pattern symbol.
Instead of producing an error, this function converts the pattern into a
multi-pattern,
allowing the attribute to be used conveniently.
This PR allows the dot ident notation to resolve to the current
definition, or to any of the other definitions in the same mutual block.
Existing code that uses dot ident notation may need to have `nonrec`
added if the ident has the same name as the definition.

Closes leanprover#6601
)

This PR implements support for offset constraints in the `grind` tactic.
Several features are still missing, such as constraint propagation and
support for offset equalities, but `grind` can already solve examples
like the following:

```lean
example (a b c : Nat) : a ≤ b → b + 2 ≤ c → a + 1 ≤ c := by
  grind
example (a b c : Nat) : a ≤ b → b ≤ c → a ≤ c := by
  grind
example (a b c : Nat) : a + 1 ≤ b → b + 1 ≤ c → a + 2 ≤ c := by
  grind
example (a b c : Nat) : a + 1 ≤ b → b + 1 ≤ c → a + 1 ≤ c := by
  grind
example (a b c : Nat) : a + 1 ≤ b → b ≤ c + 2 → a ≤ c + 1 := by
  grind
example (a b c : Nat) : a + 2 ≤ b → b ≤ c + 2 → a ≤ c := by
  grind
```

---------

Co-authored-by: Kim Morrison <[email protected]>
@Kha Kha force-pushed the push-vwrqzpymymss branch from 9f41c1e to ffee8e5 Compare January 12, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.