RefinementClosure
struct RefinementClosure : Equatable, Sendable
A subset of a program’s refinement relation containing all the bases of a single trait.
-
The refinement relationships of a closure.
Declaration
Swift
typealias Refinements = DirectedGraph<TraitType, NoLabel> -
The most-refined trait of the closure.
Declaration
Swift
let bottom: TraitType -
The traits in the closure, in no particular order.
Declaration
Swift
private(set) var unordered: Set<TraitType> { get } -
The refinement relationships in the closure.
Declaration
Swift
private(set) var refinements: Refinements { get } -
The traits in
selfsorted in topological order w.r.t. to their dependencies.Declaration
Swift
var orderedByDependency: RefinementSequence { get } -
Returns
trueifftis in the closure.Complexity
O(1)Declaration
Swift
func contains(_ t: TraitType) -> Bool -
Inserts
tas a trait inherited byuinself.Requires
uis in the closure and, ift != u, thentisn’t refined by any trait in the closure. -
Inserts the contents of
cas traits inherited byuinself.Requires
c.bottomis in the closure.Declaration
Swift
mutating func insert(_ c: `Self`, inheritedBy u: TraitType)
View on GitHub