Skip to content

Commit

Permalink
Extended equivalence condition simplifier for latest target 7 result …
Browse files Browse the repository at this point in the history
…(issue #415).
  • Loading branch information
jim-carciofini committed Jun 27, 2024
1 parent c5778f5 commit 44cae29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pate_binja/pate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,7 @@ def acons(k: Any, v: Any, alist: list[list]) -> list[list]:
'bvsle': 'bvsgt',
'bvsgt': 'bvsle',
'bvsge': 'bvslt',
'intle': 'intgt',
'=': '!=',
'!=': '='
}
Expand All @@ -1326,6 +1327,10 @@ def acons(k: Any, v: Any, alist: list[list]) -> list[list]:
'bvsle': '<=',
'bvsgt': '>',
'bvsge': '>=',
'intlt': '<',
'intle': '<=',
'intgt': '>',
'intge': '>=',
'andp': '&',
'orp': '|',
'LTs' : '<',
Expand Down Expand Up @@ -1369,6 +1374,10 @@ def simplify_sexp(sexp, env=None):
if re.fullmatch(r'read(?:LE|GE)\d+', op) and len(arg) == 2 and arg[0] == 'memory':
return [op, arg[1]]

# Simplify sbvToInteger(x) => x
if op == 'sbvToInteger' and len(arg) == 1:
return arg[0]

# Simplify multiply by 1
if op == 'bvmul' and len(arg) == 2:
if re.fullmatch(r'#x0*1', arg[0]):
Expand Down

0 comments on commit 44cae29

Please sign in to comment.