Re: residuation for compositional search?

From: Sebastian Fischer <sebf_at_informatik.uni-kiel.de>
Date: Tue, 24 May 2011 17:13:05 +0200

Hello Sebastian,

On Tue, May 24, 2011 at 4:49 PM, Sebastian Fischer <
sebf_at_informatik.uni-kiel.de> wrote:

> The last solution interleaves the constraints differently. Is it possible
> to achieve the same in a modular way, for example, by cleverly using
> residuation?
>

Yes:

    partition l | all (not . null) (ensureSpine p) =:= True & concat p =:= l
= p
      where p free

So this is an example where residuation helps to keep the program modular
and the search space finite at the same time.

Best,
Sebastian

P.S. There seems to be a bug in PAKCS. The definition

    partition l | concat (ensureSpine p) =:= l &
                  all (not . null) p =:= True = p
      where p free

fails to find a solution if the argument is non-empty. MCC succeeds.

P.P.S. I guess it is pointless to put `ensureSpine` in the second constraint
but I did not try it.



_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Di Mai 24 2011 - 17:30:49 CEST

This archive was generated by hypermail 2.3.0 : Sa Apr 20 2024 - 07:15:09 CEST