Grassroots Logic Programs (GLP) is a concurrent logic programming language in which logic variables are partitioned into paired readers and writers. An assignment is produced at most once via a writer and consumed at most once via its paired reader, and may contain additional readers and/or writers. This enables the concise expression of rich multidirectional communication modalities. ``Logic Programs as Types for Logic Programs'' (LICS'91) defined types as regular sets of paths over derivable ground atoms. Here, we define types to be regular sets of moded paths, where a mode captures directionality of communication -- whether a subterm is consumed from or produced to the environment -- enabling the typing of interactive partial computations including those that eventually deadlock or fail, or never terminate. We provide a syntactic definition of well-typing and prove that a program is well-typed iff the path abstraction of its moded-atom semantics satisfies covariance and contravariance conditions with respect to its type. The GLP type system was implemented in Dart by AI, starting from a mathematical specification of Typed GLP (this paper), deriving from it an English spec (written by AI), and from the spec deriving Dart code (by AI). While GLP is naturally untyped, the motivation for Typed GLP comes from programming with AI: Asking AI to program complex communication modalities in GLP (and in general) and hoping for the best is a tenuous strategy. The emerging discipline we advocate and employ is for the human designer and AI to jointly develop and agree upon (1)~GLP types; (2)~GLP procedure type declarations; (3)~informal (English) descriptions of the procedures; and only then let AI attempt to write (4)~GLP code based on those.


翻译:基层逻辑程序(GLP)是一种并发逻辑编程语言,其中逻辑变量被划分为配对的读取器和写入器。每个赋值通过写入器最多生成一次,并通过其配对的读取器最多消耗一次,且可能包含额外的读取器和/或写入器。这使得能够简洁地表达丰富的多方向通信模式。"逻辑程序作为逻辑程序的类型"(LICS'91)将类型定义为可推导基项上路径的正则集合。在此,我们将类型定义为模态路径的正则集合,其中模态捕捉了通信的方向性——子项是从环境中消耗还是向环境产生——从而能够为包括最终死锁、失败或永不终止的交互式部分计算进行类型化。我们给出了良好类型化的语法定义,并证明一个程序是良好类型化的当且仅当其模态原子语义的路径抽象相对于其类型满足协变和逆变条件。GLP类型系统由AI在Dart中实现,从类型化GLP的数学规范(本文)出发,由此推导出英文规范(由AI编写),再根据规范推导出Dart代码(由AI编写)。虽然GLP本质上是无类型的,但类型化GLP的动机源于与AI协作编程:要求AI在GLP(以及一般情况下)中编程复杂的通信模式并寄希望于最佳结果是一种薄弱的策略。我们倡导并采用的新兴学科是:由人类设计者和AI共同开发并达成一致:(1)GLP类型;(2)GLP过程类型声明;(3)非正式(英文)过程描述;然后才让AI尝试基于这些编写(4)GLP代码。

0
下载
关闭预览

相关内容

大语言模型表示工程的分类、机会与挑战
专知会员服务
22+阅读 · 2025年2月28日
【2022新书】Python数学逻辑,285页pdf
专知
13+阅读 · 2022年11月24日
层级强化学习概念简介
CreateAMind
21+阅读 · 2019年6月9日
AmpliGraph:知识图谱表示学习工具包
专知
40+阅读 · 2019年4月6日
开年重磅——周志华团队综述归纳逻辑程序设计
计算机研究与发展
10+阅读 · 2019年1月22日
用于数学的 10 个优秀编程语言
算法与数据结构
13+阅读 · 2018年1月5日
推荐中的序列化建模:Session-based neural recommendation
机器学习研究会
18+阅读 · 2017年11月5日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关主题
最新内容
认知战与交战性质的改变:神经战略视角
专知会员服务
5+阅读 · 5月8日
人工智能如何变革军事C5ISR作战
专知会员服务
12+阅读 · 5月8日
相关VIP内容
大语言模型表示工程的分类、机会与挑战
专知会员服务
22+阅读 · 2025年2月28日
相关资讯
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员