Richard Boulton <[EMAIL PROTECTED]> writes:
[snip]
> (ii) is fixed by redefining the behaviour of conditionals_true_when() such
> that it returns TRUE if all the @CONDS are true for a condition in @WHENS.
> The behaviour when WHENS is empty is also altered to be more logical (this
> is where the FIXME is fixed).
> 
> This should not affect any other code since conditionals_true_when() is
> only called with an array of size != 1 in @WHENS by
> variable_conditions_reduce().

I would suggest that you keep the semantics of conditions_true_when()
as is, and introduce

  sub redundant_condition ($@)
  {
    my ($cond, @when) = @_;
    
    foreach my $when (@when) 
    {
      return 1 if condition_true_when ($cond, $when);
    }
    return 0;
  }

and use this in variable_conditions_reduce.

So, I think it's cleaner to do:

  1. conditions_true_when(\@@) -- takes a list of conditions and one
     or more "whens", and returns true when all conditions are true
     for all whens.

  2. redundant_condition($@) -- check if the given condition
     subsumed by any of the whens.

  3. change 'variable_conditions_reduce' to use 'redundant_condition',
     along with your modification to look at the tail of @conds too.

- Hari
-- 
Raja R Harinath ------------------------------ [EMAIL PROTECTED]
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash

Reply via email to