/** * Subtyping checker for Dvala's set-theoretic type system. * * Subtyping is semantic: S <: T iff the set of values denoted by S * is a subset of the set denoted by T. * * Key rules: * - Never <: T for all T (empty set is subset of everything) * - T <: Unknown for all T (everything is subset of universal set) * - Primitive <: Primitive iff same name * - Literal <: Primitive iff the literal's type matches * - Function: contravariant params, covariant return * - Record: width subtyping (more fields <: fewer fields) + depth subtyping * - Union: S1|S2 <: T iff S1 <: T and S2 <: T * - Intersection: S <: T1&T2 iff S <: T1 and S <: T2 * - Negation: S <: !T iff S & T = Never (S and T are disjoint) */ import type { Type } from './types'; /** * Check whether S is a subtype of T (S <: T). * Uses a visited set for cycle detection (recursive types). */ export declare function isSubtype(s: Type, t: Type): boolean;