"""Recompute the empirical table for the bridge-derived disjunction:
for each n, count iso classes that are bridge-derived only / intertwining
only / both / neither (missing)."""
import sys
import os
sys.path.insert(0, '/Users/didericis/Code/math-research/papers/'
                'level_resolutions_of_maximal_planar_graphs/experiments')
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from triangulation_gen import enumerate_all_triangulations
from small_n_probe import is_bridge_derived
from test_disjunction import is_intertwining_tree


def main(ns):
    print('n  iso  bridge_only  inter_only  both  missing', flush=True)
    for n in ns:
        tris = enumerate_all_triangulations(n)
        bo = io = both = miss = 0
        for G in tris:
            bd = is_bridge_derived(G)
            it = is_intertwining_tree(G)
            if isinstance(it, tuple):
                it = it[0]
            if bd and it:
                both += 1
            elif bd:
                bo += 1
            elif it:
                io += 1
            else:
                miss += 1
        print(f'{n} {len(tris)} {bo} {io} {both} {miss}', flush=True)


if __name__ == '__main__':
    ns = [int(x) for x in sys.argv[1:]] or [6, 7, 8, 9, 10, 11, 12]
    main(ns)
