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

Bug in the option trace.profiler.output.pp #5872

Closed
2 of 3 tasks
hrmacbeth opened this issue Oct 28, 2024 · 0 comments · Fixed by #6138
Closed
2 of 3 tasks

Bug in the option trace.profiler.output.pp #5872

hrmacbeth opened this issue Oct 28, 2024 · 0 comments · Fixed by #6138
Labels
bug Something isn't working P-medium We may work on this issue if we find the time

Comments

@hrmacbeth
Copy link
Contributor

Prerequisites

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

Description

The profiler has an option to output the result as a JSON, but this does not seem to respect pretty-printing: the flag trace.profiler.output.pp=true does not seem to do anything, alone or in combination with other pretty-printing options.

Context

Noted by @Kha on Zulip.

Steps to Reproduce

On a file Test.lean

notation "" => Int
theorem foo {a : ℤ} (h : 0 ≤ a) : 0 < a + 1 := Int.add_pos_of_nonneg_of_pos h Int.zero_lt_one

run the following command

lake env lean -Dtrace.profiler=true -Dtrace.profiler.output="profile.json" -Dtrace.profiler.output.pp=true -Dtrace.profiler.threshold=0 Test.lean

Optionally include other pp options like -Dpp.notation=true or -Dpp.universes=false.

Expected behavior:

Typical step in the JSON output looks like the output of #print foo under the default pretty-printing settings, and is adjustable according to other pretty-printing options (by setting those flags at the command line).

Actual behavior:

Typical step in the JSON output looks like the output of #print foo under the pp.raw pretty-printing setting:

Elab.step: Lean.Parser.Term.app: expected type: LT.lt.{0} Int Int.instLTInt (OfNat.ofNat.{0} Int 0 (instOfNat 0)) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAdd) _uniq.1362 (OfNat.ofNat.{0} Int 1 (instOfNat 1))), term\n(Term.app `Int.add_pos_of_nonneg_of_pos [`h `Int.zero_lt_one])

Versions

4.12.0, MacOS Sonoma

Impact

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

@hrmacbeth hrmacbeth added the bug Something isn't working label Oct 28, 2024
@leanprover-bot leanprover-bot added the P-medium We may work on this issue if we find the time label Nov 8, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 20, 2024
This PR fixes `trace.profiler.pp` not using the term pretty printer.

Fixes #5872
@Kha Kha closed this as completed in #6138 Nov 20, 2024
JovanGerb pushed a commit to JovanGerb/lean4 that referenced this issue Jan 21, 2025
This PR fixes `trace.profiler.pp` not using the term pretty printer.

Fixes leanprover#5872
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-medium We may work on this issue if we find the time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants