11/**
2- * A module for considering whether a result occurs in all instances (e.g. copies) of the code at a
3- * given location.
2+ * A module for considering whether a result occurs in all copies of the code at a given location.
43 *
5- * Multiple instances of an element at the same location can occur for two main reasons:
4+ * Multiple copies of an element at the same location can occur for two main reasons:
65 * 1. Instantiations of a template
76 * 2. Re-compilation of a file under a different context
87 * This module helps ensure that a particular condition holds for all copies of a particular logical
@@ -37,17 +36,21 @@ predicate isNotWithinMacroExpansion(Element e) {
3736 )
3837}
3938
40- /** A candidate set of elements. */
39+ /**
40+ * A type representing a set of Element's in the program that satisfy some condition.
41+ *
42+ * `HoldsForAllCopies<T>::LogicalResultElement` will represent an element in this set
43+ * iff all copies of that element satisfy the condition.
44+ */
4145signature class CandidateElementSig extends Element ;
4246
4347/** The super set of relevant elements. */
4448signature class ElementSetSig extends Element ;
4549
4650/**
47- * A module for considering whether a result occurs in all instances (e.g. copies) of the code at a
48- * given location.
51+ * A module for considering whether a result occurs in all copies of the code at a given location.
4952 */
50- module HoldsForAllInstances < CandidateElementSig CandidateElement, ElementSetSig ElementSet> {
53+ module HoldsForAllCopies < CandidateElementSig CandidateElement, ElementSetSig ElementSet> {
5154 private predicate hasLocation (
5255 ElementSet s , string filepath , int startline , int startcolumn , int endline , int endcolumn
5356 ) {
@@ -93,8 +96,8 @@ module HoldsForAllInstances<CandidateElementSig CandidateElement, ElementSetSig
9396 }
9497
9598 /**
96- * A logical result element, representing all instances of a element that occur at the same
97- * location.
99+ * A logical result element representing all copies of an element that occur at the same
100+ * location, iff they all belong to the `CandidateElement` set .
98101 */
99102 class LogicalResultElement extends TLogicalResultElement {
100103 predicate hasLocationInfo (
@@ -103,7 +106,7 @@ module HoldsForAllInstances<CandidateElementSig CandidateElement, ElementSetSig
103106 this = TLogicalResultElement ( filepath , startline , startcolumn , endline , endcolumn )
104107 }
105108
106- /** Gets an instance of this logical result element. */
109+ /** Gets a copy instance of this logical result element. */
107110 CandidateElement getAnElementInstance ( ) {
108111 exists ( string filepath , int startline , int startcolumn , int endline , int endcolumn |
109112 this = TLogicalResultElement ( filepath , startline , startcolumn , endline , endcolumn ) and
0 commit comments