Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Leonardo de Moura 26da50ab0e feat(library/vm/vm_string): efficient iterator.extract
@kha I've added

   iterator.extract : iterator -> iterator -> option string

It returns `none` if the iterators are "incompatible".
If this function is inconvenient to use, we can change it and return the
empty string in these cases.

Given iterators `it1` and `it2`, if they are sharing the same string
object in memory, then the cost is O(pos(it2) - pos(it1)).
If not, we have an extra O(N) step where we check whether the strings
being iterated by it1 and it2 are equal (`N` is the size of the strings).
In most applications, I believe the iterators will share the string
object.

I didn't test the code much. BTW, I found an unrelated bug at
vm_string.cpp. So, I'm not very confident this code is rock solid.
2018-01-10 13:27:28 -08:00
.github chore(.github/CONTRIBUTING): fix typos and URLs 2017-10-30 16:23:22 +01:00
bin chore(bin/lean-gdb): add pretty printer for lean::level 2017-11-30 17:47:49 +01:00
doc doc(doc/changes): describe new "smart unfolding" feature 2018-01-09 16:47:32 -08:00
extras/latex chore(extras/depgraph): remove leandeps 2017-07-15 02:27:17 -07:00
images
leanpkg fix(leanpkg/main): avoid recursively executing leanpkg 2017-12-30 19:31:55 +01:00
library feat(library/vm/vm_string): efficient iterator.extract 2018-01-10 13:27:28 -08:00
packages chore(script/test_registry): Replace with leanpkg. Execute in every artifact-producing build configuration. 2017-12-20 14:01:45 -08:00
script chore(script/test_registry): Replace with leanpkg. Execute in every artifact-producing build configuration. 2017-12-20 14:01:45 -08:00
src feat(library/vm/vm_string): efficient iterator.extract 2018-01-10 13:27:28 -08:00
tests feat(library/vm/vm_string): efficient iterator.extract 2018-01-10 13:27:28 -08:00
tmp feat(library/init/data): start rbtree module 2017-11-15 16:17:39 -08:00
.appveyor.yml chore(script/test_registry): Replace with leanpkg. Execute in every artifact-producing build configuration. 2017-12-20 14:01:45 -08:00
.clang-format feat(library/vm/process): add basic process support 2017-03-28 18:08:06 -07:00
.codecov.yml fix(.codecov.yml): do not fail github ci if coverage drops by 0.01% 2017-06-25 10:35:02 +02:00
.gitattributes chore(.gitattributes): use union merge strategy for doc/changes.md 2017-12-11 12:49:10 +01:00
.gitignore chore(gitignore): ignore autogenerated version.lean file 2017-12-17 15:49:51 +01:00
.travis.yml fix(.travis.yml): support combining $TEST_LEANPKG_REGISTRY and $UPLOAD 2017-12-22 11:54:29 +01:00
LICENSE
README.md doc(faq): add FAQ 2018-01-03 15:39:02 -08:00