@@ -117,13 +117,14 @@ module SharedCharacteristics<CandidateSig Candidate> {
117
117
}
118
118
119
119
/**
120
- * Holds if the candidate sink `candidateSink` should be considered as a possible sink of type `sinkType`, and
121
- * classified by the ML model. A candidate sink is a node that cannot be excluded from `sinkType` based on its
122
- * characteristics.
120
+ * Holds if the given `endpoint` should be considered as a candidate for type `endpointType`,
121
+ * and classified by the ML model.
122
+ *
123
+ * A candidate is an endpoint that cannot be excluded from `endpointType` based on its characteristics.
123
124
*/
124
- predicate isSinkCandidate ( Candidate:: Endpoint candidateSink , Candidate:: EndpointType sinkType ) {
125
+ predicate isCandidate ( Candidate:: Endpoint candidateSink , Candidate:: EndpointType sinkType ) {
125
126
not sinkType instanceof Candidate:: NegativeEndpointType and
126
- not exists ( getAReasonSinkExcluded ( candidateSink , sinkType ) )
127
+ not exists ( getAnExcludingCharacteristic ( candidateSink , sinkType ) )
127
128
}
128
129
129
130
/**
@@ -139,15 +140,14 @@ module SharedCharacteristics<CandidateSig Candidate> {
139
140
}
140
141
141
142
/**
142
- * Gets the list of characteristics that cause `candidateSink` to be excluded as an effective sink for a given sink
143
- * type.
143
+ * Gets a characteristics that disbar `endpoint` from being a candidate for `endpointType`.
144
144
*/
145
- EndpointCharacteristic getAReasonSinkExcluded (
146
- Candidate:: Endpoint candidateSink , Candidate:: EndpointType sinkType
145
+ EndpointCharacteristic getAnExcludingCharacteristic (
146
+ Candidate:: Endpoint endpoint , Candidate:: EndpointType endpointType
147
147
) {
148
148
// An endpoint is a sink candidate if none of its characteristics give much indication whether or not it is a sink.
149
- not sinkType instanceof Candidate:: NegativeEndpointType and
150
- result .appliesToEndpoint ( candidateSink ) and
149
+ not endpointType instanceof Candidate:: NegativeEndpointType and
150
+ result .appliesToEndpoint ( endpoint ) and
151
151
(
152
152
// Exclude endpoints that have a characteristic that implies they're not sinks for _any_ sink type.
153
153
exists ( float confidence |
@@ -158,7 +158,7 @@ module SharedCharacteristics<CandidateSig Candidate> {
158
158
// Exclude endpoints that have a characteristic that implies they're not sinks for _this particular_ sink type.
159
159
exists ( float confidence |
160
160
confidence >= mediumConfidence ( ) and
161
- result .hasImplications ( sinkType , false , confidence )
161
+ result .hasImplications ( endpointType , false , confidence )
162
162
)
163
163
)
164
164
}
0 commit comments