diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 5310383..09bf643 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -245,6 +245,11 @@ class foldconst(object): self.FoldCond(parent, index, ParentIsNegation) return + if nt == '|': + # In FoldCond(a | b), both a and b are conds themselves. + self.FoldCond(child, 0) + self.FoldCond(child, 1) + # Specific optimization to catch a bitwise test appearing frequently. # If b and c are nonzero constant powers of two: # !(a & b) | !(a & c) -> ~(a|~(b|c))