Commit bc975b3
Add properties that characterize
* Add properties that characterize `Data.Tree.AVL.Indexed.delete`.
These are properties for the core delete on AVL trees and similar to the prexisting properties of `insert`.
Lemmas added for `delete` are `delete⁺`, `delete-tree⁻`, `delete-key-∈⁻` and `delete-key⁻`.
Together these can be used to prove `(k′ ∈ delete k t) ⇔ (k′ ≉ k × k′ ∈ t)`, which fully characterizes `delete`.
`delete⁺`, `delete-tree⁻`, and `delete-key⁻` correspond to Coq.FSets.FSetInterface's `remove_2`, `remove_3`, and `remove_1`, respectively.
Just like other lemmas in this file, `delete⁺`, `delete-tree⁻`, `delete-key⁻` generalize `k′ ∈ t` to `Any P t`.
`delete-key-∈⁻` is essentally a helper for `delete-key⁻`, which would be difficult to prove directly.
Many more lemmas were added for AVL functions that `delete` depends on.
These additional lemmas characterize the functions `castʳ`, `joinˡ⁺`, `joinʳ⁺`, `joinˡ⁻`, `joinʳ⁻`, `headTail`, and `join`.
Adding all this code to Properties.agda caused `make test` to overflow past the 4096 MB default heap size.
This was solved by breaking Properties.agda into multiple files, with roughly one file for each AVL function.
Added proofs are a similar style the preexisting proofs in Properties.agda.
* telescoped arguments in Singleton.agda
* removed unused vars, merged cases using Any.toSum for JoinConstFuns.agda
* addressed review comments on Join.agda
* addressed comments in Insert.agda
* addressed review comments for HeadTail.agda
* addressed review comments for Delete.agda
* Moved Data.Tree.AVL.Indexed.Relation.Unary.Any.* into Data.Tree.AVL.Indexed.Relation.Unary.Any.Properties.*
* Simplified proofs by removing subterms that recapitulate the subject function.
* Changed whitespace to align matches.
* More alignment.
* addressed review comments to use var in let and moved implicits to variable block
* Recorded changes in CHANGELOG.md. Addressed review comments for AnyLookup.
* Apply suggestion from @jamesmckinna
Cosmetic tweak to text
---------
Co-authored-by: jamesmckinna <31931406+jamesmckinna@users.noreply.github.com>Data.Tree.AVL.Indexed.delete. (#2961)1 parent 82b007f commit bc975b3
11 files changed
Lines changed: 1091 additions & 405 deletions
File tree
- src/Data/Tree/AVL/Indexed/Relation/Unary/Any
- Properties
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
174 | 192 | | |
175 | 193 | | |
176 | 194 | | |
| |||
397 | 415 | | |
398 | 416 | | |
399 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
400 | 499 | | |
401 | 500 | | |
402 | 501 | | |
| |||
0 commit comments