@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
33 lines (32 loc) • 1.39 kB
TypeScript
import type { RNodeWithParent } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
import { type Lift, type Value, type ValueSet, Bottom, Top } from './r-value';
/**
* Takes n potentially lifted ops and returns `Top` or `Bottom` if any is `Top` or `Bottom`.
*/
export declare function bottomTopGuard(...a: Lift<unknown>[]): typeof Top | typeof Bottom | undefined;
/**
* Returns a value set, if a is not bottom or top, otherwise undefined.
* Useful when working with values returned by {@link Resolve.toValue}
* @param a - value set to check
* @returns value set if a is not top or bottom
*/
export declare function valueSetGuard(a: Lift<ValueSet<Value[]>>): ValueSet<Value[]> | undefined;
/**
* @useInstead {@link NodeValue.sole}
*/
export declare function soleValue(this: void, set: ValueSet<Value[]> | undefined): Value | undefined;
export declare function soleValue<T extends Value['type']>(this: void, set: ValueSet<Value[]> | undefined, type: T): Extract<Value, {
type: T;
}> | undefined;
/**
* Constructs an Abstract Value from a normal TS value
* @param a - ts value
* @returns abstract value
*/
export declare function valueFromTsValue(a: unknown): Value;
/**
* Converts a constant from an RNode into an abstract value
* @param a - RNode constant
* @returns abstract value
*/
export declare function valueFromRNodeConstant(a: RNodeWithParent): Value;