-
Notifications
You must be signed in to change notification settings - Fork 14
[Query] Resolve Value
This document was generated from 'src/documentation/wiki-query.ts' on 2026-07-20, 17:48:26 UTC presenting an overview of flowR's query API (v2.12.3). Please do not edit this file/wiki page directly.
Resolve Value Query [overview]
Provides access to flowR's value tracking (which is configurable)
This query is requested with the type resolve-value.
Run in the REPL: :query @resolve-value (<crit>;...) <code | file://path>
With this query you can use flowR's value-tracking capabilities to resolve identifiers to all potential values they may have at runtime (if possible). The extent to which flowR traces values (e.g., built-ins vs. constants) can be configured in flowR's Configuration file (see the Interface wiki page for more information).
Using the example code x <- 1 y <-2 print(x) print(y) (with newlines), the following query returns all values of x in the code:
[
{
"type": "resolve-value",
"criteria": [
"3@x",
"4@y"
]
}
](This can be shortened to @resolve-value (3@x;4@y) "x <- 1\ny <-2\nprint(x)\nprint(y)" when used with the REPL command :query).
Results (prettified and summarized):
Query: resolve-value (6 ms)
╰ Values for {3@x, 4@y}
╰ [1L, 1L], [2L, 2L]
All queries together required ≈6 ms (1ms accuracy, total 6 ms)
Show Detailed Results as Json
The analysis required 6.0 ms (including parsing and normalization and the query) within the generation environment.
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR. Please consult the Interface wiki page for more information on how to get those.
{
"resolve-value": {
".meta": {
"timing": 6
},
"results": {
"{\"type\":\"resolve-value\",\"criteria\":[\"3@x\",\"4@y\"]}": {
"values": [
{
"type": "set",
"elements": [
{
"type": "interval",
"start": {
"type": "number",
"value": {
"markedAsInt": true,
"num": 1,
"complexNumber": false
}
},
"end": {
"type": "number",
"value": {
"markedAsInt": true,
"num": 1,
"complexNumber": false
}
},
"startInclusive": true,
"endInclusive": true
}
]
},
{
"type": "set",
"elements": [
{
"type": "interval",
"start": {
"type": "number",
"value": {
"markedAsInt": true,
"num": 2,
"complexNumber": false
}
},
"end": {
"type": "number",
"value": {
"markedAsInt": true,
"num": 2,
"complexNumber": false
}
},
"startInclusive": true,
"endInclusive": true
}
]
}
]
}
}
},
".meta": {
"timing": 6
}
}Original Code
x <- 1
y <-2
print(x)
print(y)Dataflow Graph of the R Code
The analysis required 2.6 ms (including parse and normalize, using the r-shell engine) within the generation environment. No signature database is mounted for these generated graphs, so library() calls attach no package exports; base-R names are still qualified via the generated base-package store (e.g. acf as stats::acf).
We encountered unknown side effects (with ids: 9 (linked), 13 (linked)) during the analysis.
flowchart LR
1{{"`*#91;RNumber#93;* **1**
*1.6* (**id: 1**)`"}}
%% No edges found for 1
0["`*#91;RSymbol#93;* **x**
*1.1* (**id: 0**, v: 1)`"]
2[["`*#91;RBinaryOp#93;* base#58;#58;**#60;#45;**
*1.1-6* (**id: 2**)
arg: (0, 1)`"]]
built-in:_-["`Built-In:
#60;#45;`"]
style built-in:_- stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
4{{"`*#91;RNumber#93;* **2**
*2.5* (**id: 4**)`"}}
%% No edges found for 4
3["`*#91;RSymbol#93;* **y**
*2.1* (**id: 3**, v: 4)`"]
5[["`*#91;RBinaryOp#93;* base#58;#58;**#60;#45;**
*2.1-5* (**id: 5**)
arg: (3, 4)`"]]
7(["`*#91;RSymbol#93;* **x**
*3.7* (**id: 7**)`"])
9[["`*#91;RFunctionCall#93;* base#58;#58;**print**
*3.1-8* (**id: 9**)
arg: (7)`"]]
built-in:print["`Built-In:
print`"]
style built-in:print stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
11(["`*#91;RSymbol#93;* **y**
*4.7* (**id: 11**)`"])
13[["`*#91;RFunctionCall#93;* base#58;#58;**print**
*4.1-8* (**id: 13**)
arg: (11)`"]]
0 -->|"defined-by"| 1
0 -->|"defined-by"| 2
2 -->|"reads, arg"| 1
2 -->|"returns, arg"| 0
2 -.->|"reads, calls"| built-in:_-
linkStyle 4 stroke:gray;
3 -->|"defined-by"| 4
3 -->|"defined-by"| 5
5 -->|"reads, arg"| 4
5 -->|"returns, arg"| 3
5 -.->|"reads, calls"| built-in:_-
linkStyle 9 stroke:gray;
7 -->|"reads"| 0
9 -->|"reads, returns, arg"| 7
9 -.->|"reads, calls"| built-in:print
linkStyle 12 stroke:gray;
11 -->|"reads"| 3
13 -->|"reads, returns, arg"| 11
13 -.->|"reads, calls"| built-in:print
linkStyle 15 stroke:gray;
Implementation Details
Responsible for the execution of the Resolve Value Query query is executeSearch in ./src/queries/catalog/resolve-value-query/resolve-value-query-executor.ts.
Currently maintained by Florian Sihler and Oliver Gerstl at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Testing & Linting (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information