Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Zippers implementation and verification, and some benchmarks #116

Open
wants to merge 89 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
e39aaa4
add sbt project with plugin
samuelchassot Feb 5, 2024
8bd26d1
move regex to an sbt project
samuelchassot Feb 5, 2024
3cbe89b
original version
samuelchassot Feb 5, 2024
a6e8c55
working on the memoisation
samuelchassot Feb 5, 2024
8e070cb
not working
samuelchassot Feb 5, 2024
716df70
add longMap + work on cache
samuelchassot Feb 5, 2024
0a56ac6
for now issue with illegal capturing
samuelchassot Feb 5, 2024
10ccdee
to specific, not working but almost
samuelchassot Feb 7, 2024
8764faf
Merge branch 'master' into regex_cache
samuelchassot Mar 7, 2024
59fab0d
Merge branch 'master' into regex_cache
samuelchassot Mar 7, 2024
b84d765
working on memoised regex
samuelchassot Mar 7, 2024
f0efe2b
working
samuelchassot Mar 7, 2024
6714b0b
cached version proven
samuelchassot Mar 7, 2024
d4b34df
working examples
samuelchassot Mar 8, 2024
7b06ca5
Merge remote-tracking branch 'refs/remotes/origin/regex_cache' into r…
Mar 12, 2024
d58c461
Merge branch 'main' into regex_cache
samuelchassot Jul 26, 2024
c07af03
new hashmap without ordering
samuelchassot Jul 26, 2024
ab43930
add new lemmas in ListMaps for forall
samuelchassot Jul 26, 2024
cf005c2
Formally verified cache for regex
samuelchassot Jul 26, 2024
1716137
add removeUselessConcat simplification for regex + equivalence proof
samuelchassot Jul 26, 2024
bea8a93
add a simplification function that is sound
samuelchassot Jul 29, 2024
7936c5c
working on regex
samuelchassot Jul 31, 2024
6f13658
Merge branch 'main' into regex_cache
samuelchassot Aug 9, 2024
f860997
as symlink
samuelchassot Aug 9, 2024
9694e96
ensuring as method and not infix
samuelchassot Aug 12, 2024
d802265
implementation of Zippers (with List for Set, I'm changing to Set to …
samuelchassot Aug 13, 2024
3f07bcb
continue working on zippers
samuelchassot Aug 13, 2024
05a7923
working on zipper
samuelchassot Aug 14, 2024
e633121
Merge branch 'main' into sam/regexZippers
samuelchassot Oct 9, 2024
d9d54d0
remove chassot pacakge, obsolete
samuelchassot Oct 9, 2024
19230d0
finalise merge
samuelchassot Oct 9, 2024
1a0bb23
add hashset symlink
samuelchassot Oct 10, 2024
bb9487c
add a few imports
samuelchassot Oct 10, 2024
ae4a712
start to migrate to sets
samuelchassot Oct 10, 2024
c555173
continue replacing list by set
samuelchassot Oct 10, 2024
ae6f550
Move to Stainless Set, passing tests
samuelchassot Oct 21, 2024
a1810a8
working on zippers
samuelchassot Oct 22, 2024
f727a31
working
samuelchassot Oct 23, 2024
ba7f96d
remove useless imports
samuelchassot Oct 23, 2024
8f6282b
work on zippers
samuelchassot Oct 24, 2024
677aa75
add some lemmas about flatmap
samuelchassot Oct 31, 2024
d51738e
add getwitness for sets
samuelchassot Nov 4, 2024
e1e828c
working on zppier
samuelchassot Nov 4, 2024
bb3c2f8
working
samuelchassot Nov 5, 2024
91b9d41
Merge branch 'sam/regexZippers' of github.com:samuelchassot/bolts int…
samuelchassot Nov 5, 2024
2f538fb
change to ghost
samuelchassot Nov 5, 2024
7088f44
change Context to be a class with invariant to emulate refinement types
samuelchassot Nov 6, 2024
5543793
Prove that the derivation of zippers is associative
samuelchassot Nov 11, 2024
b2c0f9d
working on zipper proof
samuelchassot Nov 11, 2024
9ec15fb
proving stuff
samuelchassot Nov 12, 2024
38ad285
proving equivalence of base cases
samuelchassot Nov 12, 2024
3f588bd
add generalisations of union and concat to base regex
samuelchassot Nov 13, 2024
747ec07
work on regex
samuelchassot Nov 13, 2024
55d1a49
revert the generalised regex
samuelchassot Nov 13, 2024
371f883
add generalised union and concat as method
samuelchassot Nov 14, 2024
26ef6c9
matchRGenUnionSpec and matchRGenConcatSpec
samuelchassot Nov 14, 2024
902b7f4
working on zipper proof
samuelchassot Nov 14, 2024
592a260
working on Zipper theorem
samuelchassot Nov 18, 2024
2e5f53c
working on zipper proof
samuelchassot Nov 19, 2024
07e0152
working on big proof direct induction - not working for star
samuelchassot Nov 20, 2024
1d2bedb
working on zipper proof
samuelchassot Nov 20, 2024
fce7d93
working on the zipper proof
samuelchassot Nov 21, 2024
f6d82ee
working on zipper
samuelchassot Nov 22, 2024
71aa5f3
proved lemmaConcatZipperMatchesStringThenFindConcatDefined
samuelchassot Nov 24, 2024
0a1c766
working on zipper proof, almost done
samuelchassot Nov 24, 2024
5cbe9ee
working on zipper proof, almost done
samuelchassot Nov 24, 2024
1e6b973
done proving ZIPERRR :D
samuelchassot Nov 24, 2024
f7f1dca
clean up
samuelchassot Nov 24, 2024
09efd33
Add main regex matching function to use zipper, rename theorem
samuelchassot Nov 24, 2024
a6b4cc4
add benchmark + memoisation as extern for flatmap
samuelchassot Nov 26, 2024
0dba439
add verification for memoisation
samuelchassot Nov 27, 2024
370e77c
add benchmarks and some results
samuelchassot Nov 27, 2024
f62dd63
Merge branch 'main' into sam/regexZippers
samuelchassot Nov 27, 2024
b7179dc
update CI
samuelchassot Nov 27, 2024
52697c2
debug ci
samuelchassot Nov 28, 2024
c62c253
debug ci
samuelchassot Nov 28, 2024
ece5065
debug
samuelchassot Nov 28, 2024
b280697
ci
samuelchassot Nov 28, 2024
030be7f
add memoised matching using Zipper to regex
samuelchassot Nov 28, 2024
04065e8
benchmark + typo
samuelchassot Nov 28, 2024
39850f7
rename for future benchmark analysis
samuelchassot Nov 29, 2024
822071f
benchmark data
samuelchassot Nov 29, 2024
80d9328
remove one main test
samuelchassot Dec 3, 2024
e1c5fb9
new benchmark
samuelchassot Dec 3, 2024
b1d1116
typo
samuelchassot Dec 9, 2024
13dc264
Merge branch 'main' into sam/regexZippers
samuelchassot Dec 12, 2024
cd9f735
fix the ci
samuelchassot Dec 12, 2024
41dffc0
Merge branch 'main' into sam/regexZippers
samuelchassot Dec 16, 2024
983cf84
Merge branch 'main' into sam/regexZippers
samuelchassot Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/bolts-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
temp-dir: "/tmp/tmp_${{ github.run_id }}_${{ github.run_attempt }}"
- name: Bolts admit VCs tests
run: ./run-tests.sh --admit-vcs
- name: Clean up
run: rm -rf $JAVA_OPTS_TMP_DIR
fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
runs-on: [self-hosted, linux]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import stainless.equations._
import stainless.lang._
import stainless.proof.check
import scala.annotation.tailrec
import scala.collection.immutable

// Uncomment the following import to run benchmarks
// import OptimisedChecks.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import stainless.equations._
import stainless.lang._
import stainless.proof.check
import scala.annotation.tailrec
import scala.collection.immutable
import stainless.collection.ListOps.noDuplicate
import scala.collection.mutable

// Uncomment the following import to run benchmarks
// import OptimisedChecks.*
Expand Down Expand Up @@ -406,7 +404,7 @@ object TupleListOpsGenK {
case Nil() => ()
}
}.ensuring(_ => getKeysList(l).content - key == getKeysList(removePresrvNoDuplicatedKeys(l, key)).content)

