test/formal: Get rid of wildcard imports

This commit is contained in:
Kamil Śliwak 2021-01-21 16:20:22 +01:00
parent fc0fe4f022
commit 4ed86edbc4
36 changed files with 78 additions and 45 deletions

View File

@ -1,5 +1,6 @@
from opcodes import BYTE
from rule import Rule
from opcodes import *
from z3 import BitVec
"""
byte(A, X) -> 0

View File

@ -1,5 +1,6 @@
from opcodes import BYTE
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, Concat, Extract
"""
Checks that the byte opcode (implemented using shift) is equivalent to a

View File

@ -1,6 +1,7 @@
from opcodes import AND, ISZERO, SGT, SLT, SUB
from rule import Rule
from opcodes import *
from util import *
from util import BVSignedMax, BVSignedMin, BVSignedUpCast
from z3 import BitVec, BVAddNoOverflow, BVAddNoUnderflow, Not
"""
Overflow checked signed integer addition.

View File

@ -1,6 +1,7 @@
from opcodes import AND, EQ, SUB
from rule import Rule
from opcodes import *
from util import *
from util import BVSignedMin, BVSignedUpCast
from z3 import BitVec, BVSDivNoOverflow, Not
"""
Overflow checked signed integer division.

View File

@ -1,6 +1,7 @@
from opcodes import AND, DIV, GT, SDIV, SGT, SLT
from rule import Rule
from opcodes import *
from util import *
from util import BVSignedMax, BVSignedMin, BVSignedUpCast
from z3 import BVMulNoOverflow, BVMulNoUnderflow, BitVec, Not, Or
"""
Overflow checked signed integer multiplication.

View File

@ -1,6 +1,7 @@
from opcodes import AND, ADD, ISZERO, SLT, SGT
from rule import Rule
from opcodes import *
from util import *
from util import BVSignedMax, BVSignedMin, BVSignedUpCast
from z3 import BitVec, BVSubNoOverflow, BVSubNoUnderflow, Not
"""
Overflow checked signed integer subtraction.

View File

@ -1,6 +1,7 @@
from opcodes import GT, SUB
from rule import Rule
from opcodes import *
from util import *
from util import BVUnsignedMax, BVUnsignedUpCast
from z3 import BitVec, BVAddNoOverflow, Not
"""
Overflow checked unsigned integer addition.

View File

@ -1,6 +1,7 @@
from opcodes import AND, ISZERO, GT, DIV
from rule import Rule
from opcodes import *
from util import *
from util import BVUnsignedUpCast, BVUnsignedMax
from z3 import BitVec, Not, BVMulNoOverflow
"""
Overflow checked unsigned integer multiplication.

View File

@ -1,6 +1,7 @@
from opcodes import LT
from rule import Rule
from opcodes import *
from util import *
from util import BVUnsignedMax, BVUnsignedUpCast
from z3 import BVSubNoUnderflow, BitVec, Not
"""
Overflow checked unsigned integer subtraction.

View File

@ -1,5 +1,6 @@
from opcodes import BYTE, SHL
from rule import Rule
from opcodes import *
from z3 import BitVec, ULE
"""
byte(A, shl(B, X))

View File

@ -1,5 +1,6 @@
from opcodes import BYTE, DIV, SHR
from rule import Rule
from opcodes import *
from z3 import BitVec, UGE, ULE, ULT
"""
byte(A, shr(B, X))

View File

@ -1,5 +1,6 @@
from opcodes import BYTE, SHR, DIV
from rule import Rule
from opcodes import *
from z3 import BitVec, ULT
"""
byte(A, shr(B, X))

View File

@ -1,5 +1,6 @@
from opcodes import DIV, SHL, SHR
from rule import Rule
from opcodes import *
from z3 import BitVec
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import SHL, MUL
from rule import Rule
from opcodes import *
from z3 import BitVec
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import AND, SHL, SHR
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, If, Int2BV, IntVal, UGT, ULT
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import AND, SHL, SHR
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, If, Int2BV, IntVal, UGT, ULT
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import EQ, ISZERO, SUB
from rule import Rule
from opcodes import *
from z3 import BitVec
"""
Rule:

View File

@ -1,6 +1,7 @@
from opcodes import AND, ISZERO, MOD, SUB
from rule import Rule
from opcodes import *
from util import *
from util import BVUnsignedMax
from z3 import BitVec, BitVecVal, If
"""
Checking conversion of exp(-1, X) to sub(isZero(and(X, 1)), and(X, 1))

View File

@ -1,6 +1,6 @@
from opcodes import SHL
from rule import Rule
from opcodes import *
from util import *
from z3 import BitVec, If
"""
Checking conversion of exp(2, X) to shl(X, 1)

View File

@ -1,5 +1,6 @@
from opcodes import AND, SHL
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, ULT
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import AND, SHR
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, ULT
"""
Rule:

View File

@ -1,5 +1,7 @@
from opcodes import AND, OR
from rule import Rule
from opcodes import *
from z3 import BitVec
"""
Rule:

View File

@ -1,4 +1,4 @@
from z3 import *
from z3 import BitVecVal, BV2Int, If, LShR, UDiv, ULT, UGT, URem
def ADD(x, y):
return x + y

View File

@ -1,5 +1,6 @@
from opcodes import AND
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import OR
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import DIV, MUL, SHL, SHR
from rule import Rule
from opcodes import *
from z3 import BitVec
"""
Rule:

View File

@ -1,6 +1,6 @@
import sys
from z3 import *
from z3 import sat, Solver, unknown, unsat
class Rule:
def __init__(self):

View File

@ -1,5 +1,6 @@
from opcodes import SHL
from rule import Rule
from opcodes import *
from z3 import BitVec, BV2Int, Int2BV, IntVal
"""
Shift left workaround that Solidity implements

View File

@ -1,5 +1,6 @@
from opcodes import SIGNEXTEND
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, If, UGE, ULT
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import SIGNEXTEND, AND
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, ULT
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import SIGNEXTEND
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, Extract, SignExt, UGT
"""
Checking the implementation of SIGNEXTEND using Z3's native SignExt and Extract

View File

@ -1,5 +1,6 @@
from opcodes import SHL, SIGNEXTEND
from rule import Rule
from opcodes import *
from z3 import BitVec, LShR, ULE
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import SIGNEXTEND, SAR, SHR
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal, ULE
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import NOT, SUB
from rule import Rule
from opcodes import *
from z3 import BitVec, BitVecVal
"""
Rule:

View File

@ -1,5 +1,6 @@
from opcodes import ADD, SUB
from rule import Rule
from opcodes import *
from z3 import BitVec
"""
Rules:

View File

@ -1,4 +1,4 @@
from z3 import *
from z3 import BitVecVal, Concat, If
def BVUnsignedUpCast(x, n_bits):
assert x.size() <= n_bits