Re: findall resulting in strange message

From: Wolfgang Jeltsch <wolfgang_at_cs.ioc.ee>
Date: Fri, 19 Apr 2013 18:17:11 +0300

Am Freitag, den 19.04.2013, 14:21 +0200 schrieb Michael Hanus:
> On 04/19/2013 12:34 PM, Wolfgang Jeltsch wrote:
> > I have a problem with using KiCS2. I have a source file that contains
> > the following code:
> >
> >> sublist :: [a] -> [a]
> >> sublist (pre ++ sub ++ post) = sub
> >
> > Now I load this into KiCS2 and enter the expression
> >
> > findall (\sub -> sub =:= sublist "Hallo!")
> >
> > at the prompt. KiCS2 answers with the message
> >
> > Main: external_ndho_C_try .
> >
> > What does this mean? Does this indicate a bug?
>
> The error message is not good and should be improved.
> Actually, the primitive encapsulation operator "try"
> which is used in the standard prelude to implement
> "findall" is not implemented in KiCS2.
>
> Since appropriate definitions of search operators
> is an ongoing topic for discussion (since the "naive"
> inclusion of findall in the first version of Curry),
> KiCS2 supports two more appropriate alternatives
> to encapsulate non-deterministic computations:
>
> […]
>
> I hope this explanation helps. If you need more infos or pointers
> to the literature, please let me know.
>
> Best regards,
>
> Michael

Hello again,

thanks a lot to you and Fabian for your answers.

In the meantime, I had already come across the libraries AllSolutions
and SearchTree, which worked fine for me. I understand that AllSolutions
uses fixed search strategies, while SearchTree allows you to choose
different search strategies, including ones you have defined yourself.

However, it seems that when using the SearchTree library, you always
have to explicitly construct the search tree first and then turn it into
a list. Is there also a convenience function that takes a search
strategy and an expression and gives you an I/O action yielding a list
of search results? The type of such a function should be something like

    (SearchTree a -> ValueSequence a) -> a -> IO [a] .

Best wishes,
Wolfgang

_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry

Received on Fr Apr 19 2013 - 21:16:54 CEST

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:12 CEST