Commit graph

21 commits

Author SHA1 Message Date
Sebastian Ullrich
09a5b34931
feat: make private the default in module (#9044)
This PR adjusts the experimental module system to make `private` the
default visibility modifier in `module`s, introducing `public` as a new
modifier instead. `public section` can be used to revert the default for
an entire section, though this is more intended to ease gradual adoption
of the new semantics such as in `Init` (and soon `Std`) where they
should be replaced by a future decl-by-decl re-review of visibilities.
2025-06-28 16:30:53 +00:00
Joachim Breitner
803dc3e687
refactor: Init: expose lots of functions (#8501)
This PR adds the `@[expose]` attribute to many functions (and changes
some theorems to be by `:= (rfl)`) in preparation for the `@[defeq]`
attribute change in #8419.
2025-05-28 07:37:54 +00:00
Sebastian Ullrich
7feb583b9e
feat: enable experimental module system in Init (#8047) 2025-04-23 17:21:33 +00:00
Joachim Breitner
70435dfb5f
refactor: name the default SizeOf instance (#5981)
This PR names the default SizeOf instance `instSizeOfDefault`

I regularly have to debug termination checking failures where I end up
hovering over some termination measure, and seeing `instSizeOfDefault`
is more likely to tell me that the default instance is used than
`instSizeOf`.
2024-11-07 09:21:32 +00:00
Henrik Böving
19e06acc65
refactor: redefine unsigned fixed width integers in terms of BitVec (#5323)
I made a few choices so far that can probably be discussed:
- got rid of `modn` on `UInt`, nobody seems to use it apart from the
definition of `shift` which can use normal `mod`
- removed the previous defeq optimized definition of `USize.size` in
favor for a normal one. The motivation was to allow `OfNat` to work
which doesn't seem to be necessary anymore afaict.
- Minimized uses of `.val`, should we maybe mark it deprecated?
- Mostly got rid of `.val` in basically all theorems as the proper next
level of API would now be `.toBitVec`. We could probably re-prove them
but it would be more annoying given the change of definition.
- Did not yet redefine `log2` in terms of `BitVec` as this would require
a `log2` in `BitVec` as well, do we want this?
- I added a couple of theorems around the relation of `<` on `UInt` and
`Nat`. These were previously not needed because defeq was used all over
the place to save us. I did not yet generalize these to all types as I
wasn't sure if they are the appropriate lemma that we want to have.
2024-10-16 07:28:23 +00:00
Mario Carneiro
20f9b7172f doc: documentation for Init.SizeOf 2022-08-17 14:48:10 -07:00
Mario Carneiro
f6211b1a74
chore: convert doc/mod comments from /- to /--//-! (#1354) 2022-07-22 12:05:31 -07:00
Gabriel Ebner
eba400543d refactor: use computed fields for Name 2022-07-11 14:19:41 -07:00
Sebastian Ullrich
ae7b895f7a refactor: unname some unused variables 2022-06-07 16:37:45 -07:00
Leonardo de Moura
ecbc59c8d8 chore: split Notation.lean 2022-05-09 05:20:19 -07:00
Leonardo de Moura
443dd79a02 feat: sizeOf theorems for Lean.Name 2022-04-02 17:09:55 -07:00
Leonardo de Moura
140559c447 feat: sizeOf for Thunks and Unit -> a 2022-03-01 16:40:11 -08:00
Leonardo de Moura
802922ddaf feat: add helper sizeOf simp theorems 2022-02-28 12:28:37 -08:00
Leonardo de Moura
de11f7e1bc feat: add sizeOf spec lemmas as simp theorems 2022-01-17 16:14:38 -08:00
Leonardo de Moura
7c6d09496e chore: define SizeOf Lean.Name instance manually 2021-01-20 18:07:14 -08:00
Leonardo de Moura
46c62a3fed chore: add missing instances 2021-01-20 17:53:43 -08:00
Leonardo de Moura
ce11b23a59 feat: use deriving insertion sizeOf for types defined at Prelude.lean 2021-01-20 17:48:17 -08:00
Leonardo de Moura
ad913de340 refactor: define SizeOf before Core.lean 2021-01-20 17:07:02 -08:00
Leonardo de Moura
0a6d83127d chore: cleanup 2021-01-18 11:46:13 -08:00
Leonardo de Moura
0869f38de4 chore: update structure, class, inductive 2020-11-27 15:09:30 -08:00
Leonardo de Moura
7e51020685 chore: move SizeOf to its own file 2020-11-10 14:43:03 -08:00