@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
33 lines (32 loc) • 2.31 kB
TypeScript
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
import type { AbstractDomain, ConcreteDomain } from './abstract-domain';
import { Top } from './lattice';
/** The type of the abstract state for a abstract domain mapping AST node IDs to abstract values of an abstract domain */
export type AbstractState<Domain extends AbstractDomain<unknown, unknown, unknown, unknown>> = Map<NodeId, Domain>;
/** The type of the concrete state for the concrete domain of an abstract domain mapping AST node IDs to a concrete value in the concrete domain */
export type ConcreteState<Domain extends AbstractDomain<unknown, unknown, unknown, unknown>> = ReadonlyMap<NodeId, ConcreteDomain<Domain>>;
/**
* A state abstract domain as mapping of AST node IDs of a program to abstract values of an abstract domain.
* The Bottom element is defined as empty mapping and the Top element is defined as mapping every existing mapped AST node ID to Top.
* @template Domain - Type of the abstract domain to map the AST node IDs to
* @see {@link NodeId} for the node IDs of the AST nodes
*/
export declare class StateAbstractDomain<Domain extends AbstractDomain<unknown, unknown, unknown, unknown>> implements AbstractDomain<ConcreteState<Domain>, AbstractState<Domain>, AbstractState<Domain>, AbstractState<Domain>> {
private _value;
constructor(value: AbstractState<Domain>);
get value(): AbstractState<Domain>;
bottom(): StateAbstractDomain<Domain>;
top(): StateAbstractDomain<Domain>;
equals(other: StateAbstractDomain<Domain>): boolean;
leq(other: StateAbstractDomain<Domain>): boolean;
join(...values: StateAbstractDomain<Domain>[]): StateAbstractDomain<Domain>;
meet(...values: StateAbstractDomain<Domain>[]): StateAbstractDomain<Domain>;
widen(other: StateAbstractDomain<Domain>): StateAbstractDomain<Domain>;
narrow(other: StateAbstractDomain<Domain>): StateAbstractDomain<Domain>;
concretize(limit?: number): ReadonlySet<ConcreteState<Domain>> | typeof Top;
abstract(concrete: ReadonlySet<ConcreteState<Domain>> | typeof Top): StateAbstractDomain<Domain>;
toString(): string;
isTop(): this is StateAbstractDomain<Domain>;
isBottom(): this is StateAbstractDomain<Domain>;
isValue(): this is StateAbstractDomain<Domain>;
}