lean4-htt/src
Marc Huisinga cd0be38bb4
feat: elidible subterms (#3201)
This PR adds two new delaboration settings: `pp.deepTerms : Bool`
(default: `true`) and `pp.deepTerms.threshold : Nat` (default: `20`).

Setting `pp.deepTerms` to `false` will make the delaborator terminate
early after `pp.deepTerms.threshold` layers of recursion and replace the
omitted subterm with the symbol `⋯` if the subterm is deeper than
`pp.deepTerms.threshold / 4` (i.e. it is not shallow). To display the
omitted subterm in the InfoView, `⋯` can be clicked to open a popup with
the delaborated subterm.

<details>
<summary>InfoView with pp.deepTerms set to false (click to show
image)</summary>


![image](https://github.com/leanprover/lean4/assets/10852073/f6df8b2c-d769-41c8-821e-efd0af23ccfa)
</details>

### Implementation

- The delaborator is adjusted to use the new configuration settings and
terminate early if the threshold is exceeded and the corresponding term
to omit is shallow.
- To be able to distinguish `⋯` from regular terms, a new constructor
`Lean.Elab.Info.ofOmissionInfo` is added to `Lean.Elab.Info` that takes
a value of a new type `Lean.Elab.OmissionInfo`.
- `ofOmissionInfo` is needed in `Lean.Widget.makePopup` for the
`Lean.Widget.InteractiveDiagnostics.infoToInteractive` RPC procedure
that is used to display popups when clicking on terms in the InfoView.
It ensures that the expansion of an omitted subterm is delaborated using
`explicit := false`, which is typically set to `true` in popups for
regular terms.
- Several `Info` widget utility functions are adjusted to support
`ofOmissionInfo`.
- The list delaborator is adjusted with special support for `⋯` so that
long lists `[x₁, ..., xₖ, ..., xₙ]` are shortened to `[x₁, ..., xₖ, ⋯]`.
2024-01-31 17:28:29 +00:00
..
bin feat: Web Assembly Build (#2599) 2023-10-04 09:04:20 +02:00
cmake
include/lean feat: synchronous execution of task continuations (#3013) 2024-01-25 13:54:20 +00:00
Init feat: elidible subterms (#3201) 2024-01-31 17:28:29 +00:00
initialize chore: fix more typos in comments 2023-10-08 14:37:34 -07:00
kernel feat: add bitwise operations to reduceNat? and kernel (#3134) 2024-01-11 18:12:45 +00:00
lake feat: lake: GNU/BSD OS detection in test scripts (#3180) 2024-01-14 02:49:38 +00:00
Lean feat: elidible subterms (#3201) 2024-01-31 17:28:29 +00:00
library feat: System.Platform.target (#3207) 2024-01-24 12:11:00 +00:00
runtime fix: do not throw C++ heartbeat exceptions in pure functions (#3224) 2024-01-29 20:27:27 +00:00
shell feat: Web Assembly Build (#2599) 2023-10-04 09:04:20 +02:00
util fix: remove target triple parameter from FFI that no longer exists in the Lean API 2023-11-02 23:21:47 +01:00
CMakeLists.txt feat: System.Platform.target (#3207) 2024-01-24 12:11:00 +00:00
config.h.in
githash.h.in
Init.lean feat: simproc declaration vs simproc attribute 2024-01-09 12:57:15 +01:00
lean-toolchain doc: VS Code dev setup (#2961) 2023-11-30 08:35:03 +00:00
Lean.lean feat: add linter.deprecated option to silence deprecation warnings 2022-10-23 21:11:57 +02:00
lean.mk.in feat: LLVM bc separation for CMake 2023-11-02 23:21:47 +01:00
Leanc.lean fix: default for MACOSX_DEPLOYMENT_TARGET (#2598) 2023-10-02 13:03:19 +00:00
stdlib.make.in chore: set warningAsError in CI only (#3030) 2023-12-06 08:18:39 +00:00
stdlib_flags.h chore: update domain 2023-09-20 15:13:27 -07:00
version.h.in feat: System.Platform.target (#3207) 2024-01-24 12:11:00 +00:00