Answer Set Programming (ASP) is a popular declarative programming language for solving hard combinatorial problems. Although ASP has gained widespread acceptance in academic and industrial contexts, there are certain user groups who may find it more advantageous to employ a higher-level language that closely resembles natural language when specifying ASP programs. In this paper, we propose a novel tool, called CNL2ASP, for translating English sentences expressed in a controlled natural language (CNL) form into ASP. In particular, we first provide a definition of the type of sentences allowed by our CNL and their translation as ASP rules, and then exemplify the usage of the CNL for the specification of both synthetic and real-world combinatorial problems. Finally, we report the results of an experimental analysis conducted on the real-world problems to compare the performance of automatically generated encodings with the ones written by ASP practitioners, showing that our tool can obtain satisfactory performance on these benchmarks. Under consideration in Theory and Practice of Logic Programming (TPLP).
翻译:回答集编程(ASP)是一种流行的声明式编程语言,用于解决困难的组合问题。尽管ASP已在学术和工业领域获得广泛认可,但某些用户群体可能发现,在指定ASP程序时,使用一种更接近自然语言的高级语言更为有利。本文提出了一种名为CNL2ASP的新工具,用于将以受控自然语言(CNL)形式表达的英文句子转换为ASP。具体而言,我们首先给出了CNL允许的句子类型及其转换为ASP规则的定义,然后通过综合组合问题和实际组合问题的规范示例,展示了CNL的使用方法。最后,我们报告了在实际问题上进行的实验分析结果,将自动生成的编码与ASP从业者编写的编码进行性能比较,表明我们的工具在这些基准上能够获得令人满意的性能。本文在《逻辑编程理论与实践》(TPLP)审稿中。