Commit graph

147 commits

Author SHA1 Message Date
Markus Himmel
3efd0e4e1f
chore: fix inconsistent style in internal hash map lemmas (#5033) 2024-08-14 07:49:11 +00:00
Markus Himmel
dcadfd1c89
chore: remove oldSectionVars from hash map lemmas (#5023) 2024-08-14 03:04:33 +00:00
Henrik Böving
dc3eccdf26
feat: Std.Sat.AIG (#4953)
Step 2/~7 in upstreaming LeanSAT.

---------

Co-authored-by: Tobias Grosser <tobias@grosser.es>
Co-authored-by: Siddharth <siddu.druid@gmail.com>
Co-authored-by: Markus Himmel <markus@lean-fro.org>
Co-authored-by: Kim Morrison <scott.morrison@gmail.com>
2024-08-12 14:58:38 +00:00
François G. Dorais
759ece7f9e
fix: naming convention for UInt lemmas (#4514)
Closes #4513

---------

Co-authored-by: Kim Morrison <kim@tqft.net>
2024-08-12 01:03:21 +00:00
Sebastian Ullrich
5da9038fb4 chore: adapt stdlib to new variable behavior 2024-08-09 11:50:54 +02:00
Markus Himmel
4bac74c4ac chore: switch to Std.HashMap and Std.HashSet almost everywhere 2024-08-07 18:24:42 +02:00
Henrik Böving
d15f0335a9
feat: setup Std.Sat with definitions of SAT and CNF (#4933)
Step 1 out of approximately 7 to upstream LeanSAT.

---------

Co-authored-by: Tobias Grosser <tobias@grosser.es>
Co-authored-by: Markus Himmel <markus@lean-fro.org>
2024-08-07 15:44:46 +00:00
Markus Himmel
43fa46412d
feat: deprecated variants of hash map query methods (#4943)
#4917 will expose users of the `Lean` API to the renaming of the hash
map query methods. This PR aims to make the transition easier by adding
deprecated functions with the old names.
2024-08-07 13:36:19 +00:00
Kim Morrison
e280de00b6
feat: gaps/cleanup in List lemmas (#4835) 2024-07-26 05:00:50 +00:00
Markus Himmel
5d632a97b8
feat: more hash map lemmas (#4803) 2024-07-23 06:57:44 +00:00
Markus Himmel
92cca5ed1b
chore: remove bif from hash map lemmas (#4791)
The original idea was to use `bif` in computation contexts and `if` in
propositional contexts, but this turned out to be really inconvenient in
practice.
2024-07-22 14:39:00 +00:00
Markus Himmel
8e396068e4
doc: mention linearity in hash map docstring (#4771) 2024-07-17 09:26:38 +00:00
Markus Himmel
c1df7564ce
fix: resolve instances for HashMap via unification (#4759) 2024-07-17 08:02:22 +00:00
Markus Himmel
ba3565f441
chore: fix BEq argument order in hash map lemmas (#4732)
The previous argument order was a conscious choice, but I had missed
#3056.
2024-07-17 04:25:21 +00:00
Markus Himmel
1a9cbc96f1
chore: rename HashMap.remove to HashMap.erase (#4725)
The name `remove` was chosen because it is more popular in mainstream
programming languages, but being consistent with other Lean container
types (including `Lean.HashMap` and `Batteries.HashMap`) is more
important, so let's change the name while we still can.
2024-07-16 08:14:56 +00:00
Markus Himmel
d6c6e16254
fix: unorphan modules in Std.Data (#4679) 2024-07-08 07:57:56 +00:00
Markus Himmel
34e6579190
chore: Inhabited instances for Std.HashMap (#4682) 2024-07-08 07:57:51 +00:00
Sebastian Ullrich
4ed79472af
fix: explicitly initialize Std in lean_initialize (#4668)
Fixes the stage 2 build, which runs with `prefer_native=true`
2024-07-06 13:17:30 +00:00
Markus Himmel
3e0ea762b8
feat: Std.HashMap (#4583)
### Preliminary PRs:

- [x] #4597 
- [x] #4599
- [x] #4600
- [x] #4602
- [x] #4603
- [x] #4604
- [x] #4605
- [x] #4607
- [x] #4627
- [x] #4629 

### Quick overview over API/naming changes compared to `Lean.HashMap`
and `Batteries.HashMap`:
#### Lean

* `find?` -> `get?`/`getElem?`
* `find!` -> `get!`/`gtetElem!`
* `findD` -> `getD`
* `findEntry?` -> not implemented for now
* `insert'` -> `containsThenInsert` (order reversed in result)
* `insertIfNew` -> `getThenInsertIfNew?` (order reversed in result)
* `numBuckets` -> `Internal.numBuckets`
* `ofListWith` -> not implemented for now
* `Array.groupByKey` -> not implemented for now
* `merge` -> not implemented for now, but you can use `insertMany`

#### Batteries

* `modify` -> not implemented for now
* `mergeWith` -> not implemented for now
* `mergeWithM` -> not implemented for now
2024-07-05 10:14:20 +00:00
Sebastian Ullrich
d020a9c5a6
feat: introduce Std (#4499)
Situated between `Init` and `Lean`, provides functionality not in the
prelude to both Lean's implementation and external users
2024-06-21 07:08:45 +00:00
Mario Carneiro
bf89c5a0f5 chore: move Std -> Bootstrap 2022-08-29 01:26:12 -07:00
Henrik Böving
743ce431dc feat: HashSet.forM 2022-08-19 17:44:54 -07:00
Chris Lovett
50cd7debe1
feat: simple uri escaping and unescaping (#1452) 2022-08-12 19:56:05 +00:00
Gabriel Ebner
067f8e6449 feat: Std.TypeName and Std.Dynamic 2022-08-10 06:31:46 -07:00
Leonardo de Moura
cc91298570 feat: add PersistentHashMap.map and PersistentHashMap.mapM 2022-08-03 11:20:17 -07:00
Leonardo de Moura
cb6ae247aa chore: remove [specialize] annotations from fold operations on PersistentHashMap
They have little impact on performance, but increase the generated code size
2022-08-03 10:38:31 -07:00
Leonardo de Moura
5df588cbbf chore: remove unnecessary annotations 2022-08-02 05:42:53 -07:00
Mario Carneiro
42a4f2f451 feat: ForIn instance for NameMap and PersistentHashMap 2022-07-31 15:42:26 -07:00
Sebastian Ullrich
3362b38829 chore: more unused variable to-do markers 2022-07-29 19:41:12 +02:00
E.W.Ayers
28ebf90948 fix: add Inhabited Std.RBMap 2022-07-25 08:01:27 -07:00
Mario Carneiro
f6211b1a74
chore: convert doc/mod comments from /- to /--//-! (#1354) 2022-07-22 12:05:31 -07:00
Leonardo de Moura
2f1b80721e chore: avoid a[i]' h notation 2022-07-10 07:20:07 -07:00
Leonardo de Moura
aa52eebcdc feat: add instance GetElem (Array α) USize α fun xs i => LT.lt i.toNat xs.size where 2022-07-09 16:18:29 -07:00
Leonardo de Moura
1caff852fb chore: remove getOp functions 2022-07-09 16:09:28 -07:00
Leonardo de Moura
e4b358a01e refactor: prepare to elaborate a[i] notation using typeclasses 2022-07-09 15:24:22 -07:00
Leonardo de Moura
2873a1b250 chore: unused variable warningns 2022-07-09 07:52:59 -07:00
Leonardo de Moura
0a5df7cd6d chore: style 2022-07-05 20:45:53 -07:00
Leonardo de Moura
5e3a3a6c21 chore: remove notation a[i,h] for a[⟨i, h⟩] 2022-07-03 06:24:26 -07:00
Leonardo de Moura
a2456c3a0f feat: add notation a[i, h] for a[⟨i, h⟩] 2022-07-02 15:50:49 -07:00
Leonardo de Moura
f6d1e48cb8 fix: constant => opaque issues 2022-06-14 17:19:54 -07:00
Leonardo de Moura
02c4e548df feat: replace constant with opaque 2022-06-14 17:02:59 -07:00
Sebastian Ullrich
bda871da25 feat: RBTree.union/diff 2022-06-13 11:12:51 +02:00
Leonardo de Moura
041827bed5 chore: unused variables 2022-06-07 17:54:10 -07:00
Sebastian Ullrich
fb2a2b3de2 fix: fixup previous commit 2022-06-07 16:37:45 -07:00
Sebastian Ullrich
ae7b895f7a refactor: unname some unused variables 2022-06-07 16:37:45 -07:00
Leonardo de Moura
de2e2447d2 chore: style 2022-04-07 17:35:05 -07:00
Leonardo de Moura
96de208a6b chore: remove some partial 2022-03-23 17:16:30 -07:00
Leonardo de Moura
5283007aa4 feat: add HasConstCache 2022-03-15 08:39:48 -07:00
Arthur Paulino
98289ed3d7 feat: provide functions to build a HashMap from a List of key-value pairs
As a motivation, programming languages that implement hash maps usually provide an interface for easy instantiation.

Closes 947
2022-01-18 22:51:00 +01:00
Leonardo de Moura
8058bc894c feat: add AssocList.toList 2022-01-18 11:44:43 -08:00