[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rb1: conditionally defined rules
From: |
Richard Boulton |
Subject: |
Re: rb1: conditionally defined rules |
Date: |
Wed, 8 Aug 2001 17:45:49 +0100 |
User-agent: |
Mutt/1.2.5i |
On Sun, Aug 05, 2001 at 06:46:09PM -0600, Tom Tromey wrote:
> This seems good. I have a few nits; if you fix them then just go
> ahead and check it in.
I've done this.
I found a couple of small problems while documenting `invert_conditions':
I've fixed these in the commit:
The first problem was that it used to be able to produce duplicate
conditionals, which would cause problems downstream: this is fixed by
calling variable_conditions_reduce() before emitting the output.
The second problem was that a conditional such as "A_TRUE B_TRUE" would be
considered different from "B_TRUE A_TRUE" because I was doing a direct
string comparison. I'm now using conditional_is_redundant() to compare the
conditionals, which solves this problem and also neatens the logic of
invert_conditions.
The complexity of invert_conditions is something like O(m*m*(2^n)), where m
is the size of @CONDS, and n is the number of conditions in the largest
conditional in @CONDS. In practice, m is often going to be 1, and n is
likely to be small but this is still rather worrying. At least the code is
reasonably easy to read.
--
Richard