Skip to content

Commit

Permalink
TEMP: Fix joins.
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasVP committed Aug 1, 2023
1 parent 03b72eb commit 854cff5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private RelativeStage::SemReason relativeReason(SemReason reason) {
import Public

module Public {
pragma[nomagic]
predicate semBounded(
SemExpr e, SemanticBound::SemBound b, float delta, boolean upper, SemReason reason
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ private Instruction getABoundIn(SemBound b, IRFunction func) {
result.getEnclosingIRFunction() = func
}

pragma[nomagic]
private predicate upperBoundedByValue(Instruction i, SemBound bound, int delta) {
semBounded(getSemanticExpr(i), bound, delta, true,
any(SemReason reason | not reason instanceof SemTypeReason))
}

/**
* Holds if `i <= b + delta`.
*/
pragma[inline]
private predicate boundedImpl(Instruction i, Instruction b, int delta) {
exists(SemBound bound, IRFunction func |
semBounded(getSemanticExpr(i), bound, delta, true,
any(SemReason reason | not reason instanceof SemTypeReason)) and
upperBoundedByValue(i, bound, delta) and
b = getABoundIn(bound, func) and
i.getEnclosingIRFunction() = func
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ Instruction getABoundIn(SemBound b, IRFunction func) {
result.getEnclosingIRFunction() = func
}

pragma[nomagic]
private predicate upperBoundedByValue(Instruction i, SemBound bound, int delta) {
semBounded(getSemanticExpr(i), bound, delta, true,
any(SemReason reason | not reason instanceof SemTypeReason))
}

/**
* Holds if `i <= b + delta`.
*/
pragma[inline]
predicate boundedImpl(Instruction i, Instruction b, int delta) {
exists(SemBound bound, IRFunction func |
semBounded(getSemanticExpr(i), bound, delta, true,
any(SemReason reason | not reason instanceof SemTypeReason)) and
upperBoundedByValue(i, bound, delta) and
b = getABoundIn(bound, func) and
pragma[only_bind_out](i.getEnclosingIRFunction()) = func
)
Expand Down

0 comments on commit 854cff5

Please sign in to comment.