Re: residuation for compositional search?

From: Sebastian Fischer <>
Date: Tue, 24 May 2011 17:13:05 +0200

Hello Sebastian,

On Tue, May 24, 2011 at 4:49 PM, Sebastian Fischer <> 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?


    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.


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
Received on Di Mai 24 2011 - 17:30:49 CEST

This archive was generated by hypermail 2.3.0 : Di Dez 05 2023 - 07:15:11 CET