Dimitry,
> Thus another alternative to increase expressive power of query language is
> to develop its declarative (i.e. nonprocedural) part. And here we come to
> deductive database (DDB) with its logic language Datalog.
You may want to look at the work of Rada Chirkova, who has already written a
PostgreSQL-parse-tree-to-DataLog converter:
http://research.csc.ncsu.edu/selftune/Report_031005.pdf
--
Josh Berkus
Aglio Database Solutions
San Francisco