diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 05595e8..f742c1d 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -1158,10 +1158,11 @@ class foldconst(object): self.FoldTree(parent, index) return - if nt == '>': + if nt == '>' and ('SEF' in child[0] and 'SEF' in child[1] + or child[0]['nt'] == 'CONST' or child[1]['nt'] == 'CONST' + ): # Invert the inequalities to avoid doubling the cases to check. # a>b -> b