@eagleoutice/flowr 2.10.1 → 2.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +27 -16
  2. package/abstract-interpretation/absint-visitor.d.ts +13 -8
  3. package/abstract-interpretation/absint-visitor.js +35 -26
  4. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +1 -2
  5. package/abstract-interpretation/data-frame/dataframe-domain.js +14 -15
  6. package/abstract-interpretation/data-frame/mappers/access-mapper.js +2 -15
  7. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +11 -17
  8. package/abstract-interpretation/data-frame/mappers/arguments.js +18 -18
  9. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +41 -15
  10. package/abstract-interpretation/data-frame/mappers/function-mapper.js +74 -48
  11. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -1
  12. package/abstract-interpretation/data-frame/semantics.d.ts +1 -1
  13. package/abstract-interpretation/data-frame/semantics.js +31 -35
  14. package/abstract-interpretation/data-frame/shape-inference.js +1 -1
  15. package/abstract-interpretation/domains/interval-domain.d.ts +1 -0
  16. package/abstract-interpretation/domains/interval-domain.js +3 -0
  17. package/abstract-interpretation/domains/product-domain.d.ts +9 -0
  18. package/abstract-interpretation/domains/product-domain.js +26 -6
  19. package/abstract-interpretation/domains/state-abstract-domain.d.ts +36 -22
  20. package/abstract-interpretation/domains/state-abstract-domain.js +169 -62
  21. package/abstract-interpretation/unsupported-functions.d.ts +10 -0
  22. package/abstract-interpretation/unsupported-functions.js +45 -0
  23. package/benchmark/slicer.js +10 -13
  24. package/cli/flowr.js +1 -1
  25. package/control-flow/control-flow-graph.js +13 -9
  26. package/control-flow/semantic-cfg-guided-visitor.d.ts +6 -0
  27. package/control-flow/semantic-cfg-guided-visitor.js +6 -0
  28. package/dataflow/environments/built-in-proc-name.d.ts +6 -0
  29. package/dataflow/environments/built-in-proc-name.js +6 -0
  30. package/dataflow/environments/built-in.d.ts +7 -5
  31. package/dataflow/environments/built-in.js +2 -0
  32. package/dataflow/environments/default-builtin-config.d.ts +442 -6
  33. package/dataflow/environments/default-builtin-config.js +158 -3
  34. package/dataflow/environments/overwrite.js +2 -5
  35. package/dataflow/graph/df-helper.d.ts +14 -4
  36. package/dataflow/graph/df-helper.js +36 -6
  37. package/dataflow/graph/graph.d.ts +10 -0
  38. package/dataflow/graph/graph.js +12 -0
  39. package/dataflow/instrument/instrument-dataflow-count.d.ts +10 -0
  40. package/dataflow/instrument/instrument-dataflow-count.js +10 -0
  41. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +4 -4
  42. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +3 -3
  43. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +2 -2
  44. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -3
  45. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +2 -2
  46. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +2 -2
  47. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +2 -2
  48. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
  49. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -17
  50. package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -2
  51. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +2 -2
  52. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +2 -2
  53. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +2 -2
  54. package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +2 -2
  55. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +23 -3
  56. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +80 -12
  57. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +41 -0
  58. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +179 -0
  59. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +7 -4
  60. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +62 -1
  61. package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +7 -2
  62. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +15 -1
  63. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +2 -2
  64. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +2 -2
  65. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
  66. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
  67. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +2 -2
  68. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -2
  69. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +2 -2
  70. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
  71. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +2 -2
  72. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.d.ts +2 -2
  73. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
  74. package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +2 -2
  75. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
  76. package/dataflow/internal/process/functions/call/common.d.ts +2 -2
  77. package/dataflow/internal/process/functions/call/common.js +4 -3
  78. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -2
  79. package/dataflow/internal/process/functions/call/named-call-handling.d.ts +2 -2
  80. package/documentation/wiki-absint.js +6 -5
  81. package/documentation/wiki-analyzer.js +0 -2
  82. package/documentation/wiki-linter.js +1 -0
  83. package/documentation/wiki-normalized-ast.js +7 -7
  84. package/linter/linter-rules.d.ts +24 -1
  85. package/linter/linter-rules.js +3 -1
  86. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  87. package/linter/rules/dataframe-access-validation.js +3 -4
  88. package/linter/rules/roxygen-arguments.d.ts +35 -0
  89. package/linter/rules/roxygen-arguments.js +100 -0
  90. package/package.json +2 -3
  91. package/project/context/flowr-analyzer-context.d.ts +1 -8
  92. package/project/context/flowr-analyzer-context.js +1 -7
  93. package/project/context/flowr-analyzer-environment-context.d.ts +5 -0
  94. package/project/context/flowr-analyzer-environment-context.js +6 -0
  95. package/project/context/flowr-analyzer-files-context.d.ts +6 -0
  96. package/project/context/flowr-analyzer-files-context.js +4 -2
  97. package/project/flowr-analyzer-builder.js +1 -4
  98. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  99. package/queries/catalog/call-context-query/call-context-query-executor.js +10 -5
  100. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
  101. package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -0
  102. package/queries/catalog/df-shape-query/df-shape-query-format.js +7 -2
  103. package/queries/catalog/files-query/files-query-executor.js +0 -1
  104. package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +2 -0
  105. package/queries/catalog/input-sources-query/simple-input-classifier.js +2 -0
  106. package/r-bridge/data/data.d.ts +2 -2
  107. package/r-bridge/data/data.js +2 -2
  108. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +13 -5
  109. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +14 -2
  110. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +3 -3
  111. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +9 -0
  112. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +13 -0
  113. package/r-bridge/lang-4.x/ast/model/versions.d.ts +2 -0
  114. package/r-bridge/lang-4.x/ast/model/versions.js +3 -1
  115. package/r-bridge/roxygen2/documentation-provider.js +15 -6
  116. package/r-bridge/roxygen2/roxygen-ast.d.ts +3 -1
  117. package/search/flowr-search-builder.js +3 -2
  118. package/util/mermaid/ast.js +2 -1
  119. package/util/record.d.ts +23 -0
  120. package/util/record.js +33 -0
  121. package/util/version.js +1 -1
  122. package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +0 -41
  123. package/abstract-interpretation/domains/mapped-abstract-domain.js +0 -213
