We present module theory and linear maps as a powerful generalised and computationally efficient framework for the relational data model, which underpins today's relational database systems. Based on universal constructions of modules we obtain compact and computationally efficient data structures for data collections corresponding to union and deletion, repeated union, Cartesian product and key-indexed data. Free modules naturally give rise to polysets, which generalise multisets and facilitate expressing database queries as multilinear maps with asymptotically efficient evaluation on polyset constructors. We introduce compact maps as a way of representing infinite (poly)sets constructible from an infinite base set and its elements by addition and subtraction. We show how natural joins generalise to algebraic joins, while intersection is implemented by a novel algorithm on nested compact maps that carefully avoids visiting parts of the input that do not contribute to the eventual output. Our algebraic framework leads to a worst-case optimal evaluation of cyclic relational queries, which is known to be impossible using textbook query optimisers that operate on lists of records only.
RelationalAI(关系人工智能);University of Edinburgh(爱丁堡大学);Univ of Edinburgh(爱丁堡大学);LIGM, Univ. Gustave Eiffel, CNRS(法国盖埃夫大学信息与数字科学实验室,法国国家科学研究中心);University of Bayreuth(拜罗伊特大学);University of Warsaw(华沙大学);Hebrew University(耶路撒冷希伯来大学);Université Paris Cité, CNRS, IRIF(巴黎西岱大学,法国国家科学研究中心,信息学与随机系统研究所);PUC Chile(智利天主教Pontificia大学)
关系透镜是解决关系数据库中视图更新问题的一种现代方法。正如Bohannon等人(2006年)所介绍的那样,关系透镜允许通过组合执行单独转换的透镜来定义可更新视图。Horn et al.(2018)提供了增量关系透镜的第一个实现,它证明了关系透镜可以通过将更改传播到数据库而不是替换整个数据库状态来有效地实现。然而,这两种方法都没有提出具体的语言设计;因此,目前还不清楚如何将镜头集成到通用程序设计语言中,或者如何检查镜头是否满足可预测行为所需的格式良好的条件。在本文中,我们提出了第一个完整的帐户关系镜头的功能程序设计语言,通过扩展链接网络程序设计语言。我们提供了高阶谓词的支持,并提供了第一个帐户的类型检查关系镜头,这是适合实施。我们证明了我们的打字规则的合理性,并通过实现一个科学数据库应用程序的策展接口来说明我们的方法。
TU Dortmund University(多特蒙德工业大学);University of Bonn(波恩大学)
我们提出了关系线性规划,一个简单的框架结合线性程序(LP)和逻辑程序。关系线性规划(relational linear program,RLP)是一个声明性的LP模板,通过对象、关系和量化变量的逻辑概念定义目标和约束。这使得人们可以表达LP目标和约束关系的不同数量的个人和他们之间的关系,而不列举他们。连同逻辑知识库,有效地由逻辑事实和规则组成的逻辑程序,它归纳出一个基础LP。使用提升线性规划来求解该基础LP。也就是说,如果可能的话,采用地面LP内的对称性来降低其维数,并且使用任何现成的LP求解器来求解简化的程序。与主流LP模板语言(如AMPL)相比,它具有声明式和命令式编程风格的混合,RLP的关系性质允许在关系域上更直观地表示优化问题。我们说明了这一经验的实验近似推理在马尔可夫逻辑网络使用LP松弛,解决马尔可夫决策过程中,集体推理使用LP支持向量机。