Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hvitved committed Oct 9, 2024
1 parent 5afd2d5 commit aa7215b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions shared/util/codeql/util/DenseRank.qll
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/** Provides modules for computing dense `rank`s. */
/**
* Provides modules for computing dense `rank`s. See the `DenseRank` module
* below for a more detailed explanation.
*/

/** Provides the input to `DenseRank`. */
signature module DenseRankInputSig {
Expand Down Expand Up @@ -77,15 +80,15 @@ signature module DenseRankInputSig2 {
module DenseRank2<DenseRankInputSig2 Input> {
private import Input

private int rank0(C c, Ranked r, int rnk) {
private int rankRank(C c, Ranked r, int rnk) {
rnk = getRank(c, r) and
rnk = rank[result](int rnk0 | rnk0 = getRank(c, _) | rnk0)
}

/** Gets the dense rank of `r` in the context provided by `c`. */
int denseRank(C c, Ranked r) {
exists(int rnk |
result = rank0(c, r, rnk) and
result = rankRank(c, r, rnk) and
rnk = getRank(c, r)
)
}
Expand Down Expand Up @@ -113,15 +116,15 @@ signature module DenseRankInputSig3 {
module DenseRank3<DenseRankInputSig3 Input> {
private import Input

private int rank0(C1 c1, C2 c2, Ranked r, int rnk) {
private int rankRank(C1 c1, C2 c2, Ranked r, int rnk) {
rnk = getRank(c1, c2, r) and
rnk = rank[result](int rnk0 | rnk0 = getRank(c1, c2, _) | rnk0)
}

/** Gets the dense rank of `r` in the context provided by `c1` and `c2`. */
int denseRank(C1 c1, C2 c2, Ranked r) {
exists(int rnk |
result = rank0(c1, c2, r, rnk) and
result = rankRank(c1, c2, r, rnk) and
rnk = getRank(c1, c2, r)
)
}
Expand Down

0 comments on commit aa7215b

Please sign in to comment.