nfn2dlp and nfnsolve: Normal Form Nested Programs Compiler and Solver

  • Authors:
  • Annamaria Bria;Wolfgang Faber;Nicola Leone

  • Affiliations:
  • Department of Mathematics, University of Calabria, Rende, Italy 87036;Department of Mathematics, University of Calabria, Rende, Italy 87036;Department of Mathematics, University of Calabria, Rende, Italy 87036

  • Venue:
  • LPNMR '09 Proceedings of the 10th International Conference on Logic Programming and Nonmonotonic Reasoning
  • Year:
  • 2009

Quantified Score

Hi-index 0.01

Visualization

Abstract

Normal Form Nested (NFN ) programs have recently been introduced in order to allow for enriching the syntax of disjunctive logic programs under the answer sets semantics. In particular, heads of rules can be disjunctions of conjunctions, while bodies can be conjunctions of disjunctions. Different to many other proposals of this kind, NFN programs may contain variables, and a notion of safety has been defined for guaranteeing domain independence. Moreover, NFN programs can be efficiently translated to standard disjunctive logic programs (DLP ). In this paper we present the tool nfn2dlp , a compiler for NFN programs, which implements an efficient translation from safe NFN programs to safe DLP programs. The answer sets of the original NFN program can be obtained from the answer sets of the transformed program (which in turn can be obtained by using a DLP system) by a simple transformation. The system has been implemented using the object-oriented programming language Ruby and Treetop, a language for Parsing Expression Grammars (PEGs). It currently produces DLP programs in the format of DLV. The separate script nfnsolve uses DLV as a back-end to compute answer sets for NFN programs. Thus, combining the two tools we obtain a system which supports the powerful NFN language, and is available for experiments.