UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

44 lines (43 loc) 2.21 kB
import { type AnyAbstractDomain, AbstractDomain } from './abstract-domain'; import { Top } from './lattice'; /** The type of an abstract product of a product domain mapping named properties of the product to abstract domains */ export type AbstractProduct<Domain extends AnyAbstractDomain = AnyAbstractDomain> = { [key in string]?: Domain; }; /** The type of the concrete product of an abstract product mapping each property to a concrete value in the respective concrete domain */ export type ConcreteProductOf<Product extends AbstractProduct> = { [Key in keyof Product]: Product[Key] extends AbstractDomain<infer Concrete, unknown, unknown, unknown> ? Concrete : never; }; /** * A partial product abstract domain as named Cartesian product of (optional) sub abstract domains. * The sub abstract domains are represented by a (partial) record mapping property names to abstract domains. * The Bottom element is defined as mapping every sub abstract domain to Bottom and the Top element is defined as having no sub abstract domain value. * @template Product - Type of the abstract product of the product domain mapping (optional) property names to abstract domains */ export declare abstract class PartialProductDomain<Product extends AbstractProduct> extends AbstractDomain<ConcreteProductOf<Product>, Product, Product, Product> { readonly domain: Required<Product>; constructor(value: Product, domain: Required<Product>); abstract create(value: Product): this; bottom(): this; top(): this; equals(other: this): boolean; leq(other: this): boolean; join(other: this): this; meet(other: this): this; widen(other: this): this; narrow(other: this): this; concretize(limit: number): ReadonlySet<ConcreteProductOf<Product>> | typeof Top; abstract(concrete: ReadonlySet<ConcreteProductOf<Product>> | typeof Top): this; toJson(): unknown; toString(): string; isTop(): boolean; isTop(): this is this; isBottom(): boolean; isBottom(): this is this; isValue(): boolean; isValue(): this is this; /** * Optional reduction function for a reduced product domain. */ protected reduce(value: Product): Product; }