UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

41 lines (40 loc) 2.33 kB
import { type AnyAbstractDomain, AbstractDomain } from './abstract-domain'; /** 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> = { readonly [key in string]?: Domain; }; /** A reduction function of a reduced product domain refining the abstract value based on the values of its sub abstract domains. */ export type ProductReduction<Product extends AbstractProduct> = (value: Product) => Product; /** * 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<Product, Product, Product> { readonly domain: Required<Product>; readonly reductions: readonly ProductReduction<Product>[]; constructor(value: Product, domain: Required<Product>, reductions?: readonly ProductReduction<Product>[], reduce?: boolean); abstract create(value: Product, reduce?: boolean): this; bottom(): this; top(): this; protected equalsValue(other: this): boolean; protected leqValue(other: this): boolean; protected joinValue(other: this): this; protected meetValue(other: this): this; protected widenValue(other: this): this; protected narrowValue(other: this): this; protected jsonify(): unknown; protected stringify(): string; isTop(): boolean; isTop(): this is this; isBottom(): boolean; isBottom(): this is this; isValue(): boolean; isValue(): this is this; /** * Applies the {@link reductions} of the (reduced) product domain to refine the abstract value based on its components. * Subclasses may override this to implement a fixed reduction instead of (or in addition to) the configurable reductions. */ protected reduce(value: Product): Product; }