Merge pull request #10181 from erik-krogh/fixCons

QL: remove consistency errors related to resolving multiple predicates from parameterized modules
This commit is contained in:
Erik Krogh Kristensen
2022-08-29 09:40:07 +02:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -521,6 +521,9 @@ class ClasslessPredicate extends TClasslessPredicate, Predicate, ModuleDeclarati
}
override predicate isPrivate() { Predicate.super.isPrivate() }
/** Holds if this classless predicate is a signature predicate with no body. */
predicate isSignature() { not exists(this.getBody()) }
}
/**

View File

@@ -209,7 +209,9 @@ module PredConsistency {
not exists(p0.getAlias())
) and
c > 1 and
resolvePredicateExpr(pe, p)
resolvePredicateExpr(pe, p) and
// parameterized modules are expected to resolve to multiple.
not exists(ClasslessPredicate sig | not sig.isSignature() and resolvePredicateExpr(pe, sig))
}
query predicate multipleResolveCall(Call call, int c, PredicateOrBuiltin p) {
@@ -225,6 +227,6 @@ module PredConsistency {
c > 1 and
resolveCall(call, p) and
// parameterized modules are expected to resolve to multiple.
not exists(Predicate sig | not exists(sig.getBody()) and resolveCall(call, sig))
not exists(ClasslessPredicate sig | not sig.isSignature() and resolveCall(call, sig))
}
}