SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.04632 · 2021

Algorithmic Causal Effect Identification with causaleffect

arXiv · PDF · Open in the Atlas

Code that ran

1 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 6 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2107.04632.json · badge: /api/ran/2107.04632.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
pedemonte96/causaleffect canonical (classifier label)
classifier basis: census
1 ran · 6 no recorded run
FunctionStatusWhere it lives
get_new_probability Ran
ran on a synthesized input
pedemonte96/causaleffect/causaleffect/probability.py
code served (permissive licence) · get_code("318bd626be7e05a0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MockProbability. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from collections import defaultdict

class MockProbability:
    """Mock probability object that mimics the interface used in get_new_probability"""
    def __init__(self):
        self._recursive = False
        self._sumset = set()
        self._var = set()
        self._fraction = False
        self._divisor = None
    
    def copy(self):
        """Create a copy of this probability object"""
        new_prob = MockProbability()
        new_prob._recursive = self._recursive
        new_prob._sumset = self._sumset.copy()
        new_prob._var = self._var.copy()
        new_prob._fraction = self._fraction
        new_prob._divisor = self._divisor.copy() if self._divisor else None
        return new_prob
    
    def getFreeVariables(self):
        """Return the set of free variables"""
        return {'a', 'b', 'c', 'd'}
    
    def simplify(self, complete=False):
        """Simplify the probability (no-op for mock)"""
        pass

torch.manual_seed(0)

P = MockProbability()
var = {'a', 'b'}
cond = {'c'}

ARGS = {
    'P': P,
    'var': var,
    'cond': cond
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockProbability — a MockProbability output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockProbability output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ID Not yet run
unverified (harvested, no recorded run)
pedemonte96/causaleffect/causaleffect/id.py
code served (permissive licence) · get_code("9d58a468284e73e2")
How it ran

no invocation recorded.

IDC Not yet run
unverified (harvested, no recorded run)
pedemonte96/causaleffect/causaleffect/id.py
code served (permissive licence) · get_code("18da223cb570ceac")
How it ran

no invocation recorded.

ID_rec Not yet run
unverified (harvested, no recorded run)
pedemonte96/causaleffect/causaleffect/id.py
code served (permissive licence) · get_code("fcb8b37a1b0a326f")
How it ran

no invocation recorded.

get_C_components Not yet run
unverified (harvested, no recorded run)
pedemonte96/causaleffect/causaleffect/graph.py
code served (permissive licence) · get_code("2be7da0c5587f90a")
How it ran

no invocation recorded.

get_directed_bidirected_graphs Not yet run
unverified (harvested, no recorded run)
pedemonte96/causaleffect/causaleffect/graph.py
code served (permissive licence) · get_code("1327ca6e73115621")
How it ran

no invocation recorded.

plotGraph Not yet run
unverified (harvested, no recorded run)
pedemonte96/causaleffect/causaleffect/graph.py
code served (permissive licence) · get_code("d571d8f805c1ea52")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Our evolution as a species made a huge step forward when we understood the relationships between causes and effects. These associations may be trivial for some events, but they are not in complex scenarios. To rigorously prove that some occurrences are caused by others, causal theory and causal inference were formalized, introducing the $do$-operator and its associated rules. The main goal of this report is to review and implement in Python some algorithms to compute conditional and non-conditional causal queries from observational data. To this end, we first present some basic background knowledge on probability and graph theory, before introducing important results on causal theory, used in the construction of the algorithms. We then thoroughly study the identification algorithms presented by Shpitser and Pearl in 2006, explaining our implementation in Python alongside. The main identification algorithm can be seen as a repeated application of the rules of $do$-calculus, and it eventually either returns an expression for the causal query from experimental probabilities or fails to identify the causal effect, in which case the effect is non-identifiable. We introduce our newly developed Python library and give some usage examples.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2107.04632")
get_code_for_paper("2107.04632")
have("2107.04632")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2107.04632.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2107.04632.svg)](https://syntology.ai/paper/2107.04632)

Connect an agent — have() is free.