[docs]defvalue_tuple(self)->Tuple["BV",int]:""" :return: A tuple containing the node's value as a BV and as an evaluated integer """returnself.ast,self.value
@propertydefast(self)->"BV":returnself._value_ast@ast.setterdefast(self,new_ast:"BV"):self._value_ast=new_ast@propertydeftype(self)->int:""" Getter :return: An integer defined in DepNodeTypes, represents the subclass type of this DepNode. """returnself._typedef__repr__(self):raiseNotImplementedError()def__eq__(self,other):returnself.type==other.typeandself.ins_addr==other.ins_addrandself.action_id==other.action_iddef__hash__(self):returnhash(self.type)^hash(self.ins_addr)^hash(self.stmt_idx)^hash(self.action_id)
[docs]classConstantDepNode(BaseDepNode):""" Used to create a DepNode that will hold a constant, numeric value Uniquely identified by its value """
[docs]@classmethoddefcast_to_mem(cls,base_dep_node:BaseDepNode):"""Casts a BaseDepNode into a MemDepNode"""assertisinstance(base_dep_node,BaseDepNode)base_dep_node.__class__=clsassertisinstance(base_dep_node,MemDepNode)returnbase_dep_node
[docs]classVarDepNode(BaseDepNode):""" Abstract class for representing SimActions of TYPE reg or tmp """