@opaque
@inlineOnce
def lemmaEqMapSameKeysSet[K, B](lm1: ListMap[K, B], lm2: ListMap[K, B]): Unit = {
Expand Down Expand Up @@ -459,28 +457,6 @@ object TupleListOpsGenK {
}
}.ensuring(_ => l.map(_._1).contains(p._1))

@opaque
@inlineOnce
def lemmainsertNoDuplicatedKeysPreservesForall[K, B](
l: List[(K, B)],
key: K,
value: B,
p: ((K, B)) => Boolean
): Unit = {
require(invariantList(l))
require(l.forall(p))
require(p((key, value)))
decreases(l)

l match {
case Cons(head, tl) if (head._1 != key) =>
lemmainsertNoDuplicatedKeysPreservesForall(tl, key, value, p)
case _ => ()
}

}.ensuring(_ => insertNoDuplicatedKeys(l, key, value).forall(p))


@opaque
@inlineOnce
def lemmaForallSubset[K, B](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package ch.epfl.map

object OptimisedChecks {
extension [T](inline value: T) inline def.ensuring(condition: T => Boolean): T = value
extension [T](inline value: T) inline def ensuring(condition: T => Boolean): T = value
inline def require(inline condition: Boolean): Unit = ()
inline def assert(inline condition: Boolean): Unit = ()
}
Loading