@@ -14,12 +14,10 @@ class ObjectInternal extends TObject {
1414
1515 abstract string toString ( ) ;
1616
17- /** The boolean value of this object, if it has one */
17+ /** The boolean value of this object, this may be both
18+ * true and false if the "object" represents a set of possible objects. */
1819 abstract boolean booleanValue ( ) ;
1920
20- /** Holds if this object may be true or false when evaluated as a bool */
21- abstract predicate maybe ( ) ;
22-
2321 abstract predicate introduced ( ControlFlowNode node , PointsToContext2 context ) ;
2422
2523 /** Gets the class declaration for this object, if it is a declared class. */
@@ -54,10 +52,6 @@ class ObjectInternal extends TObject {
5452 */
5553 abstract predicate callResult ( PointsToContext2 callee , ObjectInternal obj , CfgOrigin origin ) ;
5654
57- predicate hasLocationInfo ( string fp , int bl , int bc , int el , int ec ) {
58- this .getOrigin ( ) .getLocation ( ) .hasLocationInfo ( fp , bl , bc , el , ec )
59- }
60-
6155 /** The integer value of things that have integer values.
6256 * That is, ints and bools.
6357 */
@@ -92,13 +86,8 @@ class BuiltinOpaqueObjectInternal extends ObjectInternal, TBuiltinOpaqueObject {
9286 }
9387
9488 override boolean booleanValue ( ) {
95- // TO DO ... Depends on class. `this.getClass().instancesAlways(result)`
96- none ( )
97- }
98-
99- override predicate maybe ( ) {
100- // TO DO ... Depends on class. `this.getClass().instancesMaybe()`
101- any ( )
89+ // TO DO ... Depends on class. `result = this.getClass().instancesBooleanValue()`
90+ result = maybe ( )
10291 }
10392
10493 override ClassDecl getClassDeclaration ( ) {
@@ -155,11 +144,9 @@ class UnknownInternal extends ObjectInternal, TUnknown {
155144 }
156145
157146 override boolean booleanValue ( ) {
158- none ( )
147+ result = maybe ( )
159148 }
160149
161- override predicate maybe ( ) { any ( ) }
162-
163150 override ClassDecl getClassDeclaration ( ) {
164151 none ( )
165152 }
@@ -219,8 +206,6 @@ class UndefinedInternal extends ObjectInternal, TUndefined {
219206 none ( )
220207 }
221208
222- override predicate maybe ( ) { none ( ) }
223-
224209 override ClassDecl getClassDeclaration ( ) {
225210 none ( )
226211 }
@@ -328,3 +313,7 @@ module ObjectInternal {
328313 }
329314}
330315
316+ /** Helper for boolean predicates returning both `true` and `false` */
317+ boolean maybe ( ) {
318+ result = true or result = false
319+ }
0 commit comments