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?
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?
Short answer: No. Although, at Uni I had to take some algorithms linked in a procedural pseduo-code and put them into Prolog. I'm thinking through how it'd work in SQL and I don't think you'd get enough of the core functionality.
In terms of list traversal, I don't see how you can do it relationally. You'll need to lean heavily on procedural constructs for it to work (for/loops, if statements, break (or whatever the equiv is in SQL for the cut). Was that what you were thinking or did you have anohter idea of how you'd go about it?
The mapping isn't very good. SQL, for example, doesn't do backtracking, unification, lists, or adhoc nested structures.
Prolog doesn't deal well with composite objects, indexes, etc.
I'd say it's a no-go.
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:
I would like to writte a SQL to prolog compiler... And I'am asking is this a right thing to do...
Thanks in advance, Robert...;) [email protected]