@@ -160,17 +160,49 @@ signature module Semantic {
160160 /** Gets a tiebreaker id in case `getBlockId1` is not unique. */
161161 default string getBlockId2 ( BasicBlock bb ) { result = "" }
162162
163+ /**
164+ * Represents a guard in the range analysis.
165+ */
163166 class Guard {
167+ /**
168+ * Returns a string representation of the guard.
169+ */
164170 string toString ( ) ;
165171
172+ /**
173+ * Returns the basic block associated with the guard.
174+ */
166175 BasicBlock getBasicBlock ( ) ;
167176
177+ /**
178+ * Returns the guard as an expression.
179+ */
168180 Expr asExpr ( ) ;
169181
182+ /**
183+ * Checks if the guard directly controls a given basic block.
184+ * @param controlled The basic block to check.
185+ * @param branch Indicates if the control is a branch or not.
186+ * @returns True if the guard directly controls the basic block, false otherwise.
187+ */
170188 predicate directlyControls ( BasicBlock controlled , boolean branch ) ;
171189
190+ /**
191+ * Checks if the guard represents an equality between two expressions.
192+ * @param e1 The first expression.
193+ * @param e2 The second expression.
194+ * @param polarity The polarity of the equality.
195+ * @returns True if the guard represents the equality, false otherwise.
196+ */
172197 predicate isEquality ( Expr e1 , Expr e2 , boolean polarity ) ;
173198
199+ /**
200+ * Checks if there is a branch edge between two basic blocks.
201+ * @param bb1 The first basic block.
202+ * @param bb2 The second basic block.
203+ * @param branch Indicates if the edge is a branch or not.
204+ * @returns True if there is a branch edge between the basic blocks, false otherwise.
205+ */
174206 predicate hasBranchEdge ( BasicBlock bb1 , BasicBlock bb2 , boolean branch ) ;
175207 }
176208
@@ -194,18 +226,43 @@ signature module Semantic {
194226 /** Gets the type of an expression. */
195227 Type getExprType ( Expr e ) ;
196228
229+ /**
230+ * Represents a single static single assignment (SSA) variable.
231+ */
197232 class SsaVariable {
233+ /**
234+ * Returns the expression where this SSA variable is used.
235+ */
198236 Expr getAUse ( ) ;
199237
238+ /**
239+ * Returns the basic block where this SSA variable is defined.
240+ */
200241 BasicBlock getBasicBlock ( ) ;
201242 }
202243
244+ /**
245+ * Represents a phi node in the SSA form.
246+ */
203247 class SsaPhiNode extends SsaVariable {
204- /** Holds if `inp` is an input to the phi node along the edge originating in `bb`. */
248+ /**
249+ * Holds if `inp` is an input to the phi node along the edge originating in `bb`.
250+ * @param inp The input variable.
251+ * @param bb The basic block.
252+ * @return True if `inp` is an input to the phi node along the edge originating in `bb`, false otherwise.
253+ */
205254 predicate hasInputFromBlock ( SsaVariable inp , BasicBlock bb ) ;
206255 }
207256
257+ /**
258+ * Represents a single update to a variable in the SSA form.
259+ */
208260 class SsaExplicitUpdate extends SsaVariable {
261+ /**
262+ * Retrieves the expression that defines the value of the variable in this update.
263+ *
264+ * @return The defining expression.
265+ */
209266 Expr getDefiningExpr ( ) ;
210267 }
211268
@@ -296,11 +353,24 @@ signature module LangSig<Semantic Sem, DeltaSig D> {
296353}
297354
298355signature module BoundSig< LocationSig Location, Semantic Sem, DeltaSig D> {
356+ /**
357+ * Represents a semantic bound.
358+ */
299359 class SemBound {
360+ /**
361+ * Returns a string representation of the semantic bound.
362+ */
300363 string toString ( ) ;
301364
365+ /**
366+ * Returns the location of the semantic bound.
367+ */
302368 Location getLocation ( ) ;
303369
370+ /**
371+ * Returns the expression associated with the semantic bound, given a delta.
372+ * @param delta - The delta value.
373+ */
304374 Sem:: Expr getExpr ( D:: Delta delta ) ;
305375 }
306376
0 commit comments