arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1412.2304cs.PL
收藏

使用基于Prolog的ECLiPSe CLP系统声明性地解决棘手的Google Code Jam问题

Declaratively solving tricky Google Code Jam problems with Prolog-based ECLiPSe CLP system

Sergii Dymchenko, Mariia Mykhailova

摘要:

在本文中,我们展示了几个例子,解决具有挑战性的算法问题,从谷歌代码果酱编程比赛与基于Prolog的ECLiPSe系统使用声明性技术,如约束逻辑编程和线性(整数)编程。这些问题的目的是要解决发明聪明的算法,并有效地实现它们在传统的命令式程序设计语言,但我们目前相对简单的声明式程序ECLiPSe是足够快的比赛规则所规定的时间内找到答案。我们认为ECLiPSe的声明式编程比命令式编程更适合解决Google Code Jam中提供的某些常见编程问题。我们通过比较两种解决方案所需的心理步骤来证明这一点。

英文摘要:

In this paper we demonstrate several examples of solving challenging algorithmic problems from the Google Code Jam programming contest with the Prolog-based ECLiPSe system using declarative techniques like constraint logic programming and linear (integer) programming. These problems were designed to be solved by inventing clever algorithms and efficiently implementing them in a conventional imperative programming language, but we present relatively simple declarative programs in ECLiPSe that are fast enough to find answers within the time limit imposed by the contest rules. We claim that declarative programming with ECLiPSe is better suited for solving certain common kinds of programming problems offered in Google Code Jam than imperative programming. We show this by comparing the mental steps required to come up with both kinds of solutions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