SpaceEngine

class SpaceEngine(using `x$1`: Context) extends SpaceLogic

Scala implementation of space logic

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

Abstract sealed types, or-types, Boolean and Java enums can be decomposed

Abstract sealed types, or-types, Boolean and Java enums can be decomposed

def checkRedundancy(_match: Match): Unit
def covers(unapp: TermRef, scrutineeTp: Type): Boolean

Whether the extractor covers the given type

Whether the extractor covers the given type

def decompose(tp: Type): List[Space]

Decompose a type into subspaces -- assume the type can be decomposed

Decompose a type into subspaces -- assume the type can be decomposed

override def intersectUnrelatedAtomicTypes(tp1: Type, tp2: Type): Space
Definition Classes
def isNullLit(tree: Tree): Boolean

Does the given tree stand for the literal null?

Does the given tree stand for the literal null?

def isNullSpace(space: Space): Boolean

Does the given space contain just the value null?

Does the given space contain just the value null?

def isSubType(tp1: Type, tp2: Type): Boolean

Is tp1 a subtype of tp2?

Is tp1 a subtype of tp2?

def project(pat: Tree): Space

Return the space that represents the pattern pat

Return the space that represents the pattern pat

def projectSeq(pats: List[Tree]): Space

Space of the pattern: unapplySeq(a, b, c: _*)

Space of the pattern: unapplySeq(a, b, c: _*)

Whether the counterexample is satisfiable. The space is flattened and non-empty.

Whether the counterexample is satisfiable. The space is flattened and non-empty.

def show(ss: Seq[Space]): String
def show(s: Space): String

Display spaces

Display spaces

def showType(tp: Type, showTypeArgs: Boolean): String

Show friendly type name with current scope in mind

Show friendly type name with current scope in mind

E.g. C.this.B --> B if current owner is C C.this.x.T --> x.T if current owner is C X[T] --> X C --> C if current owner is C !!!

def signature(unapp: TermRef, scrutineeTp: Type, argLen: Int): List[Type]

Parameter types of the case class type tp. Adapted from unapplyPlan in patternMatcher

Parameter types of the case class type tp. Adapted from unapplyPlan in patternMatcher

Inherited methods

def flatten(space: Space)(using Context): Seq[Space]

Flatten space to get rid of Or for pretty print

Flatten space to get rid of Or for pretty print

Inherited from
SpaceLogic
def intersect(a: Space, b: Space)(using Context): Space

Intersection of two spaces

Intersection of two spaces

Inherited from
SpaceLogic
def isSubspace(a: Space, b: Space)(using Context): Boolean

Is a a subspace of b? Equivalent to a - b == Empty, but faster

Is a a subspace of b? Equivalent to a - b == Empty, but faster

Inherited from
SpaceLogic
def minus(a: Space, b: Space)(using Context): Space

The space of a not covered by b

The space of a not covered by b

Inherited from
SpaceLogic
def simplify(space: Space, aggressive: Boolean)(using Context): Space

Simplify space using the laws, there's no nested union after simplify

Simplify space using the laws, there's no nested union after simplify

Value Params
aggressive

if true and OR space has less than 5 components, simplify will collapse sp1 | sp2 to sp1 if sp2 is a subspace of sp1. This reduces noise in counterexamples.

Inherited from
SpaceLogic