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.

nfn2dlp and nfnsolve: Normal Form Nested Programs Compiler and Solver

LEONE, Nicola;FABER, WOLFGANG
2009-01-01

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.
2009
978-3-642-04237-9
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/20.500.11770/167717
 Attenzione

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 0
  • ???jsp.display-item.citation.isi??? 0
social impact