Grassroots platforms are designed to be owned, operated and governed by their participants, and thus are constituted from person-to-person smartphone apps that are run by the participants. A grassroots app is specified using a grassroots social contract, which is compiled through an abstraction cascade into a volition-guarded Grassroots Logic Program (vGLP), a multiagent concurrent logic programming language. A vGLP program in turn specifies a smartphone UI via which people express their volitions and thus control the app. Prudence dictates large-scale evaluation and testing of grassroots platforms prior to deployment, but using the many people needed to do that is a contradiction in terms. Hence another solution is needed. Here, we present stochastic GLP (sGLP), designed to allow grassroots platforms to be simulated at scale from the vGLP programs that deploy them, with stochastic agents in place of people. sGLP is GLP with a rate extension for specifying stochastic behaviour. A stochastic agent is an sGLP program replacing both the vGLP UI and the person behind it. It is typed by the dual of the interactive type of the UI and specifies a stochastic profile of a person's behaviour. We demonstrate sGLP on the grassroots social graph, with a population of men and women drawn from four stochastic profiles --- homophile or indifferent, wary or sociable --- and on grassroots currencies, with four profiles --- spenders or savers, cautious or generous --- and report what the mix of profiles does to the social graph that forms and to the currencies that circulate. We prove that every run of a vGLP program in which sGLP agents replace the UI and the people behind it is a vGLP run. We implemented sGLP in GLP by Gillespie's method, and ran reproducible simulations with it.
Figures & tables
Figure 1. The edges of the friendship graph at the end of each month, in two runs of 100 agents for one year: all edges, those within a sex and those across the sexes. A line chart of the edges of the friendship graph by month for two seeds, split into edges within a sex and across the sexes.
homophile
wary
edges
across the sexes
one by month
none
none
4,199±26
2,113±18
1.0, 1
none
70%
2,634±159
1,322±82
1.3, 2
none
all
1,698±32
845±25
2.1, 3
60%
none
3,213±88
1,130±73
1.0, 1
60%
70%
1,926±147
626±73
2.2, 4
60%
all
1,216±51
385±37
3.0, 5
Table 1. The friendship graph at the end of the year by the mix of profiles, 100 agents, over the seeds 1 to 20: the edges and those across the sexes, mean ± standard deviation, and the month by whose end the graph is one component, mean and latest.
Figure 2. The friendship graph at the end of the year of the run with seed 20260927 as an adjacency matrix, a dot per edge: blue between two men, red between two women, green between a man and a woman. The agents are ordered by sex and within a sex by profile: homophile wary (HW), homophile sociable (HS), indifferent wary (IW), indifferent sociable (IS). An adjacency matrix of the friendship graph at the end of the year, agents ordered by sex and profile, edges coloured by the sexes of the pair.
Figure 3. The run with seed 20260927, 100 agents, half spenders and half cautious, by month. Left: the circulation by who holds whose coins. Right: the coins issued by the spenders and by the savers, and those held by each — the credit each profile has given and received. Two charts by month: the circulation split by which profile holds which profile's coins, and the coins issued and held by spenders and by savers.
Figure 4. Who holds whose coins at the end of the year of the run with seed 20260927: holders by row, issuers by column, a cell the coins held, white where none. The agents are ordered by profile — spender (Sp) or saver (Sa), cautious (C) or generous (G) — the holders’ profiles by the coins they hold and the issuers’ by the coins they have out, most first. A matrix of who holds whose coins at the end of the year, holders by row and issuers by column, ordered by profile, coloured by the coins held.
spenders
cautious
circulation
proposals
declined
none
none
1,660±116
687±10
0
none
half
1,660±116
687±10
0
none
all
1,655±115
687±10
0.1±0.2
half
none
11,546±722
2,917±131
0
half
half
11,282±797
2,961±143
64±25
half
all
10,328±621
3,030±150
190±49
Table 2. Coins among friends at the end of the year by the mix of profiles, 100 agents over the friendship graphs of Section 5 , over the seeds 1 to 20, mean ± standard deviation: the circulation, the proposals made and those declined.
Figure 5. The circulation at the end of each month with half the agents cautious and none, half or all of them spenders, 100 agents for one year over the friendship graphs of Section 5 , seeds 20260927 and 1. A line chart of the coins in circulation by month for none, half and all spenders, two seeds.
A grassroots platform is a multiagent distributed system in which multiple independent instances can form and operate independently of each other and of any global resource, yet may coalesce into ever larger instances, possibly resulting in a single global instance. Grassroots platforms aim to offer an egalitarian/democratic alternative to centralised/autocratic and decentralised/plutocratic global platforms. Here, we present Grassroots Logic Programs (GLP), a multiagent concurrent logic programming language designed for the implementation of grassroots platforms: we recall the standard operational semantics of logic programs; introduce the concurrent operational semantics of GLP as its restriction; recall multiagent atomic transactions; use them to introduce a multiagent operational semantics of GLP; and prove multiagent GLP to be grassroots. The grassroots social graphâthe foundational grassroots platform on which all others are basedâserves as a GLP programming example.
Ehud Shapiro
London School of Economics · London School of Economics and Weizmann Institute of Science
A grassroots platform is a multiagent distributed system in which multiple independent instances can form and operate independently of each other and of any global resource, yet may coalesce into ever larger instances, possibly resulting in a single global instance. Grassroots platforms aim to offer an egalitarian/democratic alternative to centralised/autocratic and decentralised/plutocratic global platforms. Here, we present Grassroots Logic Programs (GLP), a multiagent concurrent logic programming language designed for the implementation of grassroots platforms: we recall the standard operational semantics of logic programs; introduce the concurrent operational semantics of GLP as its restriction; recall multiagent atomic transactions; use them to introduce a multiagent operational semantics of GLP; and prove multiagent GLP to be grassroots. The grassroots social graph -- the foundational grassroots platform on which all others are based -- serves as a GLP programming example. These mathematical foundations are being used by AI to implement GLP as well as to program in GLP: a workstation-based implementation of concurrent GLP in Dart was derived from the concurrent operational semantics of GLP; a multiagent smartphone-based implementation of GLP in Dart/Flutter is being developed based on the multiagent operational semantics of GLP; a moded type system for GLP was designed (and implemented by AI in Dart) to facilitate collaborative human-AI development of GLP programs, where AI derives working GLP programs from human-approved type definitions and declarations; GLP implementations of grassroots platforms for the social graph, social networks, currencies and bonds, and more, have been derived by AI from mathematical specifications written as volitional multiagent atomic transactions.
Ehud Shapiro
London School of Economics and Weizmann Institute of Science
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. The language was introduced together with concurrent (cGLP) and multiagent (maGLP) operational semantics. Here, we derive from these (1) dGLP, a deterministic counterpart of cGLP, and (2) madGLP, a counterpart of maGLP in which deterministic agents communicate solely by asynchronous message passing, and prove them correct against their abstract counterparts. maGLP shared variable pairs spanning agents can be implemented by two local variable pairs joined by a global link, with correctness following from disjoint substitution commutativity (a consequence of GLP's single-occurrence invariant). We further prove that madGLP is grassroots. Both dGLP and madGLP serve as formal specifications for an AI-driven implementation discipline (math → informal spec → Dart) employed and described here: from dGLP, AI (Claude) developed a workstation-based GLP implementation in Dart, and from madGLP it is developing a smartphone-based multiagent one.
Ehud Shapiro
London School of Economics and Weizmann Institute of Science