In this paper we present several examples of solving algorithmic problems from the Google Code Jam programming contest with Picat programming language using declarative techniques: constraint logic programming and tabled logic programming. In some cases the use of Picat simplifies the implementation compared to conventional imperative programming languages, while in others it allows to directly convert the problem statement into an efficiently solvable declarative problem specification without inventing an imperative algorithm.
翻译:在本文中,我们举了几个例子来解决Google code Jam 编程竞赛中的算法问题,用Picat 编程语言使用宣示性技术:限制逻辑编程和提出逻辑编程。 在某些情况下,使用Picat 简化了实施比常规急需编程语言更简单,而在另一些情况下,它允许将问题陈述直接转换成一种高效的公开性问题说明,而不必发明一种必需的算法。