Extended Logic-plus-Functional Programming

Harold Boley

DFKI DFKI Research Reports (RR) 92-03 1992.


Extensions of logic and functional programming are integrated in RELFUN. Its valued clauses comprise Horn clauses ('true'-valued) and clauses with a distinguished 'foot' premise (returning arbitrary values). Both the logic and functional components permit LISP-like varying-arity and higher-order operators. The DATAFUN sublanguage of the functional component is shown to be preferable to relational encodings of functions in DATALOG. RELFUN permits non-ground, non-deterministic functions, hence certain functions can be inverted using an 'is'-primitive generalizing that of PROLOG. For function nestings a strict call-by-value strategy is employed. The reduction of these extensions to a relational sublanguage is discussed and their WAM compilation is sketched. Three examples ('serialise', 'wang', and 'eval') demonstrate the relational/functional style in use. The list expressions of RELFUN's LISP implementation are presented in an extended PROLOG-like syntax.

RR-92-03.pdf (pdf, 30 MB )

German Research Center for Artificial Intelligence
Deutsches Forschungszentrum für Künstliche Intelligenz