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

面向应用的关系编程

Towards Applicative Relational Programming

H. Ibrahim, M. H. van Emden

摘要:

函数式编程有两种风格:一种是“函数是一等公民”(我们称之为应用式),另一种是基于等式(我们称之为声明式)。在关系编程中,子句扮演着等式的角色。因此Prolog是声明性的。本文的目的是在关系编程中提供一个数学基础的关系模拟的应用功能编程。我们使用的圆柱形语义的一阶逻辑由于塔斯基,并提供了一个新的符号所需的圆柱体,我们称之为表。我们定义的表/关系代数与运营商足以将霍恩条款代数形式。我们建立这些运营商的基本数学性质。我们展示了如何关系可以是一等公民,并设计机制的模块化,本地范围的谓词,并导出/导入程序之间的关系。

英文摘要:

Functional programming comes in two flavours: one where ``functions are first-class citizens'' (we call this applicative) and one which is based on equations (we call this declarative). In relational programming clauses play the role of equations. Hence Prolog is declarative. The purpose of this paper is to provide in relational programming a mathematical basis for the relational analog of applicative functional programming. We use the cylindric semantics of first-order logic due to Tarski and provide a new notation for the required cylinders that we call tables. We define the Table/Relation Algebra with operators sufficient to translate Horn clauses into algebraic form. We establish basic mathematical properties of these operators. We show how relations can be first-class citizens, and devise mechanisms for modularity, for local scoping of predicates, and for exporting/importing relations between programs.

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

↑