automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automake::Conditional::invert


From: Raja R Harinath
Subject: Re: Automake::Conditional::invert
Date: Tue, 19 Nov 2002 18:32:29 -0600
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Hi,

Alexandre Duret-Lutz <address@hidden> writes:

>>>> "Raja" == Raja R Harinath <address@hidden> writes:
>
> [...]
>
>  Raja> If you really want to worry about scalability, A::CS::invert would be
>  Raja> better written as a product-of-sums to sum-of-products converter,
>  Raja> rather than explicitly enumerating every truth-value candidate.
>
> [...]
>
> Here is my proposal.  make check is running.
>
> 2002-11-19  Alexandre Duret-Lutz  <address@hidden>
>
>       * lib/Automake/ConditionalSet.pm (conds): Use value() to simplify.
>       (invert): Rewrite as a product-of-sums to sum-of-products converter.
>       Suggested by Raja R Harinath.
>       * lib/Automake/tests/ConditionalSet.pl (test_invert): Update.
>       * automake.in (condition_negate): Move ...
>       * lib/Automake/Conditional.pm (negate_condition): ... here.

Looks OK.  

Noting the handling of the %res in 'invert', you might as well use the
ConditionalSet constructor.  There are two slightly more primitive
operations that this can be written in terms of.

  * method A::C::not which returns an ConditionalSet

  * method A::CS::multiply that takes another ConditionalSet,
    multiplies it with $self and returns a new ConditionalSet

  $res = new A::CS A::C::TRUE;
  $res = $res->multiply $cond->not
    foreach $cond ($self->conds);
  return $res;

It's not all that important, though.  What you have is fine.

- Hari
-- 
Raja R Harinath ------------------------------ address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]