[Submitted on 25 Jan 2026 (v1), last revised 25 Jul 2026 (this version, v5)]
Abstract: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 the Herbrand atom semantics of a logic program. Here, we develop a \emph{moded-atom semantics} that extends the standard Herbrand atom semantics in two ways: (\ia)~each atom subterm carries a \emph{mode}, recording whether it is consumed from or produced to the environment; and (\ib)~partial computations, including those that deadlock, fail, or never terminate, also contribute moded atoms to the semantics. We define types to be regular sets of \emph{moded paths} over this semantics, give a syntactic definition of GLP well-typing, and prove that a well-typed program is sound: every output path in its well-typed moded-atom semantics conforms to its declared output type.
A type checker for GLP was implemented \emph{by} AI (Claude) in Dart, starting from the mathematical specification of Typed GLP (this paper), deriving from it an English+pseudocode spec (written by AI), and from the spec deriving Dart code (by AI). While GLP is naturally untyped, the motivation for typing it was \emph{for} AI: tasking AI to program complex communication modalities and hoping for the best turned out to be a tenuous strategy. The discipline we developed with Typed GLP is for the human designer and AI to jointly develop formal GLP type definitions and declarations, together with informal intent of the declared procedures, and only then let AI write the GLP code.
Submission history
From: Ehud Shapiro [view email]
[v1]
Sun, 25 Jan 2026 19:18:27 UTC (105 KB)
[v2]
Wed, 28 Jan 2026 14:10:36 UTC (106 KB)
[v3]
Mon, 30 Mar 2026 14:21:50 UTC (127 KB)
[v4]
Sun, 7 Jun 2026 15:28:48 UTC (152 KB)
[v5]
Sat, 25 Jul 2026 13:03:38 UTC (162 KB)
0 Comments
Log in to join the conversation.No comments yet. Be the first to share your thoughts.