In this paper we propose a new concept to deal withdynamic predicates in functional logic programs.The definition of a dynamic predicate can change over time,i.e., one can add or remove facts that define this predicate.Our approach is easy to use and has a clear semanticsthat does not depend on the particular (demand-driven) evaluationstrategy of the underlying implementation.In particular, the concept is not based on (unsafe) side effectsso thatthe order of evaluation does not influence the computed results---anessential requirement in non-strict languages.Dynamic predicates can also be persistent so that theirdefinitions are saved across invocations of programs.Thus, dynamic predicates are a lightweight alternativeto the explicit use of external database systems.Moreover, they extend one of the classicalapplication areas of logic programming to functional logic programs.We present the concept, its use and an implementationin a Prolog-based compiler.
展开▼