Commit graph

52 commits

Author SHA1 Message Date
Kyle Miller
036b5381f0
fix: make tests be aware of new instance names (#3936)
#3089 caused the stage0 update to cause a number of tests to start
failing because they were using the old instance names.
2024-04-17 16:14:51 +02:00
Kyle Miller
d39b0415f0
feat: enable pp.fieldNotation.generalized globally (#3744)
Sets the default value to `pp.fieldNotation.generalized` to `true`.
Updates tests, and fixes some minor flaws in the implementation of the
generalized field notation pretty printer.

Now generalized field notation won't be used for any function that has a
`motive` argument. This is intended to prevent recursors from pretty
printing using it as (1) recursors are more like control flow structures
than actual functions and (2) generalized field notation tends to cause
elaboration problems for recursors.

Note: be sure functions that have an `@[app_unexpander]` use
`@[pp_nodot]` if applicable. For example, `List.toArray` needs
`@[pp_nodot]` to ensure the unexpander prints it using `#[...]`
notation.
2024-03-23 02:38:09 +00:00
Kyle Miller
1f4dea8582
feat: add pp.fieldNotation.generalized for generalized field notation, add @[pp_nodot] attribute (#3737)
Refactors app delaborator, merging in the projection delaborator, to
support pretty printing with generalized field notation.

Renames option `pp.structureProjections` to `pp.fieldNotation` and adds
sub-option `pp.fieldNotation.generalized` to enable/disable generalized
field notation. Adds `@[pp_nodot]` attribute to permanently disable
using field notation for a given declaration.

For now, the default value of `pp.fieldNotation.generalized` is false
since we need a stage0 update to add `@[pp_nodot]` to some core
definitions (such as `List.toArray`) before updating the tests.

[Zulip
discussion](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.60pp.2EgeneralizedFieldNotation.60/near/425856054)
2024-03-22 08:55:02 +00:00
Kyle Miller
acb188f11c
feat: apply pp_using_anonymous_constructor attribute (#3735)
This attribute, which was implemented in #3640, is applied to the
following structures: `Sigma`, `PSigma`, `PProd`, `And`, `Subtype`, and
`Fin`. These were given this attribute in Lean 3.
2024-03-22 00:30:36 +00:00
Leonardo de Moura
97e7e668d6
chore: pp.proofs.withType is now false by default (#3379)
`pp.proofs.withType := true` often produces too much noise in the info
view.
2024-02-17 15:09:24 +00:00
Kyle Miller
e29d75a961
feat: have pp.proofs use for omission (#3241)
By having the `pp.proofs` feature use `⋯` when omitting proofs, when
users copy/paste terms from the InfoView the elaborator can give an
error message explaining why the term cannot be elaborated.

Also adds `pp.proofs.threshold` option to allow users to pretty print
shallow proof terms. By default, only atomic proof terms are pretty
printed.

This adjustment was suggested in PR #3201, which added `⋯` and the
related `pp.deepTerms` option.
2024-02-15 21:49:41 +00:00
Leonardo de Moura
d9eddc9652 feat: ensure nested proofs having been abstracted in equation and unfold auxiliary theorems 2023-11-07 06:23:45 -08:00
Mario Carneiro
f74fee07e6
doc: document Init.Data.List.Basic (#1828)
* doc: document Init.Data.List.Basic

* Apply suggestions from code review

Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>

Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2022-11-18 06:16:50 -08:00
Mario Carneiro
dd5948d641 chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
Mario Carneiro
85119ba9d1 chore: move Std.* data structures to Lean.* 2022-09-26 05:46:04 -07:00
Mario Carneiro
37252e5fa7 chore: remove Bootstrap package 2022-09-02 16:39:03 -07:00
Sebastian Ullrich
2e98726973 fix: levelMVarToParam must update levelNames 2022-08-31 17:57:07 -07:00
Mario Carneiro
6a7ccb5797
refactor: generalize ShareCommon to a typeclass (#1537) 2022-08-29 09:34:38 -07:00
Mario Carneiro
0efbc0bc03 chore: remove BinomialHeap, DList, Stack, Queue
These are moving to std4.
2022-08-29 07:07:53 -07:00
Mario Carneiro
bf89c5a0f5 chore: move Std -> Bootstrap 2022-08-29 01:26:12 -07:00
Leonardo de Moura
413db56b89 refactor: simplify runTermElabM and liftTermElabM 2022-08-07 07:35:02 -07:00
Sebastian Ullrich
2f67295c7d feat: strengthen pp* signatures 2022-07-03 19:14:49 +02:00
Leonardo de Moura
34c75fc443 feat: allow even if the expected type is not available
see issue #1116
2022-04-23 08:00:27 -07:00
Leonardo de Moura
55989c25fc chore: remove unnecessary args 2022-04-07 18:19:15 -07:00
Leonardo de Moura
e9d85f49e6 chore: remove tryPureCoe?
Based on the discussion at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/for.2C.20unexpected.20need.20for.20type.20ascription/near/269083574
The consensus seemed to be that "auto pure" is more confusing than its worth.
2022-02-03 16:25:24 -08:00
Leonardo de Moura
0c959b6942 chore: fix tests 2022-01-20 15:25:59 -08:00
Daniel Selsam
5eed3b73bf chore: adjust pp.analyze funext test 2021-09-15 09:41:16 +02:00
Daniel Selsam
664737def8 feat: trust subtype.mk by default 2021-09-15 09:41:16 +02:00
Daniel Selsam
4b011affca chore: better msgs in pp.analyze test 2021-09-15 09:41:16 +02:00
Daniel Selsam
4646b36459 feat: pp.analyze no explicit holes by default 2021-09-15 09:41:16 +02:00
Daniel Selsam
5952a857cd feat: pp.analyze improve heuristics for fun binders 2021-08-12 09:37:57 +02:00
Leonardo de Moura
1d9d8c7e75 chore: fix tests
close #402
2021-08-07 13:22:58 -07:00
Leonardo de Moura
76cc99179d fix: fixes #370 2021-08-06 12:52:23 -07:00
Daniel Selsam
34a27f2d56 fix: pp.analyze strict implicits 2021-08-06 17:02:00 +02:00
Daniel Selsam
d56db0a22d doc: pp.analyze one more comment about a failure 2021-08-03 09:13:18 +02:00
Daniel Selsam
2afc18323d doc: pp.analyze a few comments about failures 2021-08-03 09:13:18 +02:00
Daniel Selsam
d6253e091b fix: pp.analyze _s when forced explicit 2021-08-03 09:13:18 +02:00
Daniel Selsam
ea6fca24c2 refactor: pp.analyze StateT for analyzeApp 2021-08-03 09:13:18 +02:00
Daniel Selsam
aefd31b2a2 feat: better bottom-up/structure-type heuristics 2021-08-03 09:13:18 +02:00
Daniel Selsam
4c41142a61 chore: pp.analyze new test cases 2021-08-03 09:13:18 +02:00
Daniel Selsam
8dd8aea9c1 chore: new tests 2021-08-03 09:13:18 +02:00
Daniel Selsam
44f1f4e410 refactor: pp.analyze needs pp options 2021-08-03 09:13:18 +02:00
Daniel Selsam
48d5c0d2a6 chore: pp.proofs defaults to false 2021-08-03 09:13:18 +02:00
Daniel Selsam
a84291641b fix: pp.analyze restriction on _ 2021-08-03 09:13:18 +02:00
Daniel Selsam
702211db2a feat: pp.analyze detect when struct-inst type needed 2021-08-03 09:13:18 +02:00
Daniel Selsam
3bef119136 fix: pp.analyze missing inBottomUp 2021-08-03 09:13:18 +02:00
Daniel Selsam
3309da8f1e fix: pp.analyze LocalInstances not in MessageData 2021-08-03 09:13:18 +02:00
Daniel Selsam
b3bb82ee7e feat: turn more delaborators into unexpanders 2021-08-03 09:13:18 +02:00
Daniel Selsam
a96a043618 feat: better coe support 2021-08-03 09:13:18 +02:00
Daniel Selsam
50d67e77ac fix: type ascriptions 2021-08-03 09:13:18 +02:00
Daniel Selsam
eed0fb6635 feat: special support for 'fun x => x' 2021-08-03 09:13:18 +02:00
Daniel Selsam
811bb56d10 fix: never set a negation 2021-08-03 09:13:18 +02:00
Daniel Selsam
e84a5ac432 fix: @ when there are inaccessible names 2021-08-03 09:13:18 +02:00
Daniel Selsam
280a3db653 fix: only print named patterns inside patterns 2021-08-03 09:13:18 +02:00
Daniel Selsam
d2ff2de4f6 feat: add @ to consts/locals with pi {..} type 2021-08-03 09:13:18 +02:00