@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
33 lines (32 loc) • 1.81 kB
TypeScript
import { AbstractDomain, type AnyAbstractDomain } 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 = Record<string, AnyAbstractDomain>;
/** The type of the concrete product of an abstract product mapping each property to a concrete value in the respective concrete domain */
export type ConcreteProduct<Product extends AbstractProduct> = {
[Key in keyof Product]: Product[Key] extends AbstractDomain<infer Concrete, unknown, unknown, unknown> ? Concrete : never;
};
/**
* A product abstract domain as named Cartesian product of sub abstract domains.
* The sub abstract domains are represented by a 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 mapping every sub abstract domain to Top.
* @template Product - Type of the abstract product of the product domain mapping property names to abstract domains
*/
export declare abstract class ProductDomain<Product extends AbstractProduct> extends AbstractDomain<ConcreteProduct<Product>, Product, Product, 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<ConcreteProduct<Product>> | typeof Top;
abstract(concrete: ReadonlySet<ConcreteProduct<Product>> | typeof Top): this;
toJson(): unknown;
toString(): string;
isTop(): this is this;
isBottom(): this is this;
isValue(): this is this;
}