HEX-programs are an extension of answer set programming (ASP) towards external sources. To this end, external atoms provide a bidirectional interface between the program and an external source. Traditionally, HEX-programs are evaluated using a rewriting to ordinary ASP programs which guess truth values of external atoms; this yields answer set candidates whose guesses are verified by evaluating the source. Despite the integration of learning techniques into this approach, which reduce the number of candidates and of necessary verification calls, the remaining external calls are still expensive. In this paper we present an alternative approach based on inlining of external atoms, motivated by existing but less general approaches for specialized formalisms such as DL-programs. External atoms are then compiled away such that no verification calls are necessary. To this end, we make use of support sets, which describe conditions on input atoms that are sufficient to satisfy an external atom. The approach is implemented in the DLVHEX reasoner. Experiments show a significant performance gain.
展开▼