profile
viewpoint
Gabriel Ebner gebner Carnegie Mellon University Amstelveen, Holland https://gebner.org/

blanchette/logical_verification_2020 88

Companion files for Logical Verification 2020–2021 at VU Amsterdam

avigad/mathematics_in_lean_source 16

Source code for the Mathematics in Lean tutorial.

gebner/dali-usb 9

Firmware for a DALI-USB adapter using an ATtiny45.

gebner/compiz-cms 5

Color management in compiz.

charringer/bbc65j1 3

Objektorientierte Programmierung 2010W - Aufgabe 6

charringer/bbc65j2 3

Objektorientierte Programmierung 2010W - Aufgabe 7

charringer/bbc65j3 3

Objektorientierte Programmierung 2010W - Aufgabe 7

gebner/dali-usb-host 3

Host utilities for my DALI-USB adapter

charringer/rctp 2

Rubik's Cube Toy Project

gebner/avm2017_tutorial 2

Materials for the Lean tutorial at the Alpine Verification Meeting 2017

issue commentleanprover/lean4

Finish implementation of "document highlight" request

That would be great for many many requests, but I don't think there's anything we can do other than to wait for editors to finally implement support for partial results. To be honest, I kind of hoped that VS Code would before people started to write complicated files in Lean 4. Does Neovim?

Not that I know of. I couldn't even find an issue in the bug tracker.

For "find references" etc. result streaming is really useful, since you do the request once and expect results outside of the currently shown part of the file. But for document highlights I think sending just the current state should be okay; the request is repeated every time you move the cursor and the results are primarily shown in the currently visible text. It's certainly more useful to have some results immediately than to have the complete results a minute or two later. If we wait for the whole file, then you'll never see the highlights in normal usage.

Kha

comment created time in 5 minutes

push eventgebner/lean4

Gabriel Ebner

commit sha 2ce88ad013ad04879f3bcdafb6638c103f8313d4

fix: provide reference implementation for `Array.modify`

view details

push time in 13 hours

pull request commentleanprover/lean4

chore: show declaration with sorry in `#eval`

Unfortunately this doesn't help with compiled code.

gebner

comment created time in 13 hours

PR opened leanprover/lean4

chore: show declaration with sorry in `#eval`

Tomas complained on Zulip that it is hard to figure out which sorry makes #eval fail. If you have many sorrys in proofs, then it becomes hard to find the sorry in a definition which prevents evaluation.

This PR adds the name of the declaration containing sorry to the error message from #eval, and should make this search much easier. In the case of #eval (sorry : Nat), the error message shows _eval._lambda_1, which is not ideal but probably still clear enough for users to understand

+8 -7

0 comment

5 changed files

pr created time in 13 hours

Pull request review commentleanprover/lean4

fix: provide reference implementation for `Array.modify`

 def shrink (a : Array α) (n : Nat) : Array α :=   loop (a.size - n) a  @[inline]-def modifyM [Monad m] [Inhabited α] (a : Array α) (i : Nat) (f : α → m α) : m (Array α) := do+unsafe def modifyMUnsafe [Monad m] (a : Array α) (i : Nat) (f : α → m α) : m (Array α) := do   if h : i < a.size then     let idx : Fin a.size := ⟨i, h⟩     let v                := a.get idx-    let a'               := a.set idx default+    let a'               := a.set idx (unsafeCast ())     let v ← f v

The situation is different at mapUnsafe, we are storing a valid element in the array in the map.

It is only superficially different since we do (unsafeCast as : Array NonScalar) at the beginning of mapMUnsafe. After type erasure they both do the same thing and write box(0) to the array. I can add a comment to both of the functions if you want.

My concern is that box(0) may not be a valid element of the type, but this is not an issue for our current runtime. We should add a comment saying that the correctness of the code relies on the fact that the runtime uses a "generic" deletion procedure and it doesn't matter whether the array contains invalid elements or not.

Are you thinking of an implementation where Array can have different runtime representations depending on how it was constructed? (Like we had e.g. for list expr in Lean 3.)

I'm not sure if that would ever be a convenient API. We'd presumably need to add a typeclass argument to mkArray that determines the runtime representation. And if you forget the argument somewhere then you could easily end up with a non-specialized array. Also all array access would need to branch on the representation, negating the potential performance advantage.

gebner

comment created time in 14 hours

PullRequestReviewEvent

issue commentleanprover/lean4

Finish implementation of "document highlight" request

We currently send this data to the watchdog without storing it in the file worker, but I think it's better to keep the request handler in the worker (the do part certainly should stay there).

It would also be great if the references could already be shown before the whole file has been compiled (i.e., only show the references in the already finished part). This also requires the code to stay in the worker.

Kha

comment created time in 14 hours

create barnchgebner/lean4

branch : evalsorrydecl

created branch time in 14 hours

Pull request review commentleanprover/lean4

fix: provide reference implementation for `Array.modify`

 def shrink (a : Array α) (n : Nat) : Array α :=   loop (a.size - n) a  @[inline]-def modifyM [Monad m] [Inhabited α] (a : Array α) (i : Nat) (f : α → m α) : m (Array α) := do+unsafe def modifyMUnsafe [Monad m] (a : Array α) (i : Nat) (f : α → m α) : m (Array α) := do   if h : i < a.size then     let idx : Fin a.size := ⟨i, h⟩     let v                := a.get idx-    let a'               := a.set idx default+    let a'               := a.set idx (unsafeCast ())     let v ← f v

Wouldn't the array just be discarded in that case? The a' never escapes the modifyM function.

Note that the same situation also occurs in mapMUnsafe.

gebner

comment created time in 14 hours

PullRequestReviewEvent

pull request commentleanprover/vscode-lean4

Provide definition at word position

