@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
44 lines (43 loc) • 2.87 kB
TypeScript
import { type AbstractDomain } from './abstract-domain';
import { Bottom, Top } from './lattice';
/** The type of the actual values of the set bounded set domain as set */
export type SetBoundedSetValue<T> = ReadonlySet<T>;
/** The type of the Top element of the set bounded set domain as {@link Top} symbol */
export type SetBoundedSetTop = typeof Top;
/** The type of the Bottom element of the set bounded set domain as {@link Bottom} */
export type SetBoundedSetBottom = typeof Bottom;
/** The type of the abstract values of the set bounded set domain that are Top, Bottom, or actual values */
export type SetBoundedSetLift<T> = SetBoundedSetValue<T> | SetBoundedSetTop | SetBoundedSetBottom;
/**
* The set bounded set abstract domain as sets capturing possible values of the concrete set bounded by a `limit` for the maximum number of inferred values.
* The Bottom element is defined as the{@link Bottom} and the Top element is defined as {@link Top} symbol.
* @template T - Type of the values in the abstract domain
* @template Value - Type of the constraint in the abstract domain (Top, Bottom, or an actual value)
*/
export declare class SetBoundedSetDomain<T, Value extends SetBoundedSetLift<T> = SetBoundedSetLift<T>> implements AbstractDomain<ReadonlySet<T>, SetBoundedSetValue<T>, SetBoundedSetTop, SetBoundedSetBottom, Value> {
private readonly limit;
private _value;
constructor(value: Value, limit?: number);
get value(): Value;
static top<T>(limit?: number): SetBoundedSetDomain<T, SetBoundedSetTop>;
static bottom<T>(limit?: number): SetBoundedSetDomain<T, SetBoundedSetBottom>;
static abstract<T>(concrete: ReadonlySet<ReadonlySet<T>> | typeof Top, limit?: number): SetBoundedSetDomain<T>;
top(): SetBoundedSetDomain<T, SetBoundedSetTop>;
bottom(): SetBoundedSetDomain<T, SetBoundedSetBottom>;
equals(other: SetBoundedSetDomain<T>): boolean;
leq(other: SetBoundedSetDomain<T>): boolean;
join(...values: SetBoundedSetDomain<T>[]): SetBoundedSetDomain<T>;
meet(...values: SetBoundedSetDomain<T>[]): SetBoundedSetDomain<T>;
/**
* Subtracts another abstract value from the current abstract value by removing all elements of the other abstract value from the current abstract value.
*/
subtract(other: SetBoundedSetDomain<T>): SetBoundedSetDomain<T>;
widen(other: SetBoundedSetDomain<T>): SetBoundedSetDomain<T>;
narrow(other: SetBoundedSetDomain<T>): SetBoundedSetDomain<T>;
concretize(limit?: number): ReadonlySet<ReadonlySet<T>> | typeof Top;
abstract(concrete: ReadonlySet<ReadonlySet<T>> | typeof Top): SetBoundedSetDomain<T>;
toString(): string;
isTop(): this is SetBoundedSetDomain<T, SetBoundedSetTop>;
isBottom(): this is SetBoundedSetDomain<T, SetBoundedSetBottom>;
isValue(): this is SetBoundedSetDomain<T, SetBoundedSetValue<T>>;
}