@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
39 lines (38 loc) • 2.2 kB
TypeScript
import { type AbstractDomain } from './abstract-domain';
import { Bottom, Top } from './lattice';
/** The type of the actual values of the singleton domain as single value */
export type SingletonValue<T> = T;
/** The type of the Top element of the singleton domain as {@link Top} symbol */
export type SingletonTop = typeof Top;
/** The type of the Bottom element of the singleton domain as {@link Bottom} symbol */
export type SingletonBottom = typeof Bottom;
/** The type of the abstract values of the singleton domain that are Top, Bottom, or actual values */
export type SingletonLift<T> = SingletonValue<T> | SingletonTop | SingletonBottom;
/**
* The singleton abstract domain as single possible value.
* The Bottom element is defined as {@link Bottom} symbol and the Top element is defined as {@link Top} symbol.
* @template T - Type of the value in the abstract domain
* @template Value - Type of the constraint in the abstract domain (Top, Bottom, or an actual value)
*/
export declare class SingletonDomain<T, Value extends SingletonLift<T> = SingletonLift<T>> implements AbstractDomain<T, SingletonValue<T>, SingletonTop, SingletonBottom, Value> {
private _value;
constructor(value: Value);
get value(): Value;
static top<T>(): SingletonDomain<T, SingletonTop>;
static bottom<T>(): SingletonDomain<T, SingletonBottom>;
static abstract<T>(concrete: ReadonlySet<T> | typeof Top): SingletonDomain<T>;
top(): SingletonDomain<T, SingletonTop>;
bottom(): SingletonDomain<T, SingletonBottom>;
equals(other: SingletonDomain<T>): boolean;
leq(other: SingletonDomain<T>): boolean;
join(...values: SingletonDomain<T>[]): SingletonDomain<T>;
meet(...values: SingletonDomain<T>[]): SingletonDomain<T>;
widen(other: SingletonDomain<T>): SingletonDomain<T>;
narrow(other: SingletonDomain<T>): SingletonDomain<T>;
concretize(): ReadonlySet<T> | typeof Top;
abstract(concrete: ReadonlySet<T> | typeof Top): SingletonDomain<T>;
toString(): string;
isTop(): this is SingletonDomain<T, SingletonTop>;
isBottom(): this is SingletonDomain<T, SingletonBottom>;
isValue(): this is SingletonDomain<T, SingletonValue<T>>;
}