@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
29 lines (28 loc) • 2.24 kB
TypeScript
import type { SliceResult } from './slicer-types';
import { type Fingerprint } from './fingerprint';
import { VisitingQueue } from './visiting-queue';
import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
import { type REnvironmentInformation } from '../../dataflow/environments/environment';
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
import type { DataflowInformation } from '../../dataflow/info';
import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
import { SliceDirection } from '../../util/slice-direction';
export declare const slicerLogger: import("tslog").Logger<import("tslog").ILogObj>;
/**
* This returns the ids to include in the static slice of the given type, when slicing with the given seed id's (must be at least one).
* <p>
* The returned ids can be used to {@link reconstructToCode|reconstruct the slice to R code}.
* @param ctx - The analyzer context used for slicing.
* @param info - The dataflow information used for slicing.
* @param idMap - The mapping from node ids to their information in the AST.
* @param ids - The seed ids to slice with. Must be at least one.
* @param direction - The direction to slice in.
* @param threshold - The maximum number of nodes to visit in the graph. If the threshold is reached, the slice will side with inclusion and drop its minimal guarantee. The limit ensures that the algorithm halts.
* @param cache - A cache to store the results of the slice. If provided, the slice may use this cache to speed up the slicing process.
*/
export declare function staticSlice(ctx: ReadOnlyFlowrAnalyzerContext, info: DataflowInformation, { idMap }: NormalizedAst, ids: readonly NodeId[], direction: SliceDirection, threshold?: number, cache?: Map<Fingerprint, Set<NodeId>>): Readonly<SliceResult>;
/**
* Updates the potential addition for the given target node in the visiting queue.
* This describes vertices that might be added *if* another path reaches them.
*/
export declare function updatePotentialAddition(queue: VisitingQueue, id: NodeId, target: NodeId, baseEnvironment: REnvironmentInformation, envFingerprint: string): void;