Implementing Grassroots Logic Programs with Multiagent Transition Systems and AI
Ehud Shapiro
TL;DR
GLP introduces a concurrent logic programming paradigm with writer/reader variable pairs enabling single-assignment communication; the paper develops two implementation-ready semantics, $\text{dGLP}$ for single-agent and $\text{madGLP}$ for multiagent, and proves them correct with respect to their abstract counterparts. It then shows how these semantics map onto deterministic agent-level implementations using globalization/localization and a global link infrastructure, including an index-0 serializer for cold-calls, ensuring correct dataflow and forwarding without central coordination. The methodology advocates a human-AI co-design workflow, deriving English+code specs from formal semantics and then Dart implementations, with iterative refinement driving major redesigns. Overall, the work provides a rigorous foundation and practical blueprint for implementing Grassroots Logic Programs on distributed smartphone networks.
Abstract
Grassroots Logic Programs (GLP) is a concurrent logic programming language with variables partitioned into paired \emph{readers} and \emph{writers}, conjuring both linear logic and futures/promises: an assignment is produced at most once via the sole occurrence of a writer (promise) and consumed at most once via the sole occurrence of its paired reader (future), and may contain additional readers and/or writers, enabling the concise expression of rich multidirectional communication modalities. GLP was designed as a language for grassroots platforms -- distributed systems with multiple instances that can operate independently of each other and of any global resource, and can coalesce into ever larger instances -- with its target architecture being smartphones communicating peer-to-peer. The operational semantics of Concurrent (single-agent) GLP and of multiagent GLP (maGLP) were defined via transition systems/multiagent transition systems, respectively. Here, we describe the mathematics developed to facilitate the workstation- and smartphone-based implementations of GLP by AI in Dart. We developed dGLP -- implementation-ready deterministic operational semantics for single-agent GLP -- and proved it correct with respect to the Concurrent GLP operational semantics; dGLP was used by AI as a formal spec, from which it developed a workstation-based implementation of GLP. We developed madGLP -- an implementation-ready multiagent operational semantics for maGLP -- and proved it correct with respect to the maGLP operational semantics; madGLP is deterministic at the agent level (not at the system level due to communication asynchrony), and is being used by AI as a formal spec from which it develops a smartphone-based implementation of maGLP.
