Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
a6c975b
working on lexer
samuelchassot Mar 24, 2025
8d2ba86
add benchmarks for amy lexer
samuelchassot Mar 25, 2025
d7f5667
working on enriched tokens
samuelchassot Mar 26, 2025
48e6856
finish verifying the enriched tokens
samuelchassot Mar 27, 2025
89d8b48
benchmark results
samuelchassot Mar 27, 2025
cb57782
Merge branch 'sam/amylexer' of github.com:samuelchassot/bolts into sa…
samuelchassot Mar 27, 2025
666213a
Merge branch 'sam/amylexer' of github.com:samuelchassot/bolts into sa…
samuelchassot Mar 27, 2025
09cc97a
rename files
samuelchassot Mar 27, 2025
5b81fd2
reanme files
samuelchassot Mar 27, 2025
ceb7c4c
amy lexer -- STAINLESS CRASHES - to investigate
samuelchassot Mar 27, 2025
365da18
working on amy lexer, wip, not working
samuelchassot Apr 23, 2025
7cf7bf7
new injection for the transformation + working Amy lexer
samuelchassot Apr 30, 2025
4f0c1c8
benchmark
samuelchassot Apr 30, 2025
3e537ee
gitignore
samuelchassot Apr 30, 2025
9c1e511
add silex version of the lexer from Amy compiler
samuelchassot Apr 30, 2025
cbd2396
remove useless
samuelchassot Apr 30, 2025
63bc064
benchmark data
samuelchassot May 1, 2025
de9582f
benchmark + demo + new methods in the interface
samuelchassot May 1, 2025
ac6401b
working on lexer WIP
samuelchassot May 8, 2025
d2ca199
working on the lexer, adding size to tokens
samuelchassot May 8, 2025
2c55c14
improved interface, with laws for invertibility and max munch. Also c…
samuelchassot May 9, 2025
1c339b3
new benchmark with comments
samuelchassot May 12, 2025
5ab6fe4
new benchmark based on generated code
samuelchassot May 12, 2025
383e9b0
ghost in utils
samuelchassot May 12, 2025
c8f8d94
Merge branch 'sam/amylexer' of github.com:epfl-lara/bolts into sam/am…
samuelchassot May 12, 2025
85dd33a
better ghost
samuelchassot May 12, 2025
5cadc62
benchmarks
samuelchassot May 12, 2025
e05c7fb
tailrec utils for no stackoverflow
samuelchassot May 12, 2025
6adb3fe
optimised checks
samuelchassot May 12, 2025
d0ea21c
comment out opti checks again
samuelchassot May 12, 2025
7f79ec7
timeout
samuelchassot May 12, 2025
1669f89
getSuffix as ghost now, improve performance of findLongestMatch
samuelchassot May 12, 2025
a1307ab
new regex benchmark + amylexer fixed
samuelchassot May 13, 2025
ca13206
scala regex benchmark
samuelchassot May 13, 2025
ef4dffe
benchmark data
samuelchassot May 13, 2025
fc5d2d5
benchmark results
samuelchassot May 13, 2025
f32ca67
benchmark
samuelchassot May 14, 2025
15f7c23
tailrec size for list
samuelchassot May 15, 2025
1cbdffc
tailrec list size in executable code
samuelchassot May 15, 2025
cbe3847
fixed proof
samuelchassot May 15, 2025
0a295a8
benchmark result
samuelchassot May 15, 2025
8c322e5
improve performance of findlongestmatch
samuelchassot May 16, 2025
e0ed024
new fast findLongestMatch for zipper
samuelchassot May 16, 2025
dfe9b62
new tailrec version of splitAtIndex
samuelchassot May 16, 2025
84baea7
improve lost cause computation
samuelchassot May 16, 2025
eecde75
ghost
samuelchassot May 16, 2025
83c4c53
lostcause as lazyval, bug in nullable
samuelchassot May 16, 2025
b1dfa83
verified Vector versions of matching for zipper including longestmatch
samuelchassot May 19, 2025
1fcb7e0
findlongestmatchzipper vector in regex
samuelchassot May 20, 2025
cfba210
add singleton to vector
samuelchassot May 20, 2025
59d332f
Vector version of the Lexer WIP, works on tests, proof in progress
samuelchassot May 22, 2025
a7988bc
working on proof
samuelchassot May 24, 2025
f3de0e7
proof done :)
samuelchassot May 25, 2025
a0407dc
new benchmark files for lexer
samuelchassot May 26, 2025
7ec22db
update the benchmark
samuelchassot May 26, 2025
37c785b
benchmark
samuelchassot May 28, 2025
d9ad597
TODO for the hashconsing
samuelchassot May 28, 2025
5a3a5fd
move todo file
samuelchassot May 28, 2025
2735d94
add mem version of findlongest match for zipper with Vector
samuelchassot May 28, 2025
1d167e6
add memoised version of lex with zippers
samuelchassot May 28, 2025
d812ed0
move away from implicit in findlongestzippervectormem
samuelchassot May 28, 2025
bc68544
data
samuelchassot May 28, 2025
38579df
Merge branch 'main' into sam/amylexer
samuelchassot Aug 28, 2025
8f88c10
add microbenchmark for longs vs bigints
samuelchassot Aug 28, 2025
eab2415
fix seed
samuelchassot Aug 28, 2025
8b7faf1
long bigint comparisons
samuelchassot Aug 28, 2025
86bc101
data
samuelchassot Aug 28, 2025
8939c85
new bigint vs long data
samuelchassot Aug 28, 2025
32fd835
Merge branch 'sam/amylexer' of github.com:epfl-lara/bolts into sam/am…
samuelchassot Aug 28, 2025
ef064be
new plots
samuelchassot Aug 28, 2025
53e7a03
missing memoization
samuelchassot Aug 28, 2025
fd6fa26
Merge branch 'sam/amylexer' of github.com:epfl-lara/bolts into sam/am…
samuelchassot Aug 28, 2025
7719db8
update to scala 3.7.2
samuelchassot Sep 1, 2025
5633a50
add a main to run memoized version, a script to run asyncprofiler
samuelchassot Sep 2, 2025
c0f025a
add assembly as a plugin
samuelchassot Sep 2, 2025
63e7288
script + main
samuelchassot Sep 2, 2025
a1d498a
main
samuelchassot Sep 2, 2025
142cf68
new hash functions
samuelchassot Sep 2, 2025
46ecee5
new hash
samuelchassot Sep 2, 2025
07dd08d
move keyhashable
samuelchassot Sep 2, 2025
8156f31
update scallion
samuelchassot Sep 2, 2025
f89ebac
data
samuelchassot Sep 2, 2025
6d67ef8
new data, BETTER Hash function
samuelchassot Sep 2, 2025
b99a9ae
new hash function with smaller prime
samuelchassot Sep 3, 2025
dc3129a
recursive hash function for regex, without Hashable[C]
samuelchassot Sep 3, 2025
b785910
new regex benchmark with memoization
samuelchassot Sep 3, 2025
5e40832
plots
samuelchassot Sep 3, 2025
5364bf8
start to work on python lexer
samuelchassot Sep 3, 2025
7b0d918
continue working on python lexer + some refactoring of the utils
samuelchassot Sep 4, 2025
3716195
python lexer does somthing that looks good
samuelchassot Sep 4, 2025
5817e5a
new main, new python example, rename folder
samuelchassot Sep 5, 2025
a193c8f
fix a few python lexer issue, BUT MAINLY add a lex tailrec version wi…
samuelchassot Sep 8, 2025
faaaa5c
move to tailrec
samuelchassot Sep 8, 2025
035db8c
add tailrecmem version
samuelchassot Sep 8, 2025
747741d
fix proofs for lexMem
samuelchassot Sep 9, 2025
902ce38
add large python program
samuelchassot Sep 9, 2025
464e7e9
ghost value to avoid bug
samuelchassot Sep 9, 2025
3ce8afe
new json lexer example
samuelchassot Sep 10, 2025
5d00284
new specification for findConcatCut with Exists, TODO make sure the p…
samuelchassot Sep 11, 2025
3436e66
add zipper example worksheet
samuelchassot Sep 12, 2025
99ec691
ws
samuelchassot Sep 12, 2025
5c974d7
fix verify.sh
samuelchassot Sep 12, 2025
ae0a2b9
add separable tokens as a function easier to call
samuelchassot Sep 16, 2025
c28ce0b
adapt demi
samuelchassot Sep 16, 2025
a60be2f
WIP
samuelchassot Sep 16, 2025
b880aae
ignore venv
samuelchassot Sep 16, 2025
a3cfc5a
verified separation, hopefully more efficient
samuelchassot Sep 16, 2025
5a267df
Merge branch 'sam/amylexer' of github.com:epfl-lara/bolts into sam/am…
samuelchassot Sep 16, 2025
951e4bd
Merge branch 'sam/amylexer' of github.com:epfl-lara/bolts into sam/am…
samuelchassot Sep 16, 2025
9abd612
prefixMatch memoized, and separableTokens
samuelchassot Sep 16, 2025
0ba37ae
lostCause on context as a lazy val, and separation predicate with inv…
samuelchassot Sep 16, 2025
7a2d39c
mutually recursive error
samuelchassot Sep 16, 2025
4ebc096
update lostCause for context, add preconditions
samuelchassot Sep 16, 2025
1789937
change predicate to mem
samuelchassot Sep 16, 2025
d17eaeb
add a lemma and a law to prove that lexing process produces tokens th…
samuelchassot Sep 16, 2025
068e520
fix aliasing issues
samuelchassot Sep 17, 2025
c3a81f9
analysis
samuelchassot Sep 17, 2025
c74a48b
documentation
samuelchassot Sep 17, 2025
8437a0e
results + new represetnation for the tokens produces by rules predicate
samuelchassot Sep 17, 2025
d5880c9
remove results to avoid confusion
samuelchassot Sep 17, 2025
c99e6d0
todo
samuelchassot Sep 17, 2025
64c8a34
PrintableTokens wrapper with invariant separable tokens
samuelchassot Sep 17, 2025
fe9ad2c
new Vector
samuelchassot Sep 18, 2025
78fea6d
fix proof, to have characters non empty as invariant in tokens
samuelchassot Sep 18, 2025
d452e1c
add method to create a PrintableTokens isntance
samuelchassot Sep 18, 2025
5e794f8
move function outside of PrintableTokens
samuelchassot Sep 18, 2025
85928f5
add json manipulation to verifyu
samuelchassot Sep 18, 2025
9e252ef
add JsonManipulation example
samuelchassot Sep 18, 2025
528d377
new json manipulation example with rules preservation
samuelchassot Sep 19, 2025
be141fe
assertion of lex == lex
samuelchassot Sep 19, 2025
ac81840
change to bigint
samuelchassot Sep 19, 2025
ec614e6
new json lexer
samuelchassot Sep 19, 2025
9ae867c
new json manipulation fixed
samuelchassot Sep 19, 2025
1a9d40d
memoized rulesindividually, new json manipulation
samuelchassot Sep 19, 2025
c06b57d
fix json manipulation
samuelchassot Sep 19, 2025
b4f149d
print is now tailrec
samuelchassot Sep 19, 2025
57a4226
higher timeout
samuelchassot Sep 22, 2025
d2f5337
add tailrec version of printwithseparatortoken and some lemmas, and n…
samuelchassot Sep 23, 2025
d8b4ac8
comment
samuelchassot Sep 23, 2025
e22fe12
add a law to prove that interleaving separator leads to separable tok…
samuelchassot Sep 24, 2025
ed8961d
Merge branch 'main' into sam/amylexer
samuelchassot Sep 24, 2025
497ed53
remove wrong import
samuelchassot Sep 24, 2025
3bdc011
new memoized verson of creating a new printabletokens instance
samuelchassot Sep 26, 2025
4d52923
update benchmark to use memoized
samuelchassot Sep 26, 2025
41d4037
fix
samuelchassot Sep 26, 2025
0381cbb
new string to bigint functions
samuelchassot Sep 30, 2025
296a2df
simpler code for json lexer
samuelchassot Sep 30, 2025
2d4540f
fix regex
samuelchassot Sep 30, 2025
1ae1a60
add check for proof, more timeout
samuelchassot Sep 30, 2025
09a6d86
update benchmark to match teh other benchmark specific branch
samuelchassot Oct 7, 2025
3fed3ed
remove old data
samuelchassot Oct 8, 2025
58efa67
add run benchmark script
samuelchassot Oct 8, 2025
d6d565e
remove tokens file
samuelchassot Oct 8, 2025
4eb333c
update readme
samuelchassot Oct 8, 2025
f108703
remove comment
samuelchassot Oct 8, 2025
f6986f5
update example utils
samuelchassot Oct 8, 2025
b5ecb09
import in json manipulation
samuelchassot Oct 8, 2025
23f864d
imports
samuelchassot Oct 8, 2025
1527897
comment import in JSON lexer
samuelchassot Oct 8, 2025
518618d
python lexer imports
samuelchassot Oct 8, 2025
375347f
python lexer import
samuelchassot Oct 8, 2025
0c64a49
lexer interface imports
samuelchassot Oct 8, 2025
f2492f8
optimized check
samuelchassot Oct 8, 2025
5212c4a
vector comments import
samuelchassot Oct 8, 2025
38d645b
lexer import comments
samuelchassot Oct 8, 2025
ff2cea8
regex import
samuelchassot Oct 8, 2025
649a8f8
example res
samuelchassot Oct 8, 2025
bd97db7
hashmap import
samuelchassot Oct 8, 2025
f8d4253
fix imports
samuelchassot Oct 8, 2025
7f25bbf
add benchmark results
samuelchassot Oct 8, 2025
4ebaa6c
gitig
samuelchassot Oct 8, 2025
3a9c10b
match imports
samuelchassot Oct 8, 2025
1dd29ea
mutable map interface imports
samuelchassot Oct 8, 2025
7126279
import
samuelchassot Oct 8, 2025
51dbef1
formatting
samuelchassot Oct 8, 2025
7e78747
formatting
samuelchassot Oct 8, 2025
5d5a296
formatting
samuelchassot Oct 8, 2025
ae4581b
imports
samuelchassot Oct 8, 2025
d5c9101
new main, refactor to move utils to example
samuelchassot Oct 8, 2025
1de2daf
utils move
samuelchassot Oct 8, 2025
4f72dfa
readme + requirements
samuelchassot Oct 8, 2025
0b9ab74
rename packages to avoid ch and epfl to show up in paper material
samuelchassot Oct 8, 2025
6f311d2
fix benchmark paths
samuelchassot Oct 8, 2025
03b7fcc
remove heavy example files
samuelchassot Oct 9, 2025
702714b
fix script and sbt
samuelchassot Oct 9, 2025
92a6eb1
new data
samuelchassot Oct 9, 2025
0a1cd06
new benchmark script to convert units
samuelchassot Oct 9, 2025
b1aa19b
add no colors
samuelchassot Oct 10, 2025
5210e5f
data
samuelchassot Oct 10, 2025
ddc8ef8
rename token.characters into charsOf
samuelchassot Oct 10, 2025
7920b5a
rename in build.sbt
samuelchassot Oct 10, 2025
1c266cd
add ghost to lemmas
samuelchassot Oct 10, 2025
ff88b08
scripts
samuelchassot Oct 10, 2025
c80b43e
update script plotting
samuelchassot Oct 23, 2025
a705359
Merge branch 'main' into sam/lexerFinalized
samuelchassot Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import org.openjdk.jmh.annotations.*
import scala.collection.mutable.LongMap
import scala.collection.mutable.HashMap
import scala.util.Random
import ch.epfl.map.MutableLongMap
import com.mutablemaps.map.MutableLongMap
import stainless.collection.{List => StainlessList}
import scala.collection.immutable
import ch.epfl.map.EfficientFill
import ch.epfl.map.MutableHashMap
import ch.epfl.map.MutableLongMap
import ch.epfl.map.Hashable
import ch.epfl.map.ListMap
import ch.epfl.map.Ordering
import com.mutablemaps.map.EfficientFill
import com.mutablemaps.map.MutableHashMap
import com.mutablemaps.map.MutableLongMap
import com.mutablemaps.map.Hashable
import com.mutablemaps.map.ListMap
import com.mutablemaps.map.Ordering