@@ -196,7 +196,9 @@ export type RoxygenOtherTag = RoxygenTagAuthor | RoxygenUnknownTag | RoxygenDocT
196
196
  /**
197
197
  * All known Roxygen tag types.
198
198
  */
199
- export type RoxygenTag = RoxygenCrossrefTag | RoxygenNamespaceTag | RoxygenFormattingTag | RoxygenDatasetDocumentationTag | RoxygenFunctionDocumentationTag | RoxygenReusingDocumentationTag | RoxygenOtherTag;
199
+ export type RoxygenTag = (RoxygenCrossrefTag | RoxygenNamespaceTag | RoxygenFormattingTag | RoxygenDatasetDocumentationTag | RoxygenFunctionDocumentationTag | RoxygenReusingDocumentationTag | RoxygenOtherTag) & {
200
+ inherited?: boolean;
201
+ };
200
202
  /**
201
203
  * A roxygen comment block, consisting of multiple {@link RoxygenTag|roxygen tags}.
202
204
  */
@@ -5,6 +5,7 @@ exports.getFlowrSearch = getFlowrSearch;
5
5
  const search_optimizer_1 = require("./search-optimizer/search-optimizer");
6
6
  const assert_1 = require("../util/assert");
7
7
  const search_mappers_1 = require("./search-executor/search-mappers");
8
+ const AllGeneratorObj = { type: 'generator', name: 'all', args: undefined };
8
9
  /**
9
10
  * This object holds all the methods to generate search queries.
10
11
  * For compatibility, please use the {@link Q} identifier object to access these methods.
@@ -37,7 +38,7 @@ exports.FlowrSearchGenerator = {
37
38
  * Returns all elements (nodes/dataflow vertices) from the given data.
38
39
  */
39
40
  all() {
40
- return new FlowrSearchBuilder({ type: 'generator', name: 'all', args: undefined });
41
+ return new FlowrSearchBuilder(AllGeneratorObj);
41
42
  },
42
43
  /**
43
44
  * Returns all elements that match the given {@link FlowrSearchGetFilters|filters}.
@@ -46,7 +47,7 @@ exports.FlowrSearchGenerator = {
46
47
  */
47
48
  get(filter) {
48
49
  (0, assert_1.guard)(!filter.nameIsRegex || filter.name, 'If nameIsRegex is set, a name should be provided');
49
- (0, assert_1.guard)(!filter.line || filter.line != 0, 'If line is set, it must be different from 0 as there is no 0 line');
50
+ (0, assert_1.guard)(!filter.line || filter.line !== 0, 'If line is set, it must be different from 0 as there is no 0 line');
50
51
  (0, assert_1.guard)(!filter.column || filter.column > 0, 'If column is set, it must be greater than 0, but was ' + filter.column);
51
52
  return new FlowrSearchBuilder({ type: 'generator', name: 'get', args: { filter } });
52
53
  },
