Skip to content

Commit 1d3bad1

Browse files
committed
UniversalFlow: More renaming.
1 parent 7d98d39 commit 1d3bad1

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

shared/typeflow/codeql/typeflow/UniversalFlow.qll

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ signature module UniversalFlowInput<LocationSig Location> {
6060
default predicate isExcludedFromNullAnalysis(FlowNode n) { none() }
6161
}
6262

63-
module UfMake<LocationSig Location, UniversalFlowInput<Location> I> {
63+
module Make<LocationSig Location, UniversalFlowInput<Location> I> {
6464
private import I
6565

6666
/**
@@ -170,48 +170,48 @@ module UfMake<LocationSig Location, UniversalFlowInput<Location> I> {
170170
int lastRank(Node n) { result = max(int r | edgeRank(r, _, n)) }
171171
}
172172

173-
private signature module TypePropagation {
174-
class Typ;
173+
private signature module PropPropagation {
174+
class Prop;
175175

176-
predicate candType(FlowNode n, Typ t);
176+
predicate candProp(FlowNode n, Prop t);
177177

178178
bindingset[t]
179-
predicate supportsType(FlowNode n, Typ t);
179+
predicate supportsProp(FlowNode n, Prop t);
180180
}
181181

182182
/** Implements recursion through `forall` by way of edge ranking. */
183-
private module ForAll<NodeSig Node, RankedEdge<Node> E, TypePropagation T> {
183+
private module ForAll<NodeSig Node, RankedEdge<Node> E, PropPropagation T> {
184184
/**
185-
* Holds if `t` is a bound that holds on one of the incoming edges to `n` and
186-
* thus is a candidate bound for `n`.
185+
* Holds if `t` is a property that holds on one of the incoming edges to `n` and
186+
* thus is a candidate property for `n`.
187187
*/
188188
pragma[nomagic]
189-
private predicate candJoinType(Node n, T::Typ t) {
189+
private predicate candJoinProp(Node n, T::Prop t) {
190190
exists(FlowNode mid |
191-
T::candType(mid, t) and
191+
T::candProp(mid, t) and
192192
E::edgeRank(_, mid, n)
193193
)
194194
}
195195

196196
/**
197-
* Holds if `t` is a candidate bound for `n` that is also valid for data coming
197+
* Holds if `t` is a candidate property for `n` that is also valid for data coming
198198
* through the edges into `n` ranked from `1` to `r`.
199199
*/
200-
private predicate flowJoin(int r, Node n, T::Typ t) {
200+
private predicate flowJoin(int r, Node n, T::Prop t) {
201201
(
202-
r = 1 and candJoinType(n, t)
202+
r = 1 and candJoinProp(n, t)
203203
or
204204
flowJoin(r - 1, n, t) and E::edgeRank(r, _, n)
205205
) and
206-
forall(FlowNode mid | E::edgeRank(r, mid, n) | T::supportsType(mid, t))
206+
forall(FlowNode mid | E::edgeRank(r, mid, n) | T::supportsProp(mid, t))
207207
}
208208

209209
/**
210-
* Holds if `t` is a candidate bound for `n` that is also valid for data
211-
* coming through all the incoming edges, and therefore is a valid bound for
210+
* Holds if `t` is a candidate property for `n` that is also valid for data
211+
* coming through all the incoming edges, and therefore is a valid property for
212212
* `n`.
213213
*/
214-
predicate flowJoin(Node n, T::Typ t) { flowJoin(E::lastRank(n), n, t) }
214+
predicate flowJoin(Node n, T::Prop t) { flowJoin(E::lastRank(n), n, t) }
215215
}
216216

217217
private module JoinStep implements Edge {
@@ -237,12 +237,12 @@ module UfMake<LocationSig Location, UniversalFlowInput<Location> I> {
237237
}
238238

239239
module FlowNullary<NullaryPropertySig P> {
240-
private module Propagation implements TypePropagation {
241-
class Typ = Unit;
240+
private module Propagation implements PropPropagation {
241+
class Prop = Unit;
242242

243-
predicate candType(FlowNode n, Unit u) { hasProperty(n) and exists(u) }
243+
predicate candProp(FlowNode n, Unit u) { hasProperty(n) and exists(u) }
244244

245-
predicate supportsType = candType/2;
245+
predicate supportsProp = candProp/2;
246246
}
247247

248248
predicate hasProperty(FlowNode n) {
@@ -278,14 +278,14 @@ module UfMake<LocationSig Location, UniversalFlowInput<Location> I> {
278278
}
279279

280280
module Flow<PropertySig P> {
281-
private module Propagation implements TypePropagation {
282-
class Typ = P::Prop;
281+
private module Propagation implements PropPropagation {
282+
class Prop = P::Prop;
283283

284-
predicate candType = hasProperty/2;
284+
predicate candProp = hasProperty/2;
285285

286286
bindingset[t]
287-
predicate supportsType(FlowNode n, Typ t) {
288-
exists(Typ t0 | hasProperty(n, t0) and P::propImplies(t0, t))
287+
predicate supportsProp(FlowNode n, Prop t) {
288+
exists(Prop t0 | hasProperty(n, t0) and P::propImplies(t0, t))
289289
}
290290
}
291291

shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
private import codeql.typeflow.TypeFlow
2-
private import codeql.typeflow.UniversalFlow
2+
private import codeql.typeflow.UniversalFlow as UniversalFlow
33
private import codeql.util.Location
44
private import codeql.util.Unit
55

66
module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
77
private import I
88

9-
private module UfInput implements UniversalFlowInput<Location> {
9+
private module UfInput implements UniversalFlow::UniversalFlowInput<Location> {
1010
class FlowNode = TypeFlowNode;
1111

1212
predicate step = I::step/2;
@@ -16,7 +16,7 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
1616
predicate isExcludedFromNullAnalysis = I::isExcludedFromNullAnalysis/1;
1717
}
1818

19-
private module UnivFlow = UfMake<Location, UfInput>;
19+
private module UnivFlow = UniversalFlow::Make<Location, UfInput>;
2020

2121
private module ExactTypeProperty implements UnivFlow::PropertySig {
2222
class Prop = Type;

0 commit comments

Comments
 (0)