Examples

Questions you can run

Each example takes a real question from the philosophy of mind and turns it into a world, or a set of worlds to compare. The code uses the planned API, so it shows the idea rather than a finished program.

SubstanceSentience models

1. Emergentism versus immersionism

Emergentism says experience rises up from matter once it is organised in a certain way. Immersionism says the opposite: abstract experiences already exist, and an individual appears when a body "tunes in" to a combination of them. Are these really different theories, or two descriptions of the same world?

import gaiabasic as gb

def make(sentience):
    w = gb.World("symmetry", seed=7)
    w.sentience = sentience
    w.populate(gb.species.Fish, n=300)
    return w

emergent  = make(gb.Emergentism(threshold=gb.Complexity(min_neurons=5_000)))
immersion = make(gb.Immersionism(receiver=gb.Complexity(min_neurons=5_000)))

reports = [w.run(steps=20_000) for w in (emergent, immersion)]
print(gb.compare(reports).differences())

If the comparison shows no observable differences, the choice between the two theories cannot be settled by behaviour alone. That is itself a useful result.

2. Useful or inevitable?

If sentience is a mere by-product, like the noise of an aircraft engine, evolution cannot select for it. If it is useful, it must change behaviour, and somewhere matter should behave in ways physics alone does not predict. GaiaBasic counts those "rule breaks".

for causal in (False, True):
    w = gb.World(f"causal={causal}", seed=3)
    w.ontology  = gb.Dualism(gb.Matter, gb.Experience)
    w.sentience = gb.Emergentism(causal=causal)
    w.populate(gb.species.Mouse, n=500)
    r = w.run(steps=30_000)
    print(causal, r.rule_breaks.count, r.selection_pressure("sentience"))

Related: the research project Useful or inevitable?.

Research project →Matrix of hypotheses

3. P-zombies and motivation

A philosophical zombie behaves like us but feels nothing. Four configurations cover the main positions: sentient or not, and different or identical outcomes. GaiaBasic runs the full matrix and marks the cells that turn out to be incoherent. An incoherent cell is a valid result, not a failure.

matrix = gb.Grid(
    sentient=[True, False],
    affects_outcome=[True, False],
)
for cfg in matrix:
    w = gb.World(str(cfg))
    w.sentience = gb.Emergentism(enabled=cfg.sentient, causal=cfg.affects_outcome)
    w.populate(gb.species.Mammal, n=200)
    matrix.record(cfg, w.run(steps=10_000))

matrix.table(columns=["coherence", "fitness", "rule_breaks"])

4. Gradients of bliss

Could organisms motivated only by more or less pleasure behave as well as organisms driven by pain and pleasure? This idea comes from David Pearce. Two populations share an environment; only their valence model differs.

w = gb.World("bliss", seed=11)
w.populate(gb.species.Rabbit, n=200, tag="pain+pleasure",
           valence=gb.Valence.full())             # range -1 .. +1
w.populate(gb.species.Rabbit, n=200, tag="pleasure-only",
           valence=gb.Valence.gradient(0.2, 1.0))  # never below 0.2
w.environment.add(gb.hazards.Predators(), gb.hazards.Cold())

r = w.run(steps=40_000)
r.survival_by("tag").plot()

5. Is there more suffering than enjoyment in nature?

The answer depends on hidden assumptions: does a short life count as much as a long one? Does intensity scale with brain size? Do the many offspring of r-strategist species feel anything before they die? GaiaBasic makes each assumption a parameter, so we can see which ones the answer depends on.

study = gb.Sweep(
    intensity_scale=["flat", "neurons", "sqrt_neurons"],
    newborn_sentience=[True, False],
    suffering_when_dying=["full", "reduced"],
)
for cfg in study:
    w = gb.presets.Ecosystem(r_strategists=0.9, k_strategists=0.1)
    w.sentience = gb.Emergentism(intensity_scale=cfg.intensity_scale,
                                 from_birth=cfg.newborn_sentience)
    study.record(cfg, w.run(steps=100_000).valence_balance)

study.sensitivity()   # which assumption changes the sign of the result?

6. The evolution of pleasure

Agents have behaviour rules and a generator of experiences. Experience can be ignored (eliminativism), present but without effect (epiphenomenal emergence), or causal (dualism). Can patterns of sexual pleasure, such as single and multiple orgasm, evolve, and do they disappear when the rules that link them to reproduction are removed?

for model in (gb.Eliminativism(), gb.Epiphenomenalism(), gb.Dualism.interactive()):
    w = gb.World("pleasure", seed=5)
    w.sentience = model
    w.populate(gb.species.SexualAgent, n=1_000,
               rules=[gb.rules.ApproachPleasure(), gb.rules.StopWhenSatisfied()])
    r = w.run(steps=200_000)
    print(type(model).__name__, r.distribution("orgasm_pattern"))
IdentityTranscendence

7. Identity and transcendence

The same world can be counted in three ways. Under closed individualism, each animal is one subject. Under empty individualism, each moment is a new subject. Under open individualism, one subject has every experience. Transcendence operators let identities be copied or moved, for example into an afterlife.

w = gb.World("identities", seed=2)
w.populate(gb.species.Bird, n=100)
w.on_death(lambda being: gb.move(being.identity, to=w.realm("afterlife")))

for model in (gb.ClosedIndividualism(), gb.EmptyIndividualism(), gb.OpenIndividualism()):
    w.identity = model
    r = w.run(steps=10_000, replay=True)   # same physical history, recounted
    print(type(model).__name__, r.subjects, r.max_suffering_per_subject)