Table of Contents
Fetching ...

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.

Implementing Grassroots Logic Programs with Multiagent Transition Systems and AI

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, for single-agent and 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.
Paper Structure (56 sections, 30 theorems, 7 equations, 1 figure)

This paper contains 56 sections, 30 theorems, 7 equations, 1 figure.

Key Result

Lemma 14

GLP is persistent.

Figures (1)

  • Figure 1: maGLP vs madGLP variable linking through three stages. Left: maGLP shared variable pairs. Right: madGLP local pairs with global links (arrows from reader to writer, labeled with global names). Dashed lines separate agents $p$ and $q$. "gs" denotes global_send goals watching readers. In Stage 2, the V link arrow points from $q$ to $p$ (callback): when $q$ assigns $\mathsf{V_q}$, the goal gs($\mathsf{V_q?}$) sends the value back to $p$.

Theorems & Definitions (105)

  • Definition 1: Transition System
  • Definition 2: Implementation
  • Definition 3: Live, Complete, and Correct Implementation
  • Definition 4: GLP Variables
  • Definition 5: GLP Terms and Goals
  • Definition 6: Single-Occurrence (SO) Invariant
  • Definition 7: GLP Program
  • Definition 8: Writers Substitution, Assignment, Readers Substitution and Counterpart
  • Definition 9: GLP Renaming, Renaming Apart
  • Definition 10: Writer MGU
  • ...and 95 more