UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

23 lines (22 loc) 1.89 kB
import type { SliceResult } from './slicer-types'; import type { Fingerprint } from './fingerprint'; import { VisitingQueue } from './visiting-queue'; import type { DataflowGraph } from '../../dataflow/graph/graph'; import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate'; import type { SlicingCriteria } from '../criterion/parse'; import type { REnvironmentInformation } from '../../dataflow/environments/environment'; import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id'; export declare const slicerLogger: import("tslog").Logger<import("tslog").ILogObj>; /** * This returns the ids to include in the static backward slice, 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 graph - The dataflow graph to conduct the slicing on. * @param ast - The normalized AST of the code (used to get static nesting information of the lexemes in case of control flow dependencies that may have no effect on the slicing scope). * @param criteria - The criterias to slice on. * @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 staticSlicing(graph: DataflowGraph, { idMap }: NormalizedAst, criteria: SlicingCriteria, threshold?: number, cache?: Map<Fingerprint, Set<NodeId>>): Readonly<SliceResult>; export declare function updatePotentialAddition(queue: VisitingQueue, id: NodeId, target: NodeId, baseEnvironment: REnvironmentInformation, envFingerprint: string): void;