[curry] Re: Dynamic Predicates?

From: Michael Hanus <mh_at_informatik.uni-kiel.de>
Date: Mon, 14 Oct 2019 18:13:05 +0200

Hi Felix,

as the author of this paper, I think it is my task to write an answer.
I agree with you that it is nice to consider persistant data
as predicates in logic programs in order to provide a smooth
integration. This motivated the paper and we used it also
in practical applications. The implemented library is still
available for older Curry systems as a package, see

https://www.informatik.uni-kiel.de/~curry/cpm/HTML/db-pakcs-1.0.0.html

A drawback of this approach is that it requires a tight integration
into the Curry run-time system, i.e., it is not just a library.
This explain why it is available only for older Prolog-based
Curry implementations. Moreover, this approach does not exploit
the query optimization features of database systems, which is
essential to deal with larger amounts of data. Therefore, we replaced
the use of dynamic predicates by a new approach where ER-based
data models are converted into Curry operations to support
a typed access to data stored in a database. You'll find some
papers on this development at

https://www.informatik.uni-kiel.de/~mh/papers/keyindex.html#KEYWORD_Databases

In particular, the most recent paper
"A Typeful Integration of SQL into Curry" describes a method
to support writing SQL queries in Curry programs which are
checked at compile time so that these queries always
deliver type-correct data which can be further processed
in a Curry program. This approach is used in our more recent
applications since it nicely combines type-safety with
a clear separation between queries and transactions.

This might not be what you are looking for, but Prolog-based
approaches often have the problem that there is no clear
separation between querying (which is declarative) and
changing the database (where time is relevant).

Another more lightweight concept for persistent data are
global entities which can be declared as other operations
but are persistently stored and easily accessed in a program,
see library "Global":
https://www.informatik.uni-kiel.de/~curry/cpm/DOC/base-1.0.0/Global.html
For instance, this kind of global entities are used in web programming
to deal with sessions and user data (preferences).

Best regards,

Michael

On 10/14/19 10:58 AM, Felix Holmgren wrote:
> Hi!
>
> I'm reading the "Dynamic Predicates in Functional Logic Programs" paper
> and I'm finding it quite interesting since I've always found the
> integration with persistent data stores to be a weak point in most
> languages and frameworks, and it seemed to me that Logic Programming
> should offer a more natural way to deal with this problem given that
> it's got the idea of a global database built in (as the paper points out).
>
> So my question is: has this been implemented in any form in existing
> Curry systems? I think there was a mention of dynamic predicates having
> been implemented as a library but I can't find it. Was the idea scrapped
> perhaps?
>
> Cheers
> /Felix
_______________________________________________
curry mailing list -- curry_at_lists.rwth-aachen.de
To unsubscribe send an email to curry-leave_at_lists.rwth-aachen.de
https://lists.rwth-aachen.de/postorius/lists/curry.lists.rwth-aachen.de
Received on Mo Okt 14 2019 - 18:14:47 CEST

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