Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prolog to SQL converter

Without thinking to much, it seems to me that a large set of Prolog's functionality could be implemented as relational calculus (a.k.a. SQL).

Has anyone heard of any tools to automatically convert Prolog to SQL?

like image 353
BCS Avatar asked Apr 07 '09 06:04

BCS


1 Answers

Yes, of course.

A premise for skeptics: any semi-decent book on database theory mentions Datalog (which is Prolog-like) and theorems which demonstrate that is possible to translate it to/from Relational Algebra (RA) (under specific restrictions).

SQL is not faithful to RA or relational calculi, but is enough to support Prolog:

  • Christoph Draxler has developed a Prolog to SQL compiler (PL2SQL) for his thesis, available for download (.tgz) - also here at CMU Artificial Intelligence Repository (it was adapted and included in at least: Ciao Prolog and SWI-Prolog via Blipkit - Biomedical LogIc Programming Knowledge Integration Kit);
  • Igor Wojnicki has developed for his PhD (A Rule-based Inference Engine Extending Knowledge Processing Capabilities of Relational Database Management Systems) a prototype system implementing his Jelly View technology called ReDaReS, but it seems not available for download;
  • Relational Abstract Machine (RAM) translates Prolog to Relational Algebra, but it doesn't seems to have a SQL backend;
  • Walter D. Potter has a couple of papers on Prolog/RDBMS integration;
  • Kevin Boone's paper on Using SQL with Prolog to improve performance with large databases is also interesting;
  • and so on...
like image 133
MaD70 Avatar answered Sep 23 '22 21:09

MaD70