Skip to content
Snippets Groups Projects
Commit ee51c07f authored by Regis Blanc's avatar Regis Blanc
Browse files

some testcase for map not working

parent a06475fb
No related branches found
No related tags found
No related merge requests found
import scala.collection.immutable.Set
import leon.annotation._
import leon.lang._
object BasicMap {
def insert(m: Map[BigInt, BigInt], key: BigInt, value: BigInt): Map[BigInt, BigInt] = {
require(!m.isDefinedAt(key))
m + (key -> value)
} ensuring(res => res(key) == value)
def unionWorks(m1: Map[BigInt, BigInt], m2: Map[BigInt, BigInt], key: BigInt): Boolean = {
require(m1.isDefinedAt(key) || m2.isDefinedAt(key))
(m1 ++ m2).isDefinedAt(key)
}.holds
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment