Atelier des rouesLab FR
Objects/Documentation

temoin_xiv.py

Code, data or reproducible check for the agregats dossier.

Download ↓
"""Composition of typed binary relations with finitely many shared scenarios."""
from itertools import product
import json


def compose(left,right):
    return [[(left[i][0]&right[0][j]) | (left[i][1]&right[1][j])
             for j in range(2)] for i in range(2)]


def experiment():
    # Four scenarios, distinct intermediates. Compare with scenario-by-scenario reachability.
    inputs=[[[1,6],[12,10]],[[3,5],[6,9]],[[7,10],[4,11]]]
    x,y,z=inputs
    composed=compose(compose(x,y),z)
    assert composed==compose(x,compose(y,z))

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.