@@ -294,6 +294,14 @@ def has_variables_with_property(
294294 self , p : Callable [[XVariable ], bool ]) -> bool :
295295 return False
296296
297+ def all_variables_with_property (
298+ self , p : Callable [[XVariable ], bool ]) -> bool :
299+ return False
300+
301+ @property
302+ def is_loop_counter_expression (self ) -> bool :
303+ return self .all_variables_with_property (lambda v : v .is_loop_counter )
304+
297305 def negated_value (self ) -> int :
298306 raise UF .CHBError ("Get_negated_value not supported for " + str (self ))
299307
@@ -349,6 +357,10 @@ def __init__(
349357 def variable (self ) -> XVariable :
350358 return self .xd .variable (self .args [0 ])
351359
360+ @property
361+ def is_loop_counter (self ) -> bool :
362+ return self .variable .is_loop_counter
363+
352364 @property
353365 def is_constant_value_variable (self ) -> bool :
354366 return self .variable .is_constant_value_variable
@@ -447,6 +459,10 @@ def has_variables_with_property(
447459 self , p : Callable [[XVariable ], bool ]) -> bool :
448460 return p (self .variable )
449461
462+ def all_variables_with_property (
463+ self , p : Callable [[XVariable ], bool ]) -> bool :
464+ return p (self .variable )
465+
450466 def argument_index (self ) -> int :
451467 if self .is_argument_value :
452468 return self .variable .denotation .argument_index ()
@@ -577,6 +593,10 @@ def intvalue(self) -> int:
577593 raise UF .CHBError (
578594 "Constant is not an integer constant: " + str (self ))
579595
596+ def all_variables_with_property (
597+ self , p : Callable [[XVariable ], bool ]) -> bool :
598+ return True
599+
580600 @property
581601 def is_constant (self ) -> bool :
582602 return True
@@ -759,6 +779,10 @@ def has_variables_with_property(
759779 self , p : Callable [[XVariable ], bool ]) -> bool :
760780 return any ([op .has_variables_with_property (p ) for op in self .operands ])
761781
782+ def all_variables_with_property (
783+ self , p : Callable [[XVariable ], bool ]) -> bool :
784+ return all ([op .all_variables_with_property (p ) for op in self .operands ])
785+
762786 @property
763787 def is_stack_address (self ) -> bool :
764788 args = self .operands
0 commit comments