solidity/test/formal/eq_sub.py
2020-12-22 15:11:48 +01:00

24 lines
291 B
Python

from rule import Rule
from opcodes import *
"""
Rule:
ISZERO(SUB(X, Y)) -> EQ(X, Y)
"""
rule = Rule()
n_bits = 256
# Input vars
X = BitVec('X', n_bits)
Y = BitVec('Y', n_bits)
# Non optimized result
nonopt = ISZERO(SUB(X, Y))
# Optimized result
opt = EQ(X, Y)
rule.check(nonopt, opt)