From 7e39635b0978cde96584eb2ac10d3c5a9a9b9b52 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sat, 21 Oct 2017 20:38:54 +0200 Subject: [PATCH] Transform !(x != y) into x == y. Can happen with lists. --- lslopt/lslfoldconst.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 1c10f66..7d086f0 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -640,6 +640,12 @@ class foldconst(object): subexpr['ch'] = [subexpr['ch'][b], subexpr['ch'][a]] parent[index] = subexpr return + if snt == '!=': + subexpr['nt'] = '==' + parent[index] = subexpr + self.FoldTree(parent, index) + return + return if nt == '~':