@State(Scope.Benchmark)
Expand Down Expand Up @@ -282,7 +282,7 @@ object HashMapBenchmarkUtilBig {
mutableMap
}

val verifiedHashMapFilledWith2to22Values = {
val verifiedHashMapFilledWith2to22Values: MutableHashMap.HashMap[Key, Long] = {
val mutableMap: MutableHashMap.HashMap[Key, Long] = getVerifiedHashMapEmptyBuffer(16)
for (k, v) <- random2to22Pairs do mutableMap.update(k, v)
end for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import org.openjdk.jmh.annotations.*
import scala.collection.mutable.LongMap
import scala.collection.mutable.HashMap
import scala.util.Random
import ch.epfl.map.MutableLongMap
import ch.epfl.map.MutableLongMapOpti
import ch.epfl.map.ListLongMap
import com.mutablemaps.map.MutableLongMap
import com.mutablemaps.map.MutableLongMapOpti
import com.mutablemaps.map.ListLongMap
import stainless.collection.{List => StainlessList}
import scala.collection.immutable
import ch.epfl.map.MutableLongMapOpti.LongMapOpti
import com.mutablemaps.map.MutableLongMapOpti.LongMapOpti
import benchmark.BenchmarkUtil.getHashMapEmptyBuffer
import ch.epfl.map.EfficientFill
import com.mutablemaps.map.EfficientFill

@State(Scope.Benchmark)
class ArrayFillBenchmark {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** This file contains implementations of a "fill" function for Array, used as benchmark.
*/

package ch.epfl.map
package com.mutablemaps.map

import MutableLongMap.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Author: Samuel Chassot Contains only the code of the ListLongMap, without specification nor proof, for line counting purposes.
*/

package ch.epfl.map
package com.mutablemaps.map

import stainless.annotation._
import stainless.collection._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Author: Samuel Chassot
*/

package ch.epfl.map
package com.mutablemaps.map

import stainless.annotation._
import stainless.collection._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Author: Samuel Chassot
*/

package ch.epfl.map
package com.mutablemaps.map

import stainless.annotation._
import stainless.collection._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
package ch.epfl.map
package com.mutablemaps.map

import ch.epfl.map.MutableLongMap
import ch.epfl.map.ListLongMap
import com.mutablemaps.map.MutableLongMap
import com.mutablemaps.map.ListLongMap
import stainless.collection.List
import benchmark.BenchmarkUtil.*
import benchmark.Key
import ch.epfl.map.MutableHashMap.*
import ch.epfl.map.MutableLongMap.ValueCellFull
import ch.epfl.map.MutableLongMap.EmptyCell
import com.mutablemaps.map.MutableHashMap.*
import com.mutablemaps.map.MutableLongMap.ValueCellFull
import com.mutablemaps.map.MutableLongMap.EmptyCell
import scala.collection.mutable.HashMap
import stainless.lang.Cell
import com.mutablemaps.map.MutableLongMap.ValueCell
object Main {
def main(args: Array[String]): Unit = {
// check the number of collisions of each levels:

val mapFilled = benchmark.HashMapBenchmarkUtilBig.verifiedHashMapFilledWith2to22Values
val mapFilled: MutableHashMap.HashMap[Key, Long] = benchmark.HashMapBenchmarkUtilBig.verifiedHashMapFilledWith2to22Values
println(f"mapFilled.size = ${mapFilled.size}")
var bucketSizes: HashMap[BigInt, Int] = HashMap()
var i = 0
while (i < mapFilled.underlying.v.underlying.v.mask + 1) {
val key = mapFilled.underlying.v.underlying.v._keys(i)
val key: Long = mapFilled.underlying.v.underlying.v._keys(i)
if(key != 0 && key != Long.MinValue) {
val value = mapFilled.underlying.v.underlying.v._values(i)
val value: ValueCell[List[(Key, Long)]] = mapFilled.underlying.v.underlying.v._values(i)
println(value)
value match
case ValueCellFull(v) => bucketSizes(v.size) = bucketSizes.getOrElse(v.size, 0) + 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
/** Author: Samuel Chassot
*/
package ch.epfl.map
package com.mutablemaps.map

import stainless.annotation._
import stainless.collection.{ListMap => ListMapStainless, ListMapLemmas => ListMapLemmasStainless, _}
import stainless.equations._
import stainless.lang.{ghost => ghostExpr, _}
import stainless.proof.check
import scala.annotation.tailrec
import stainless.lang.Cell
import MutableLongMap._
import LongMapFixedSize.validMask
import scala.annotation.tailrec

import stainless.lang.StaticChecks.* // Comment out when using the OptimisedEnsuring object below
// import OptimisedChecks.* // Import to remove `ensuring` and `require` from the code for the benchmarks
// BEGIN uncomment for verification ------------------------------------------
import stainless.lang.StaticChecks._
import stainless.lang.{ghost => ghostExpr, _}
import stainless.proof.check
// END uncomment for verification --------------------------------------------
// BEGIN imports for benchmarking -------------------------------------------
// import stainless.lang.{ghost => _, decreases => _, unfold => _, _}
// import com.mutablemaps.map.OptimisedChecks.*
// import Predef.{assert => _, Ensuring => _, require => _}

// @tailrec
// def dummyMutableHashMap(x: BigInt): BigInt = {
// if (x == BigInt(0)) then x
// else dummyMutableHashMap(x - BigInt(1))
// }.ensuring( res => res == BigInt(0))
// END imports for benchmarking ---------------------------------------------

import MutableMapInterface.MutableMap

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
/** Author: Samuel Chassot
*/
package ch.epfl.map
package com.mutablemaps.map

import stainless.annotation._
import stainless.collection._
import stainless.equations._
import stainless.lang.{ghost => ghostExpr, *}
import stainless.proof.check
import scala.annotation.tailrec
import stainless.lang.Cell

import stainless.lang.StaticChecks.* // Comment out when using the OptimisedEnsuring object below
// import OptimisedChecks.* // Import to remove `ensuring` and `require` from the code for the benchmarks

import scala.annotation.tailrec
import MutableMapInterface.MutLongMap

// BEGIN uncomment for verification ------------------------------------------
import stainless.lang.StaticChecks._
import stainless.lang.{ghost => ghostExpr, _}
import stainless.proof.check
// END uncomment for verification --------------------------------------------
// BEGIN imports for benchmarking -------------------------------------------
// import stainless.lang.{ghost => _, decreases => _, unfold => _, _}
// import com.mutablemaps.map.OptimisedChecks.*
// import Predef.{assert => _, Ensuring => _, require => _}

// @tailrec
// def dummyMutableLongMap(x: BigInt): BigInt = {
// if (x == BigInt(0)) then x
// else dummyMutableLongMap(x - BigInt(1))
// }.ensuring( res => res == BigInt(0))
// END imports for benchmarking ---------------------------------------------

object MutableLongMap {
import LongMapFixedSize.validMask

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* It comes without proof or specification, and is used for benchmarking purposes.
*/
package ch.epfl.map
package com.mutablemaps.map

import stainless.annotation._
import stainless.collection._
Expand All @@ -14,8 +14,8 @@ import stainless.proof.check
import scala.annotation.tailrec
import stainless.lang.Cell

// import stainless.lang.StaticChecks.* // Comment out when using the OptimisedEnsuring object below
import OptimisedChecks.* // Import to remove `ensuring` and `require` from the code for the benchmarks
import stainless.lang.StaticChecks.* // Comment out when using the OptimisedEnsuring object below
// import OptimisedChecks.* // Import to remove `ensuring` and `require` from the code for the benchmarks

object MutableLongMapOpti {
import LongMapFixedSizeOpti.validMask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Author: Samuel Chassot
*/
package ch.epfl.map
package com.mutablemaps.map

import stainless.annotation._
import stainless.collection._
Expand All @@ -10,7 +10,22 @@ import stainless.proof.check
import scala.annotation.tailrec
import stainless.lang.Cell

import stainless.lang.StaticChecks.* // Comment out when using the OptimisedEnsuring object below
// BEGIN uncomment for verification ------------------------------------------
import stainless.lang.StaticChecks._
import stainless.lang.{ghost => ghostExpr, _}
import stainless.proof.check
// END uncomment for verification --------------------------------------------
// BEGIN imports for benchmarking -------------------------------------------
// import stainless.lang.{ghost => _, decreases => _, unfold => _, _}
// import com.ziplex.lexer.OptimisedChecks.*
// import Predef.{assert => _, Ensuring => _, require => _, ???}

// @tailrec
// def dummyMMapInterface(x: BigInt): BigInt = {
// if (x == BigInt(0)) then x
// else dummyMMapInterface(x - BigInt(1))
// }.ensuring( res => res == BigInt(0))
// END imports for benchmarking ---------------------------------------------

object MutableMapInterface{
@mutable
Expand Down Expand Up @@ -68,7 +83,7 @@ object MutableMapInterface{

@mutable
trait MutableMap[K, V] {
import ch.epfl.map.ListMap
import com.mutablemaps.map.ListMap
/**
* Invariant for the datastructure
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** Author: Samuel Chassot
*/

package com.mutablemaps.map

object OptimisedChecks {
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 = ()
inline def check(inline condition: Boolean): Unit = ()
inline def decreases(inline r1: Any): Unit = ()
inline def decreases(inline r1: Any, inline r2: Any): Unit = ()
inline def decreases(inline r1: Any, inline r2: Any, inline r3: Any): Unit = ()
inline def decreases(inline r1: Any, inline r2: Any, inline r3: Any, inline r4: Any, inline r5: Any): Unit = ()
inline def ghostExpr(inline expr: Any): Unit = ()
inline def unfold[T](inline expr: T): Unit = ()
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Author: Samuel Chassot
*/

package ch.epfl.map
package com.mutablemaps.map

import stainless.annotation._
import stainless.collection._
Expand Down
10 changes: 5 additions & 5 deletions data-structures/maps/mutablemaps/verify.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
stainless-dotty\
./src/main/scala/ch/epfl/map/ListMap.scala\
./src/main/scala/ch/epfl/map/ListLongMap.scala\
./src/main/scala/ch/epfl/map/MutableLongMap.scala\
./src/main/scala/ch/epfl/map/MutableHashMap.scala\
./src/main/scala/ch/epfl/map/MutableMapsInterface.scala\
./src/main/scala/com/mutablemaps/map/ListMap.scala\
./src/main/scala/com/mutablemaps/map/ListLongMap.scala\
./src/main/scala/com/mutablemaps/map/MutableLongMap.scala\
./src/main/scala/com/mutablemaps/map/MutableHashMap.scala\
./src/main/scala/com/mutablemaps/map/MutableMapsInterface.scala\
--config-file=stainless.conf -Dparallel=6 $1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ch.epfl.set

import ch.epfl.map.MutableLongMap
import ch.epfl.map.ListLongMap
import ch.epfl.map.Hashable
import com.mutablemaps.map.MutableLongMap
import com.mutablemaps.map.ListLongMap
import com.mutablemaps.map.Hashable
import ch.epfl.set.MutableHashSet

object Main {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import stainless.proof.check

import stainless.lang.StaticChecks.* // Comment out when using the OptimisedEnsuring object below

import ch.epfl.map.MutableMapInterface.MutableMap
import ch.epfl.map.MutableHashMap
import ch.epfl.map.Hashable
import ch.epfl.map.ListMap
import ch.epfl.map.TupleListOpsGenK
import com.mutablemaps.map.MutableMapInterface.MutableMap
import com.mutablemaps.map.MutableHashMap
import com.mutablemaps.map.Hashable
import com.mutablemaps.map.ListMap
import com.mutablemaps.map.TupleListOpsGenK

object MutableHashSet {
/** Helper method to create a new empty HashSet
Expand Down
Binary file added lexers/regex/.DS_Store
Binary file not shown.
8 changes: 7 additions & 1 deletion lexers/regex/verifiedlexer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ metals.sbt

# Stainless plugin
stainless/
project/lib
project/lib

stainless-stack-trace.txt

.venv

**/plots
Loading