@@ -75,18 +75,43 @@ signature module InputSig<LocationSig Location, TypSig ControlFlowNode, TypSig B
7575 SsaDefinition getPriorDefinition ( ) ;
7676 }
7777
78+ /** An abstract value that a `Guard` may evaluate to. */
7879 class GuardValue {
80+ /** Gets a textual representation of this value. */
7981 string toString ( ) ;
8082
83+ /**
84+ * Gets the dual value. Examples of dual values include:
85+ * - null vs. not null
86+ * - true vs. false
87+ * - evaluating to a specific value vs. evaluating to any other value
88+ * - throwing an exception vs. not throwing an exception
89+ */
8190 GuardValue getDualValue ( ) ;
8291
92+ /** Gets the integer that this value represents, if any. */
8393 int asIntValue ( ) ;
8494
95+ /**
96+ * Holds if this value represents an integer range.
97+ *
98+ * If `upper = true` the range is `(-infinity, bound]`.
99+ * If `upper = false` the range is `[bound, infinity)`.
100+ */
85101 predicate isIntRange ( int bound , boolean upper ) ;
86102 }
87103
104+ /**
105+ * Holds if `def` evaluating to `v` controls the control-flow branch
106+ * edge from `bb1` to `bb2`. That is, following the edge from `bb1` to
107+ * `bb2` implies that `def` evaluated to `v`.
108+ */
88109 predicate ssaControlsBranchEdge ( SsaDefinition def , BasicBlock bb1 , BasicBlock bb2 , GuardValue v ) ;
89110
111+ /**
112+ * Holds if `def` evaluating to `v` controls the basic block `bb`.
113+ * That is, execution of `bb` implies that `def` evaluated to `v`.
114+ */
90115 predicate ssaControls ( SsaDefinition def , BasicBlock bb , GuardValue v ) ;
91116
92117 predicate exprHasValue ( Expr e , GuardValue gv ) ;
0 commit comments