Dotty Documentation

0.2.0-bin-SNAPSHOT

trait SpaceLogic

abstract space logic

[-] Constructors

[-] Members

[+] def canDecompose ( tp: Type ) : Boolean

Is the type tp decomposable? i.e. all values of the type can be covered by its decomposed types.

Abstract sealed class, OrType, Boolean and Java enums can be decomposed.

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

Get components of decomposable types

[+] def flatten ( space: Space ) : List [ Space ]

Flatten space to get rid of Or for pretty print

[+] def intersect ( a: Space , b: Space ) : Space

Intersection of two spaces

[+] def intersectUnrelatedAtomicTypes ( tp1: Type , tp2: Type ) : Space

Return a space containing the values of both types.

The types should be atomic (non-decomposable) and unrelated (neither should be a subtype of the other).

[+] def isEqualType ( tp1: Type , tp2: Type ) : Boolean

Is tp1 the same type as tp2?

[+] def isSubType ( tp1: Type , tp2: Type ) : Boolean

Is tp1 a subtype of tp2?

[+] def isSubspace ( a: Space , b: Space ) : Boolean

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

[+] def minus ( a: Space , b: Space ) : Space

The space of a not covered by b

[+] def show ( sp: Space ) : String

Display space in string format

[+] def signature ( tp: Type ) : List [ Type ]

Return term parameter types of the case class tp

[+] def simplify ( space: Space , aggressive: Boolean ) : Space

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