Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flatMap to the set class in the library #1588

Merged
merged 9 commits into from
Oct 16, 2024

Conversation

samuelchassot
Copy link
Collaborator

No description provided.

@@ -114,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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is set.exists available to users? It does not seem like we have many properties of it known. If no, then it's a problem if it is used in spec of flatMap. If yes, we should probably add some axioms for it, like something returning an unspecified witness if a value exists and something instantiating property if it holds for all.

Copy link
Collaborator

@vkuncak vkuncak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used implicit classes to add methods to Set. Can we use extension methods now? Would extraction need to change?

@samuelchassot
Copy link
Collaborator Author

One test is failing:

[info] SatPrecondVerificationSuite:

[info] -  12: sat-precondition/valid/SATPrecond4 solvr=princess lucky=false check=true codegen=false sat-precond=true *** FAILED *** (5 minutes, 0 seconds)

I'm looking into it.

@samuelchassot
Copy link
Collaborator Author

samuelchassot commented Oct 16, 2024

It passes locally. It is maybe a timeout issue.

@samuelchassot
Copy link
Collaborator Author

I just ignored it with Princess

@samuelchassot samuelchassot merged commit d3f12aa into epfl-lara:main Oct 16, 2024
2 checks passed
@samuelchassot samuelchassot deleted the sam/set branch October 17, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants