Research source · python
check_clipped_cone_events_independent.py
tools/research/check_clipped_cone_events_independent.py
29 lines. Source is displayed for inspection; it is not executed by this page.
File fingerprint
SHA-256: 1ecb221f5b096197aa1212bcb84e4635de81e370f018d3ce9550c0c770be34d8
#!/usr/bin/env python3
"""Independent exhaustive finite semantics; integer/max/list operations are
oracles, not a native scheduler. No primary-model imports.
"""
from itertools import product, combinations
H=4
words=[''.join(w) for n in range(1,H+1) for w in product('01',repeat=n)]
rows=[(''.join(q),a,b) for d in range(H) for q in product('01',repeat=d) for a in range(d+1,H+1) for b in range(a,H+1)]
checks=0
negative=0
for chosen in combinations(rows,3):
for word in words:
pending=[]
maximum=0
for n in range(1,len(word)+1):
# A cone becomes eligible for this path when all its parent bits exist.
for q,a,b in chosen:
if len(q)==n-1 and word[:n-1]==q:
pending.append((a,b))
activated=[b for a,b in pending if a==n]
maximum=max([maximum]+activated)
actual=n<=maximum
expected=any(word[:len(q)]==q and len(q)<n and a<=n<=b for q,a,b in chosen)
assert actual==expected,(chosen,word,n,actual,expected)
checks+=1
negative+=not expected
print({'rows':len(rows),'triples':len(list(combinations(rows,3))),'prefix_checks':checks,'negative':negative})
# Power-of-two prefix lengths exceed every fixed log-band charge.
print({'route_to_band_ratios':[(2**e, e+1, round(2**e/(e+1),3)) for e in range(2,17)]})