Skip to content

Commit

Permalink
migrate caching
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelchassot authored and vkuncak committed Aug 23, 2024
1 parent cc9db96 commit 5d4a10d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions caching/CachedFunction.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ final case class CachedFunction[I, O](
assert(cache.valid)
assert(CachedFunction.allValuesAreFunctionOutputs(f, cache), "cached value is still function output")
result
}.ensuring { res =>
}.ensuring( res =>
unfold(this.valid)
res == f(x) && this.valid
}
)
}

// object IntHashable extends Hashable[Int] {
Expand Down
1 change: 1 addition & 0 deletions caching/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ stainless-dotty\
../data-structures/maps/mutablemaps/src/main/scala/ch/epfl/chassot/ListLongMap.scala\
../data-structures/maps/mutablemaps/src/main/scala/ch/epfl/chassot/MutableHashMap.scala \
../data-structures/maps/mutablemaps/src/main/scala/ch/epfl/chassot/MutableLongMap.scala\
../data-structures/maps/mutablemaps/src/main/scala/ch/epfl/chassot/iMutableMaps.scala\
--config-file=stainless.conf --functions=CachedFunction._

0 comments on commit 5d4a10d

Please sign in to comment.