Skip to content

Assert needed to prove set cardinality of intersection over union #111

Open
@viper-admin

Description

@viper-admin

Created by @mschwerhoff on 2016-01-13 13:17

#!text

method test01(xs: Set[Int], ys: Set[Int], z: Int) {
	inhale |xs intersection ys| == 0
	inhale |xs intersection Set(z)| == 0
	exhale |xs intersection (ys union Set(z))| == 0 // Unexpectedly fails
}

method test02(xs: Set[Int], ys: Set[Int], z: Int) {
	inhale |xs intersection ys| == 0
	inhale |xs intersection Set(z)| == 0

  // Allows proving the final exhale
	assert    xs intersection (ys union Set(z))
	       == (xs intersection ys) union (xs intersection Set(z))

	exhale |xs intersection (ys union Set(z))| == 0
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmajor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions