Skip to content

[Query] Provenance

github-actions[bot] edited this page Nov 8, 2026 · 1 revision

Generated from 'wiki-query.ts' on 2026-11-08, 08:41:45 UTC (v2.17.4), do not edit directly.

Provenance Query [overview]

Calculate the provenance of a given variable, optionally restricted to its enveloping fdef
This query is requested with the type provenance.
Run in the REPL: :query @provenance (<criterion>)[f] <code | file://path>

Given a slicing criterion, flowR will return the provenance of the given program element (i.e., all related vertices in a non-interprocedural and non-context sensitive backward slice).

To exemplify the capabilities, consider the following code:

x <- 1
y <- 2
z <- 3
x

If you are interested in the provenance of the x in the last line you can use:

[ { "type": "provenance",   "criterion": "4@x" } ]

(This can be shortened to @provenance (4@x) "x <- 1\ny <- 2\nz <- 3\nx" when used with the REPL command :query).

Results (prettified and summarized):

Query: provenance (5 ms)
   ╰ Provenance for 4@x
     ╰ Mermaid Url

Show Detailed Results as Json

The analysis ran (including parsing and normalization and the query) within the generation environment.

The JSON contains the ids of the nodes in question (see the Interface wiki page).

{"provenance":{".meta":{},"results":{"4@x":[9,0,1,2,"built-in:<-"]}},".meta":{}}
Implementation Details

The Provenance Query is executed by executeProvenanceQuery.

Clone this wiki locally

⌂ 换网址