Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/main/scala/ap/theories/arrays/SetTheory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ object SetTheory {
instances.getOrElseUpdate(elSort, new SetTheory(elSort))
}

/**
* Extractor for set sorts of any base type.
*/
object Sort {
def unapply(s : Sort) : Option[Sort] = s match {
case ps : Theory.TheorySort =>
ps.theory match {
case ss : SetTheory => Some(ss.elementSort)
case _ => None
}
case _ =>
None
}
}

}

/**
Expand All @@ -95,6 +110,8 @@ class SetTheory(val elementSort : Sort)
import IExpression._
val theory = SetTheory.this

override val name: String = s"Set[${elementSort.name}]"

// TODO: implement further methods. In particular, we have to translate
// back array terms to set terms, similar to how it is done in
// ArraySeqTheory
Expand Down