apply style rules

pull/902/head
Joran Honig 6 years ago
parent 9932932816
commit f5e84fcb21
  1. 10
      mythril/laser/smt/independence_solver.py
  2. 1
      mythril/laser/smt/model.py
  3. 1
      mythril/laser/smt/solver.py

@ -3,6 +3,7 @@ import z3
from mythril.laser.smt import Model from mythril.laser.smt import Model
from typing import List from typing import List
def _get_expr_variables(expression: z3.ExprRef): def _get_expr_variables(expression: z3.ExprRef):
""" """
Get's the variables that make up the current expression Get's the variables that make up the current expression
@ -20,6 +21,7 @@ def _get_expr_variables(expression: z3.ExprRef):
class DependenceBucket: class DependenceBucket:
""" Bucket object to contain a set of conditions that are dependent on each other """ """ Bucket object to contain a set of conditions that are dependent on each other """
def __init__(self, variables=None, condition=None): def __init__(self, variables=None, condition=None):
""" """
Initializes a DependenceBucket object Initializes a DependenceBucket object
@ -32,6 +34,7 @@ class DependenceBucket:
class DependenceMap: class DependenceMap:
""" DependenceMap object that maintains a set of dependence buckets, used to separate independent smt queries """ """ DependenceMap object that maintains a set of dependence buckets, used to separate independent smt queries """
def __init__(self): def __init__(self):
""" Initializes a DependenceMap object """ """ Initializes a DependenceMap object """
self.buckets = [] self.buckets = []
@ -154,11 +157,12 @@ class IndependenceSolver:
from mythril.laser.smt import symbol_factory from mythril.laser.smt import symbol_factory
a = symbol_factory.BitVecSym('a', 256)
c = symbol_factory.BitVecSym('c', 256) a = symbol_factory.BitVecSym("a", 256)
c = symbol_factory.BitVecSym("c", 256)
b = c == (a + symbol_factory.BitVecVal(1, 256)) b = c == (a + symbol_factory.BitVecVal(1, 256))
e = symbol_factory.BitVecSym('d', 256) == symbol_factory.BitVecVal(3, 256) e = symbol_factory.BitVecSym("d", 256) == symbol_factory.BitVecVal(3, 256)
solver = IndependenceSolver() solver = IndependenceSolver()
solver.add([b, e]) solver.add([b, e])

@ -7,6 +7,7 @@ class Model:
This implementation allows for multiple internal models, this is required for the use of an independence solver This implementation allows for multiple internal models, this is required for the use of an independence solver
which has models for multiple queries which need an uniform output. which has models for multiple queries which need an uniform output.
""" """
def __init__(self, models=None): def __init__(self, models=None):
""" """
Initialize a model object Initialize a model object

@ -4,6 +4,7 @@ import z3
from mythril.laser.smt.expression import Expression from mythril.laser.smt.expression import Expression
from mythril.laser.smt.model import Model from mythril.laser.smt.model import Model
class Solver: class Solver:
"""An SMT solver object.""" """An SMT solver object."""

Loading…
Cancel
Save