@@ -57,7 +57,8 @@ function normalizedAstToMermaid(ast, { prefix = 'flowchart TD\n', markStyle = in
57
57
  // add a subgraph for each file
58
58
  if (ast.files.length !== 1 || (f.filePath && f.filePath !== flowr_file_1.FlowrFile.INLINE_PATH)) {
59
59
  const direction = identifyMermaidDirection(prefix);
60
- output += ` subgraph "File: ${mermaid_1.Mermaid.escape(f.filePath ?? flowr_file_1.FlowrFile.INLINE_PATH)}" direction ${direction}\n`;
60
+ output += ` subgraph "File: ${mermaid_1.Mermaid.escape(f.filePath ?? flowr_file_1.FlowrFile.INLINE_PATH)}"\n`;
61
+ output += ` direction ${direction}\n`;
61
62
  showAst(f.root);
62
63
  output += ' end\n';
63
64
  }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Helper for transforming records.
3
+ */
4
+ export declare const Record: {
5
+ /**
6
+ * Transforms a record by applying a callback function to each key-value pair in the record.
7
+ * @param object - The record that should be transformed.
8
+ * @param callbackfn - The callback function that transforms each key-value pair of the record.
9
+ */
10
+ map<K1 extends string, K2 extends string, V1, V2>(this: void, object: Record<K1, V1>, callbackfn: (entry: [K1, V1], index: number, entries: [K1, V1][]) => [K2, V2]): Record<K2, V2>;
11
+ /**
12
+ * Transforms a record by applying a callback function to each key in the record.
13
+ * @param object - The record that should be transformed.
14
+ * @param callbackfn - The callback function that transforms each key of the record.
15
+ */
16
+ mapKeys<K1 extends string, K2 extends string, V>(this: void, object: Record<K1, V>, callbackfn: (key: K1, index: number, entries: [K1, V][]) => K2): Record<K2, V>;
17
+ /**
18
+ * Transforms a record by applying a callback function to each property value in the record.
19
+ * @param object - The record that should be transformed.
20
+ * @param callbackfn - The callback function that transforms each property value of the record.
21
+ */
22
+ mapProperties<K extends string, V1, V2>(this: void, object: Record<K, V1>, callbackfn: (value: V1, index: number, entries: [K, V1][]) => V2): Record<K, V2>;
23
+ };
package/util/record.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Record = void 0;
4
+ /**
5
+ * Helper for transforming records.
6
+ */
7
+ exports.Record = {
8
+ /**
9
+ * Transforms a record by applying a callback function to each key-value pair in the record.
10
+ * @param object - The record that should be transformed.
11
+ * @param callbackfn - The callback function that transforms each key-value pair of the record.
12
+ */
13
+ map(object, callbackfn) {
14
+ return Object.fromEntries(Object.entries(object).map(callbackfn));
15
+ },
16
+ /**
17
+ * Transforms a record by applying a callback function to each key in the record.
18
+ * @param object - The record that should be transformed.
19
+ * @param callbackfn - The callback function that transforms each key of the record.
20
+ */
21
+ mapKeys(object, callbackfn) {
22
+ return exports.Record.map(object, ([key, value], index, entries) => [callbackfn(key, index, entries), value]);
23
+ },
24
+ /**
25
+ * Transforms a record by applying a callback function to each property value in the record.
26
+ * @param object - The record that should be transformed.
27
+ * @param callbackfn - The callback function that transforms each property value of the record.
28
+ */
29
+ mapProperties(object, callbackfn) {
30
+ return exports.Record.map(object, ([keys, value], index, entries) => [keys, callbackfn(value, index, entries)]);
31
+ }
32
+ };
33
+ //# sourceMappingURL=record.js.map
package/util/version.js CHANGED
@@ -6,7 +6,7 @@ exports.printVersionInformation = printVersionInformation;
6
6
  const semver_1 = require("semver");
7
7
  const assert_1 = require("./assert");
8
8
  // this is automatically replaced with the current version by release-it
9
- const version = '2.10.1';
9
+ const version = '2.10.2';
10
10
  /**
11
11
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
12
  */
@@ -1,41 +0,0 @@
1
- import { AbstractDomain, type AnyAbstractDomain, type ConcreteDomain } from './abstract-domain';
2
- import { Top } from './lattice';
3
- /** The type of the concrete mapping of the concrete domain of a mapped abstract domain mapping keys to a concrete value in the concrete domain */
4
- export type ConcreteMap<Key, Domain extends AnyAbstractDomain> = ReadonlyMap<Key, ConcreteDomain<Domain>>;
5
- /**
6
- * A mapped abstract domain as mapping of keys to abstract values of an abstract domain.
7
- * The Bottom element is defined as empty mapping and the Top element is defined as mapping every existing key to Top.
8
- * @template Key - Type of the keys of the mapping to abstract values
9
- * @template Domain - Type of the abstract domain to map the keys to
10
- */
11
- export declare class MappedAbstractDomain<Key, Domain extends AnyAbstractDomain> extends AbstractDomain<ConcreteMap<Key, Domain>, ReadonlyMap<Key, Domain>, ReadonlyMap<Key, Domain>, ReadonlyMap<Key, Domain>> {
12
- constructor(value: ReadonlyMap<Key, Domain>);
13
- create(value: ReadonlyMap<Key, Domain>): this;
14
- get(key: Key): Domain | undefined;
15
- has(key: Key): boolean;
16
- protected set(key: Key, value: Domain): void;
17
- protected remove(key: Key): void;
18
- bottom(): this;
19
- top(): this;
20
- equals(other: this): boolean;
21
- leq(other: this): boolean;
22
- join(other: this): this;
23
- meet(other: this): this;
24
- widen(other: this): this;
25
- narrow(other: this): this;
26
- concretize(limit: number): ReadonlySet<ConcreteMap<Key, Domain>> | typeof Top;
27
- abstract(concrete: ReadonlySet<ConcreteMap<Key, Domain>> | typeof Top): this;
28
- toJson(): unknown;
29
- toString(): string;
30
- isTop(): this is this;
31
- isBottom(): this is this;
32
- isValue(): this is this;
33
- }
34
- /**
35
- * A mutable version of the {@link MappedAbstractDomain} with {@link MutableMappedAbstractDomain#set|`set`} and {@link MutableMappedAbstractDomain#remove|`remove`}.
36
- */
37
- export declare class MutableMappedAbstractDomain<Key, Domain extends AnyAbstractDomain> extends MappedAbstractDomain<Key, Domain> {
38
- create(value: ReadonlyMap<Key, Domain>): this;
39
- set(key: Key, value: Domain): void;
40
- remove(key: Key): void;
41
- }
@@ -1,213 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MutableMappedAbstractDomain = exports.MappedAbstractDomain = void 0;
4
- const abstract_domain_1 = require("./abstract-domain");
5
- const lattice_1 = require("./lattice");
6
- /**
7
- * A mapped abstract domain as mapping of keys to abstract values of an abstract domain.
8
- * The Bottom element is defined as empty mapping and the Top element is defined as mapping every existing key to Top.
9
- * @template Key - Type of the keys of the mapping to abstract values
10
- * @template Domain - Type of the abstract domain to map the keys to
11
- */
12
- class MappedAbstractDomain extends abstract_domain_1.AbstractDomain {
13
- constructor(value) {
14
- super(new Map(value));
15
- }
16
- create(value) {
17
- return new MappedAbstractDomain(value);
18
- }
19
- get(key) {
20
- return this._value.get(key);
21
- }
22
- has(key) {
23
- return this._value.has(key);
24
- }
25
- set(key, value) {
26
- this._value.set(key, value);
27
- }
28
- remove(key) {
29
- this._value.delete(key);
30
- }
31
- bottom() {
32
- return this.create(new Map());
33
- }
34
- top() {
35
- const result = this.create(this.value);
36
- for (const [key, value] of result.value) {
37
- result.set(key, value.top());
38
- }
39
- return result;
40
- }
41
- equals(other) {
42
- if (this.value === other.value) {
43
- return true;
44
- }
45
- else if (this.value.size !== other.value.size) {
46
- return false;
47
- }
48
- for (const [key, value] of this.value) {
49
- const otherValue = other.get(key);
50
- if (otherValue === undefined || !value.equals(otherValue)) {
51
- return false;
52
- }
53
- }
54
- return true;
55
- }
56
- leq(other) {
57
- if (this.value === other.value) {
58
- return true;
59
- }
60
- else if (this.value.size > other.value.size) {
61
- return false;
62
- }
63
- for (const [key, value] of this.value) {
64
- const otherValue = other.get(key);
65
- if (otherValue === undefined || !value.leq(otherValue)) {
66
- return false;
67
- }
68
- }
69
- return true;
70
- }
71
- join(other) {
72
- const result = this.create(this.value);
73
- for (const [key, value] of other.value) {
74
- const currValue = result.get(key);
75
- if (currValue === undefined) {
76
- result.set(key, value);
77
- }
78
- else {
79
- result.set(key, currValue.join(value));
80
- }
81
- }
82
- return result;
83
- }
84
- meet(other) {
85
- const result = this.create(this.value);
86
- for (const [key] of result.value) {
87
- if (!other.has(key)) {
88
- result.remove(key);
89
- }
90
- }
91
- for (const [key, value] of other.value) {
92
- const currValue = result.get(key);
93
- if (currValue !== undefined) {
94
- result.set(key, currValue.meet(value));
95
- }
96
- }
97
- return result;
98
- }
99
- widen(other) {
100
- const result = this.create(this.value);
101
- for (const [key, value] of other.value) {
102
- const currValue = result.get(key);
103
- if (currValue === undefined) {
104
- result.set(key, value);
105
- }
106
- else {
107
- result.set(key, currValue.widen(value));
108
- }
109
- }
110
- return result;
111
- }
112
- narrow(other) {
113
- const result = this.create(this.value);
114
- for (const [key] of this.value) {
115
- if (!other.has(key)) {
116
- result.remove(key);
117
- }
118
- }
119
- for (const [key, value] of other.value) {
120
- const currValue = result.get(key);
121
- if (currValue !== undefined) {
122
- result.set(key, currValue.narrow(value));
123
- }
124
- }
125
- return result;
126
- }
127
- concretize(limit) {
128
- if (this.value.size === 0) {
129
- return new Set();
130
- }
131
- let mappings = new Set([new Map()]);
132
- for (const [key, value] of this.value) {
133
- const concreteValues = value.concretize(limit);
134
- if (concreteValues === lattice_1.Top) {
135
- return lattice_1.Top;
136
- }
137
- const newMappings = new Set();
138
- for (const state of mappings) {
139
- for (const concrete of concreteValues) {
140
- if (newMappings.size > limit) {
141
- return lattice_1.Top;
142
- }
143
- const map = new Map(state);
144
- map.set(key, concrete);
145
- newMappings.add(map);
146
- }
147
- }
148
- mappings = newMappings;
149
- }
150
- return mappings;
151
- }
152
- abstract(concrete) {
153
- if (concrete === lattice_1.Top) {
154
- return this.top();
155
- }
156
- else if (concrete.size === 0) {
157
- return this.bottom();
158
- }
159
- const domain = this.value.values().toArray()[0];
160
- if (domain === undefined) {
161
- return this.top();
162
- }
163
- const mapping = new Map();
164
- for (const concreteMapping of concrete) {
165
- for (const [key, value] of concreteMapping) {
166
- const set = mapping.get(key);
167
- if (set === undefined) {
168
- mapping.set(key, new Set([value]));
169
- }
170
- else {
171
- set.add(value);
172
- }
173
- }
174
- }
175
- const result = new Map();
176
- for (const [key, values] of mapping) {
177
- result.set(key, domain.abstract(values));
178
- }
179
- return this.create(result);
180
- }
181
- toJson() {
182
- return Object.fromEntries(this.value.entries().map(([key, value]) => [key, value.toJson()]));
183
- }
184
- toString() {
185
- return '(' + this.value.entries().toArray().map(([key, value]) => `${(0, abstract_domain_1.domainElementToString)(key)} -> ${value.toString()}`).join(', ') + ')';
186
- }
187
- isTop() {
188
- return this.value.values().some(entry => entry.isTop());
189
- }
190
- isBottom() {
191
- return this.value.size === 0;
192
- }
193
- isValue() {
194
- return true;
195
- }
196
- }
197
- exports.MappedAbstractDomain = MappedAbstractDomain;
198
- /**
199
- * A mutable version of the {@link MappedAbstractDomain} with {@link MutableMappedAbstractDomain#set|`set`} and {@link MutableMappedAbstractDomain#remove|`remove`}.
200
- */
201
- class MutableMappedAbstractDomain extends MappedAbstractDomain {
202
- create(value) {
203
- return new MutableMappedAbstractDomain(value);
204
- }
205
- set(key, value) {
206
- super.set(key, value);
207
- }
208
- remove(key) {
209
- super.remove(key);
210
- }
211
- }
212
- exports.MutableMappedAbstractDomain = MutableMappedAbstractDomain;
213
- //# sourceMappingURL=mapped-abstract-domain.js.map