UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

61 lines (60 loc) 3.59 kB
import { df2quads } from './quads'; import type { NamedGraph } from '../../util/diff-graph'; import { GraphDifferenceReport } from '../../util/diff-graph'; import type { GenericDiffConfiguration } from '../../util/diff'; import { DataflowGraph } from './graph'; import type { REnvironmentInformation } from '../environments/environment'; import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context'; import type { AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/decorate'; import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id'; import { DefaultMap } from '../../util/collections/defaultmap'; /** * The underlying functions which work for any graph* like view * **Please do not use this object directly but use the helpers** * - {@link Dataflow} * - {@link CallGraph} */ export declare const GraphHelper: { /** Maps to the mermaid-centric visualization helper for dataflow graphs and their views */ readonly visualize: { /** * Mermaid rendering helper for dataflow graphs * - {@link DataflowMermaid.url}, {@link DataflowMermaid.raw} - to render the graph as a mermaid graph (e.g., in markdown or the mermaid live editor) * - {@link DataflowMermaid.convert} - for the underlying transformation * @see {@link DataflowMermaid} */ readonly mermaid: { readonly name: "DataflowMermaid"; readonly convert: (this: void, config: import("../../util/mermaid/dfg").MermaidGraphConfiguration) => { string: string; mermaid: import("../../util/mermaid/dfg").MermaidGraph; }; readonly raw: (this: void, graph: DataflowGraph | import("../info").DataflowInformation, includeEnvironments?: boolean, mark?: ReadonlySet<NodeId>, simplified?: boolean) => string; readonly url: (this: void, graph: DataflowGraph | import("../info").DataflowInformation, includeEnvironments?: boolean, mark?: ReadonlySet<NodeId>, simplified?: boolean) => string; }; readonly quads: { readonly convert: typeof df2quads; }; }; /** * Compare two dataflow graphs and return a report on the differences. * If you simply want to check whether they equal, use {@link GraphDifferenceReport#isEqual|`<result>.isEqual()`}. * @see {@link diffOfControlFlowGraphs} - for control flow graphs */ readonly diffGraphs: <G extends DataflowGraph>(this: void, left: NamedGraph<G>, right: NamedGraph<G>, config?: Partial<GenericDiffConfiguration>) => GraphDifferenceReport; /** * Inverts the given dataflow graph by reversing all edges. */ readonly invertGraph: <G extends DataflowGraph>(this: void, graph: G, cleanEnv: REnvironmentInformation) => G; /** * Resolves the dataflow graph ids from slicing criterion form to ids. * This returns a **new** graph with the resolved ids. * The main use-case for this is testing - if you do not know/want to fix the specific id, * you can use, e.g. `2@x` as a placeholder for the first x in the second line! */ readonly resolveGraphCriteria: <G extends DataflowGraph>(graph: G, ctx: ReadOnlyFlowrAnalyzerContext, idMap?: AstIdMap) => G; /** * Determines whether there is a path from `from` to `to` in the given graph (via any edge type, only respecting direction) */ readonly reaches: <G extends DataflowGraph>(this: void, from: NodeId, to: NodeId, graph: G, knownReachability?: DefaultMap<NodeId, Set<NodeId>>) => boolean; };