Package vivisect :: Package symboliks :: Module common :: Class Operator
[hide private]
[frames] | no frames]

Class Operator

source code


A class representing an algebraic operator being carried out on two symboliks.

Instance Methods [hide private]
 
__init__(self, v1, v2, width) source code
 
getWidth(self) source code
 
isConstOrAddSub(self, op)
checks if the operator is a Const, o_add, or o_sub.
source code
 
getConstKid(self, op) source code
 
getConstKids(self, op1, op2)
subtraction is NOT commutative, the order of the ops you pass matters.
source code
 
getNonConstKid(self, op)
gets the first non-const kid.
source code
 
getNonConstKids(self, op1, op2) source code
 
_reduce(self, emu=None)
Algebraic reduction and operator folding where possible.
source code
 
_op_reduce(self, v1, v1val, v2, v2val, emu) source code
 
update(self, emu)
Return an updated representation for this symbolik state based on the given emulator.
source code
 
_solve(self, emu=None)
Produce a reproducable answer based on the current state if provided.
source code
 
isDiscrete(self, emu=None)
Returns True if the given symbolik (from here down) does *not* depend on any variables or runtime values.
source code
 
__repr__(self) source code
 
__str__(self) source code

Inherited from SymbolikBase: __add__, __and__, __div__, __eq__, __hash__, __iadd__, __iand__, __idiv__, __ilshift__, __imod__, __imul__, __ior__, __irshift__, __isub__, __ixor__, __lshift__, __mod__, __mul__, __ne__, __or__, __pow__, __rshift__, __sub__, __xor__, clearCache, reduce, solve, walkTree

Inherited from SymbolikBase (private): _clearCache

Class Variables [hide private]
  revclass = None
hash(x)
  oper = None
hash(x)
  operstr = None
hash(x)

Inherited from SymbolikBase: idgen

Method Details [hide private]

__init__(self, v1, v2, width)
(Constructor)

source code 
Overrides: SymbolikBase.__init__

isConstOrAddSub(self, op)

source code 

checks if the operator is a Const, o_add, or o_sub. if the op is o_add or o_sub, checks that one of the kids is a const.

_reduce(self, emu=None)

source code 

Algebraic reduction and operator folding where possible. (INLINE!)

Overrides: SymbolikBase._reduce
(inherited documentation)

update(self, emu)

source code 

Return an updated representation for this symbolik state based on the given emulator. This is *NOT* inline.

Overrides: SymbolikBase.update
(inherited documentation)

_solve(self, emu=None)

source code 

Produce a reproducable answer based on the current state if provided.

Overrides: SymbolikBase._solve
(inherited documentation)

isDiscrete(self, emu=None)

source code 

Returns True if the given symbolik (from here down) does *not* depend on any variables or runtime values.

Overrides: SymbolikBase.isDiscrete
(inherited documentation)