一句话:本文从逻辑证明中多项式时间合成嵌套集合变换,并证明经典功能性证明也足以生成 NRC 表达式。
嵌套关系由积类型和集合类型构成,NRC 是定义其变换的标准强类型函数式语言。论文提出用逻辑公式声明式地描述这类变换:若公式带输入输出且可证明每个输入恰有一个输出,则它隐式定义了一个变换。主要结果是从证明中合成 NRC 表达式。具体地,在一个刻画嵌套集合自然推理的直觉主义演算中,作者利用 Craig 插值引理的类比,从表示嵌套集合的项之间可证包含关系出发,多项式时间地生成插值的 NRC 表达式。进一步,他们证明只需经典的功能性证明即可,不必是直觉主义的;因此,只要公式隐式定义了一个变换,就存在实现它的 NRC 表达式。
Nested relations, built up from atomic types via product and set types, form a rich data model. Over the last decades the nested relational calculus, NRC, has emerged as a standard language for defining transformations on nested collections. NRC is a strongly-typed functional language which allows building up transformations using tupling and projections, a singleton-former, and a map operation that lifts transformations on tuples to transformations on sets. In this work we describe an alternative declarative method of describing transformations in logic. A formula with distinguished inputs and outputs gives an implicit definition if one can prove that for each input there is only one output that satisfies it. Our main result shows that one can synthesize transformations from proofs that a formula provides an implicit definition, where the proof is in an intuitionistic calculus that captures a natural style of reasoning about nested collections. Our polynomial time synthesis procedure is based on an analog of Craig's interpolation lemma, starting with a provable containment between terms representing nested collections and generating an NRC expression that interpolates between them. We further show that NRC expressions that implement an implicit definition can be found when there is a classical proof of functionality, not just when there is an intuitionistic one. That is, whenever a formula implicitly defines a transformation, there is an NRC expression that implements it.