The theory of program modules is of interest to language designers not only for its practical importance to programming, but also because it lies at the nexus of three fundamental concerns in language design: the phase distinction, computational effects, and type abstraction. We contribute a fresh "synthetic" take on program modules that treats modules as the fundamental constructs, in which the usual suspects of prior module calculi (kinds, constructors, dynamic programs) are rendered as derived notions in terms of a modal type-theoretic account of the phase distinction. We simplify the account of type abstraction (embodied in the generativity of module functors) through a lax modality that encapsulates computational effects. Our main result is a (significant) proof-relevant and phase-sensitive generalization of the Reynolds abstraction theorem for a calculus of program modules, based on a new kind of logical relation called a parametricity structure. Parametricity structures generalize the proof-irrelevant relations of classical parametricity to proof-relevant families, where there may be non-trivial evidence witnessing the relatedness of two programs -- simplifying the metatheory of strong sums over the collection of types, for although there can be no "relation classifying relations", one easily accommodates a "family classifying small families". Using the insight that logical relations/parametricity is itself a form of phase distinction between the syntactic and the semantic, we contribute a new synthetic approach to phase separated parametricity based on the slogan "logical relations as types", iterating our modal account of the phase distinction. Then, to construct a simulation between two implementations of an abstract type, one simply programs a third implementation whose type component carries the representation invariant.
Ownership Confinement Ensures Representation Independence for Object-Oriented Programs
献给Edsger W. Dijkstra的记忆。表示独立性或关系参数化形式上表征了数据抽象语言结构提供的封装,并证明了模拟推理的合理性。表示独立性已经在各种语言和构造中得到了证明,但在对可变状态的共享引用中却没有;事实上,它在这些语言中通常是失败的。本文阐述了表示类的独立性,在一个命令式的,面向对象的语言与指针,子类化和动态调度,面向类的可见性控制,递归类型和方法,以及一个简单的模块形式。类的实例被认为是使用私有字段和所谓的表示对象来实现抽象。表示对象的封装通过对别名的限制(称为限制)来表示。证明了满足约束条件的程序的表示独立性。一个静态分析,接受常见的设计,如观察者和工厂模式的限制。形式化不仅考虑了客户端和提供抽象的类之间的通常接口,还考虑了类和它的子类之间的接口(通常称为“受保护的”)。
TU Dortmund University(多特蒙德工业大学);University of Bonn(波恩大学)
我们提出了关系线性规划,一个简单的框架结合线性程序(LP)和逻辑程序。关系线性规划(relational linear program,RLP)是一个声明性的LP模板,通过对象、关系和量化变量的逻辑概念定义目标和约束。这使得人们可以表达LP目标和约束关系的不同数量的个人和他们之间的关系,而不列举他们。连同逻辑知识库,有效地由逻辑事实和规则组成的逻辑程序,它归纳出一个基础LP。使用提升线性规划来求解该基础LP。也就是说,如果可能的话,采用地面LP内的对称性来降低其维数,并且使用任何现成的LP求解器来求解简化的程序。与主流LP模板语言(如AMPL)相比,它具有声明式和命令式编程风格的混合,RLP的关系性质允许在关系域上更直观地表示优化问题。我们说明了这一经验的实验近似推理在马尔可夫逻辑网络使用LP松弛,解决马尔可夫决策过程中,集体推理使用LP支持向量机。
Control-Data Separation and Logical Condition Propagation for Efficient Inference on Probabilistic Programs
National Institute of Informatics(国立信息学研究所);SOKENDAI (The Graduate University for Advanced Studies)(综合研究大学院大学(高级研究研究生院));Ernst & Young ShinNihon LLC(安永新日本有限责任公司);Kyoto University(京都大学)
本文提出融合控制-数据分离与逻辑条件传播的概率程序采样框架,并基于 Anglican 实现,显著提升含 while 循环和稀有观测程序的推理效率。
我们提出了$\textbf{calf}$,一个$\textbf{c}$ $\textbf{a}$软件$\textbf{l}$逻辑$\textbf{f}$模型,用于研究函数程序的定量方面。从最近的工作,重建传统的编程语言方面的\emph{phase distinctions}的模态帐户的灵感,我们认为,成本结构的程序激励$\textit{intension}$和$\textit{extension}$之间的阶段区别。有了这项技术,我们贡献了一个合成帐户的成本结构作为一个计算效果,其中成本意识的程序享有内部的不干扰属性:输入/输出行为不能依赖于成本。作为一个全谱依赖的类型理论,$\textbf{calf}$提出了一个统一的语言,编程和规范的成本和行为,可以顺利地集成与现有的数学库中可用的类型理论证明助手。我们评估$\textbf{calf}$作为成本分析的一般框架,通过实现两个基本的算法分析技术:$\textit{method of recurrence relations}$和$\textit{physicist's method for amortized analysis}$。我们部署这些技术的各种案例研究:我们证明了一个紧密的,封闭的欧几里德算法,验证分批队列的摊销的复杂性,并推导出紧密的,封闭的界限的顺序和$\textit{parallel}$复杂的合并排序,所有完全机械化的…