It's not about re-implementing the parser, [...] Simply adding # to it would make your example work.

And then I just come back with the next example. This is a cat-and-mouse game until the regex matches what Lean does internally. And even then it only works for term parsers.

One of the cool features in Lean 4 is that you can extend the syntax. I really don't want to hamstring that by hardcoding an incomplete part of the lexical syntax of one syntax category in a specific Lean version.

I then thought reusing the code responsible for the highlights (part of this extension, uses the word range) would be a more consistent behavior, because the found definition would be for the part of the code that received the highlight.

Making the behavior more consistent is certainly a good thing. However that part of the code will eventually move to the server anyhow so that it can show the actual references and not just variables with the same name. I've only put in that fallback for now because the server claims it supports highlights, but then doesn't return them (except for do<->return).

larsk21

comment created time in 14 hours

PR opened leanprover/lean4

fix: provide reference implementation for `Array.modify`

This got (presumably accidentally) removed during the Inhabited refactor. Since I was at it, I've also removed the Inhabited arguments of modifyM and modifyOp.

+13 -12

0 comment

1 changed file

pr created time in 15 hours

create barnchgebner/lean4

branch : arraymodifydef

created branch time in 15 hours

issue commentleanprover/lean4

Revisiting TC subgoal ordering

Relevant discussions Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/147302-lean4-dev/topic/TC.20hell

The real win for right-to-left solving comes from an additional optimization, namely that we can skip arguments that have already already been assigned. So if you have an instance with arguments [_inst_1 : A α] [_inst_2 : @B α _inst_1], then we never even attempt to synthesize A α (because that instance is already filled in via unification). This was a huge improvement in Lean 3: https://github.com/leanprover-community/mathlib/issues/1561#issuecomment-596134024

I don't think we really depend on right-to-left solving otherwise. And the examples from that issues work in Lean 4.

dselsam

comment created time in 16 hours

push eventleanprover-community/mathport

Gabriel Ebner

commit sha 1c9d7a1d83a97bcc85c3a4769b0787460d44f830

chore: bump to nightly-2022-01-17

view details

Gabriel Ebner

commit sha c87b8acdc2539d2941b4952d9950870b1029b38a

Increase heartbeats.

view details

Gabriel Ebner

commit sha 5e539c1843408590ac76a4dd91ddab5ae4021444

Merge pull request #95 from leanprover-community/bump20220117 chore: bump to nightly-2022-01-17

view details

push time in 17 hours

push eventleanprover-community/mathport

Gabriel Ebner

commit sha c87b8acdc2539d2941b4952d9950870b1029b38a

Increase heartbeats.

view details

push time in 19 hours

pull request commentleanprover/vscode-lean4

Provide definition at word position

Hmm, isn't VS Code already changing the position of the request when I Ctrl+click in the middle of an ident?

To the best of my knowledge, none of the editors we support change the position of definition queries.

The found definition in the example is also wrong because VSCode doesn't know that # splits words

I really don't want to commit to perfectly emulating the identifier parser in vscode (# isn't the only difference). Besides, with a custom parser you can break the word pattern in any way you want.

But I agree that there are situations in which the client doesn't have enough information to correctly filter out words in macros.

I'm not following. This issue is not about filtering, it's about a misleading message from vscode?

larsk21

comment created time in 19 hours

PR opened leanprover/vscode-lean4

Some CSS tweaks.

Nothing major, just making the colors a bit more subdued, rounding some corners, etc.

I'm still unhappy about the general styling of the infoview, there's lots of unstructured headers. I'm often losing the overview of what's going on, in particular if there's multiple pins.

+15 -39

0 comment

2 changed files

pr created time in 20 hours

create barnchleanprover/vscode-lean4

branch : csstweaks

created branch time in 20 hours

pull request commentleanprover/vscode-lean4

Provide definition at word position

I think the cure is worse than the disease here. Silently changing the position of the LSP request only leads to even more intransparent error modes:

macro "f#" x:term: term => `("f" ++ toString $x)
def abc := 42
#check f#abc
        --^ go-to-definition goes to f# and not abc

I agree that the vscode "no definitions found" message is horrible, but that should be reported to the vscode bug tracker, not patched around here.

larsk21

comment created time in 21 hours

push eventleanprover-community/mathlib4_docs

leanprover-community-bot

commit sha 207bf8c6bd89f0cb48544f49e9b9ed30edf4be33

automatic update to mathlib4 7046e13 using doc-gen4 0be10cf

view details

push time in a day

Pull request review commentleanprover/vscode-lean4

feat: use lake serve

 export async function batchExecute(     });  }++export async function testExecute(+    toolchainPath: string,+    args: any[],+    workingDirectory: string,+    delay: number = 1000): Promise<number> {

I'm not following?

I think we should parse the output of lake version. This also allows us to adapt if in the future the command-line syntax of lake serve changes (e.g. dropping the --, or allowing other arguments, etc.).

lovettchris

comment created time in a day

PullRequestReviewEvent

push eventgebner/quote4

Gabriel Ebner

commit sha d0aa1c4756e70f00046725aab48ecdf57dd90261

chore: bump to nightly-2022-01-17

view details

push time in a day

issue openedleanprover/doc-gen4

Show constructor names in structures

The documentation should show the constructor name in structures, at least when you manually specify it using mk' ::. For example https://leanprover-community.github.io/mathlib4_docs/Init/Prelude.html#ULift should include up ::.

Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there.20code.20for.20X.3F/topic/linear.20maps.20of.20polynomials/near/267925047

created time in a day

create barnchleanprover-community/mathport

branch : bump20220117

created branch time in a day

pull request commentleanprover-community/mathlib4

chore: add back unfold tactic stub

bors merge

gebner

comment created time in a day

more