Skip to content

Commit

Permalink
update set
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelchassot committed Oct 14, 2024
1 parent ff2043d commit d0dc10d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontends/library/stainless/lang/Set.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ object Set {
}

@extern @pure
def flatMapPost[B](f: A => B)(b: B) = {
def flatMapPost[B](f: A => Set[B])(b: B) = {
(??? : A)
}.ensuring { _ =>
flatMap(f).contains(b) == set.exists(a => f(a).contains(b))
Expand Down Expand Up @@ -126,4 +126,7 @@ sealed case class Set[T](theSet: scala.collection.immutable.Set[T]) {

def contains(a: T): Boolean = theSet.contains(a)
def subsetOf(b: Set[T]): Boolean = theSet.subsetOf(b.theSet)

def exists(p: T => Boolean): Boolean = theSet.exists(p)
def forall(p: T => Boolean): Boolean = theSet.forall(p)
}

0 comments on commit d0dc10d

Please sign in to comment.